public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Andy Grover <agrover@redhat.com>, Christoph Hellwig <hch@lst.de>,
	linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] target/iscsi: precedence bug in iscsit_set_dataout_sequence_values()
Date: Wed, 03 Oct 2012 08:00:55 +0000	[thread overview]
Message-ID: <506BF0B7.9030807@bfs.de> (raw)
In-Reply-To: <1349209800.28145.66.camel@haakon2.linux-iscsi.org>



Am 02.10.2012 22:30, schrieb Nicholas A. Bellinger:
> On Tue, 2012-10-02 at 11:22 +0300, Dan Carpenter wrote:
>> Clang warns about this bug:
>> drivers/target/iscsi/iscsi_target_erl0.c:52:45: warning: operator '?:'
>> 	has lower precedence than '+'; '+' will be evaluated first
>> 	[-Wparentheses]
>>
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>> ---
>> Please review this very carefully because I haven't tested it.  It could
>> be that the check should be:
>> (data_done + data_length > FirstBurstLength) ? FirstBurstLength : data_length);
>> Instead of what I have which is:
>> data_done + (data_length > FirstBurstLength ? FirstBurstLength : data_length);
>>
>> diff --git a/drivers/target/iscsi/iscsi_target_erl0.c b/drivers/target/iscsi/iscsi_target_erl0.c
>> index 1a02016..2067efd 100644
>> --- a/drivers/target/iscsi/iscsi_target_erl0.c
>> +++ b/drivers/target/iscsi/iscsi_target_erl0.c
>> @@ -48,9 +48,9 @@ void iscsit_set_dataout_sequence_values(
>>  	if (cmd->unsolicited_data) {
>>  		cmd->seq_start_offset = cmd->write_data_done;
>>  		cmd->seq_end_offset = (cmd->write_data_done +
>> -			(cmd->se_cmd.data_length >
>> -			 conn->sess->sess_ops->FirstBurstLength) ?
>> -			conn->sess->sess_ops->FirstBurstLength : cmd->se_cmd.data_length);
>> +			((cmd->se_cmd.data_length >
>> +			  conn->sess->sess_ops->FirstBurstLength) ?
>> +			 conn->sess->sess_ops->FirstBurstLength : cmd->se_cmd.data_length));
>>  		return;
>>  	}
>>  
>> --
> 
> This is indeed the original intention and your patch is correct, so
> applied to for-next.
> 
> Thank you!
> 
> --nab
> 

please consider rewriting this into an if ... else ... statement.
See my comments and Dan's reply on this.

re,
 wh

      reply	other threads:[~2012-10-03  8:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02  8:22 [patch] target/iscsi: precedence bug in iscsit_set_dataout_sequence_values() Dan Carpenter
2012-10-02 11:48 ` walter harms
2012-10-02 12:27   ` Dan Carpenter
2012-10-02 20:30 ` Nicholas A. Bellinger
2012-10-03  8:00   ` walter harms [this message]

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=506BF0B7.9030807@bfs.de \
    --to=wharms@bfs.de \
    --cc=agrover@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hch@lst.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@vger.kernel.org \
    /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