linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>,
	linux-rdma@vger.kernel.org,
	Bart Van Assche <bart.vanassche@sandisk.com>,
	Doug Ledford <dledford@redhat.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	Sean Hefty <sean.hefty@intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/3] IB/srp: Enclose 14 expressions for the sizeof operator by parentheses
Date: Sat, 08 Apr 2017 07:50:25 -0700	[thread overview]
Message-ID: <1491663025.3250.39.camel@perches.com> (raw)
In-Reply-To: <a7bdda64-7cd8-1107-9669-6ab0f70e16ad@users.sourceforge.net>

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);

  reply	other threads:[~2017-04-08 14:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-08 12:10 [PATCH 0/3] InfiniBand-SRP: Fine-tuning for some function implementations SF Markus Elfring
2017-04-08 12:11 ` [PATCH 1/3] IB/srp: Use kmalloc_array() in srp_alloc_req_data() SF Markus Elfring
2017-04-08 12:12 ` [PATCH 2/3] IB/srp: Enclose 14 expressions for the sizeof operator by parentheses SF Markus Elfring
2017-04-08 14:50   ` Joe Perches [this message]
2017-04-08 12:13 ` [PATCH 3/3] IB/srp: Delete unwanted spaces behind usages of the sizeof operator SF Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491663025.3250.39.camel@perches.com \
    --to=joe@perches.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=dledford@redhat.com \
    --cc=elfring@users.sourceforge.net \
    --cc=hal.rosenstock@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sean.hefty@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).