From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "jthumshirn@suse.de" <jthumshirn@suse.de>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] scsi: check for equality of result byte values
Date: Tue, 12 Jun 2018 15:12:00 +0000 [thread overview]
Message-ID: <45da3041af0060a0a914e04d4870182f640e7d9d.camel@wdc.com> (raw)
In-Reply-To: <20180612135311.13216-3-jthumshirn@suse.de>
On Tue, 2018-06-12 at 15:53 +0200, Johannes Thumshirn wrote:
> - || status_byte(cmd->result) &
> + || status_byte(cmd->result) ==
> CHECK_CONDITION)) {
Is "status_byte(cmd->result) == CHECK_CONDITION" short enough for a single
line of code? Is the line splitting really necessary?
> - if (!(driver_byte(result) & DRIVER_SENSE) ||
> + if (!(driver_byte(result) == DRIVER_SENSE) ||
Please change (!(x == y)) into (x != y).
> - if ((driver_byte(result) & DRIVER_SENSE) &&
> + if ((driver_byte(result) == DRIVER_SENSE) &&
Please change (driver_byte(result) == DRIVER_SENSE) into
driver_byte(result) == DRIVER_SENSE.
> - ((driver_byte(the_result) & DRIVER_SENSE) &&
> + ((driver_byte(the_result) == DRIVER_SENSE) &&
Same comment here.
> - if ((driver_byte(the_result) & DRIVER_SENSE) == 0) {
> + if ((driver_byte(the_result) == DRIVER_SENSE) == 0) {
Please change (x == y) == 0 into x != y.
Thanks,
Bart.
next prev parent reply other threads:[~2018-06-12 15:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 13:53 [PATCH 0/3] Preparation patch-set for SCSI results rework Johannes Thumshirn
2018-06-12 13:53 ` [PATCH 1/3] scsi: remove Scsi_Cmnd typedef Johannes Thumshirn
2018-06-12 15:08 ` Bart Van Assche
2018-06-12 13:53 ` [PATCH 2/3] scsi: check for equality of result byte values Johannes Thumshirn
2018-06-12 15:12 ` Bart Van Assche [this message]
2018-06-12 13:53 ` [PATCH 3/3] scsi: don't add scsi command result bytes Johannes Thumshirn
2018-06-12 15:02 ` kbuild test robot
2018-06-12 15:46 ` kbuild test robot
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=45da3041af0060a0a914e04d4870182f640e7d9d.camel@wdc.com \
--to=bart.vanassche@wdc.com \
--cc=jthumshirn@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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
all inboxes | Powered by JetHome®