Re: [PATCH 2/3] scsi: check for equality of result byte values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.








[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux