mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-15 19:25:13 +00:00
[media] media: Use all bits of an enumeration
The allocation takes place in longs. Assign the size of the enum accordingly. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
3df0a7ee0a
commit
f7b5dff0b5
1 changed files with 3 additions and 2 deletions
|
|
@ -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,
|
||||
int idx_max)
|
||||
{
|
||||
ent_enum->bmap = kcalloc(DIV_ROUND_UP(idx_max, BITS_PER_LONG),
|
||||
sizeof(long), GFP_KERNEL);
|
||||
idx_max = ALIGN(idx_max, BITS_PER_LONG);
|
||||
ent_enum->bmap = kcalloc(idx_max / BITS_PER_LONG, sizeof(long),
|
||||
GFP_KERNEL);
|
||||
if (!ent_enum->bmap)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue