lkml.org 
[lkml]   [2017]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/3] IB/srp: Enclose 14 expressions for the sizeof operator by parentheses
From
Date
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);

\
 
 \ /
  Last update: 2017-04-08 16:50    [W:0.773 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site