From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: 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: [patch] target/iscsi: precedence bug in iscsit_set_dataout_sequence_values()
Date: Tue, 02 Oct 2012 08:22:48 +0000 [thread overview]
Message-ID: <20121002082248.GB12398@elgon.mountain> (raw)
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;
}
next reply other threads:[~2012-10-02 8:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-02 8:22 Dan Carpenter [this message]
2012-10-02 11:48 ` [patch] target/iscsi: precedence bug in iscsit_set_dataout_sequence_values() walter harms
2012-10-02 12:27 ` Dan Carpenter
2012-10-02 20:30 ` Nicholas A. Bellinger
2012-10-03 8:00 ` walter harms
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=20121002082248.GB12398@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=agrover@redhat.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