mlx4: sizeof style usage
The kernel coding style is to treat sizeof as a function (ie. with parenthesis) not as an operator. Also use kcalloc and kmalloc_array Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
9d2ee98daf
commit
31975e27a4
@@ -2637,7 +2637,7 @@ int mlx4_cmd_use_events(struct mlx4_dev *dev)
|
||||
int err = 0;
|
||||
|
||||
priv->cmd.context = kmalloc(priv->cmd.max_cmds *
|
||||
sizeof (struct mlx4_cmd_context),
|
||||
sizeof(struct mlx4_cmd_context),
|
||||
GFP_KERNEL);
|
||||
if (!priv->cmd.context)
|
||||
return -ENOMEM;
|
||||
@@ -2695,7 +2695,7 @@ struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev)
|
||||
{
|
||||
struct mlx4_cmd_mailbox *mailbox;
|
||||
|
||||
mailbox = kmalloc(sizeof *mailbox, GFP_KERNEL);
|
||||
mailbox = kmalloc(sizeof(*mailbox), GFP_KERNEL);
|
||||
if (!mailbox)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
Reference in New Issue
Block a user