lkml.org 
[lkml]   [2018]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/3] scsi: check for equality of result byte values
Date
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.




\
 
 \ /
  Last update: 2018-06-12 17:13    [W:0.203 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site