提交 f7b5dff0 编写于 作者: S Sakari Ailus 提交者: Mauro Carvalho Chehab

[media] media: Use all bits of an enumeration

The allocation takes place in longs. Assign the size of the enum
accordingly.
Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 3df0a7ee
...@@ -73,8 +73,9 @@ static inline const char *intf_type(struct media_interface *intf) ...@@ -73,8 +73,9 @@ static inline const char *intf_type(struct media_interface *intf)
__must_check int __media_entity_enum_init(struct media_entity_enum *ent_enum, __must_check int __media_entity_enum_init(struct media_entity_enum *ent_enum,
int idx_max) int idx_max)
{ {
ent_enum->bmap = kcalloc(DIV_ROUND_UP(idx_max, BITS_PER_LONG), idx_max = ALIGN(idx_max, BITS_PER_LONG);
sizeof(long), GFP_KERNEL); ent_enum->bmap = kcalloc(idx_max / BITS_PER_LONG, sizeof(long),
GFP_KERNEL);
if (!ent_enum->bmap) if (!ent_enum->bmap)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册