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

2017-10-26 Thread Tariq Toukan



On 20/08/2017 9:00 PM, Stephen Hemminger wrote:

Yes, good catch.


OK, I will include a fix for this in my next series.
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


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

2017-10-26 Thread Leon Romanovsky
On Tue, Aug 15, 2017 at 10:29:19AM -0700, 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 
> ---
>  drivers/net/ethernet/mellanox/mlx4/alloc.c |  2 +-
>  drivers/net/ethernet/mellanox/mlx4/cmd.c   |  4 ++--
>  drivers/net/ethernet/mellanox/mlx4/en_resources.c  |  2 +-
>  drivers/net/ethernet/mellanox/mlx4/en_rx.c |  2 +-
>  drivers/net/ethernet/mellanox/mlx4/en_tx.c |  2 +-
>  drivers/net/ethernet/mellanox/mlx4/eq.c| 20 +-
>  drivers/net/ethernet/mellanox/mlx4/fw.c|  2 +-
>  drivers/net/ethernet/mellanox/mlx4/icm.c   |  2 +-
>  drivers/net/ethernet/mellanox/mlx4/icm.h   |  4 ++--
>  drivers/net/ethernet/mellanox/mlx4/intf.c  |  2 +-
>  drivers/net/ethernet/mellanox/mlx4/main.c  | 12 +--
>  drivers/net/ethernet/mellanox/mlx4/mcg.c   | 12 +--
>  drivers/net/ethernet/mellanox/mlx4/mr.c| 10 -
>  drivers/net/ethernet/mellanox/mlx4/qp.c| 12 +--
>  .../net/ethernet/mellanox/mlx4/resource_tracker.c  | 24 
> +++---
>  15 files changed, 56 insertions(+), 56 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky 


signature.asc
Description: PGP signature
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

2017-08-20 Thread Stephen Hemminger via Virtualization
Yes, good catch.

-Original Message-
From: Tariq Toukan [mailto:tar...@mellanox.com] 
Sent: Sunday, August 20, 2017 3:27 AM
To: Stephen Hemminger <step...@networkplumber.org>; mlind...@marvell.com; 
m...@redhat.com; jasow...@redhat.com
Cc: net...@vger.kernel.org; linux-r...@vger.kernel.org; 
virtualization@lists.linux-foundation.org; Stephen Hemminger 
<sthem...@microsoft.com>
Subject: Re: [PATCH net-next 4/4] mlx4: sizeof style usage

[You don't often get email from tar...@mellanox.com. 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 <step...@networkplumber.org>
> ---
> @@ -726,7 +726,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct 
> mlx4_eq *eq)
>   }
>   memcpy(>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,
>  >mfunc.master.comm_work);
>   break;

Thanks,
Tariq
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization