RE: [PATCH net-next 4/4] mlx4: sizeof style usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes, good catch.

-----Original Message-----
From: Tariq Toukan [mailto:tariqt@xxxxxxxxxxxx] 
Sent: Sunday, August 20, 2017 3:27 AM
To: Stephen Hemminger <stephen@xxxxxxxxxxxxxxxxxx>; mlindner@xxxxxxxxxxx; mst@xxxxxxxxxx; jasowang@xxxxxxxxxx
Cc: netdev@xxxxxxxxxxxxxxx; linux-rdma@xxxxxxxxxxxxxxx; virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx; Stephen Hemminger <sthemmin@xxxxxxxxxxxxx>
Subject: Re: [PATCH net-next 4/4] mlx4: sizeof style usage

[You don't often get email from TARIQT@xxxxxxxxxxxx. Learn why this is important at http://aka.ms/LearnAboutSenderIdentification.]

Thanks Stephen.
Sorry for the late reply, I was on vacation.
I know this is already accepted, but still I have one comment.

On 15/08/2017 8:29 PM, Stephen Hemminger wrote:
> 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@xxxxxxxxxxxxxxxxxx>
> ---
> @@ -726,7 +726,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq)
>                       }
>                       memcpy(&priv->mfunc.master.comm_arm_bit_vector,
>                              eqe->event.comm_channel_arm.bit_vec,
> -                            sizeof eqe->event.comm_channel_arm.bit_vec);
> +                            sizeof(eqe)->event.comm_channel_arm.bit_vec);

I think the brackets here are misplaced.
Shouldn't they be as follows?

sizeof(eqe->event.comm_channel_arm.bit_vec));

>                       queue_work(priv->mfunc.master.comm_wq,
>                                  &priv->mfunc.master.comm_work);
>                       break;

Thanks,
Tariq
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux