[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <45da3041af0060a0a914e04d4870182f640e7d9d.camel@wdc.com>
Date: Tue, 12 Jun 2018 15:12:00 +0000
From: Bart Van Assche <Bart.VanAssche@....com>
To: "jthumshirn@...e.de" <jthumshirn@...e.de>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>
CC: "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3] scsi: check for equality of result byte values
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.
Powered by blists - more mailing lists