Re: [PATCH 2/3] IB/srp: Enclose 14 expressions for the sizeof operator by parentheses

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

 



On Sat, 2017-04-08 at 14:12 +0200, SF Markus Elfring wrote:
[]
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
[]
> @@ -3308,7 +3308,7 @@ static ssize_t srp_create_target(struct device *dev,
>  	target_host->max_channel = 0;
>  	target_host->max_id      = 1;
>  	target_host->max_lun     = -1LL;
> -	target_host->max_cmd_len = sizeof ((struct srp_cmd *) (void *) 0L)->cdb;
> +	target_host->max_cmd_len = sizeof(((struct srp_cmd *)(void *)0L)->cdb);

Maybe better as:

	target_host->max_cmd_len = FIELD_SIZEOF(struct srp_cmd, cdb);

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux