public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/scsi/bfa/bfa_fcpim.c: boolean and / or confusion
       [not found] <4EE688FC.8090606@gmail.com>
@ 2011-12-13  0:02 ` Joe Perches
  2011-12-13  0:45   ` Jing Huang
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2011-12-13  0:02 UTC (permalink / raw)
  To: roel, Jing Huang, James E.J. Bottomley; +Cc: Andrew Morton, LKML, linux-scsi

On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
> The test not [val1] or not [val2] always evaluates to true

Looking at drivers with:

$ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-]+\s*\)\s*\|\|\s*\(\s*\1\s*\!\=" drivers

drivers/scsi/bfa/bfa_fcpim.c:			    ((cdb->scsi_cdb[0] != INQUIRY) ||
			    (cdb->scsi_cdb[0] != REPORT_LUNS))) {

Likely the || should be &&


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: drivers/scsi/bfa/bfa_fcpim.c: boolean and / or confusion
  2011-12-13  0:02 ` drivers/scsi/bfa/bfa_fcpim.c: boolean and / or confusion Joe Perches
@ 2011-12-13  0:45   ` Jing Huang
  0 siblings, 0 replies; 2+ messages in thread
From: Jing Huang @ 2011-12-13  0:45 UTC (permalink / raw)
  To: Joe Perches, roel, James E.J. Bottomley, Krishna Gudipati
  Cc: Andrew Morton, LKML, linux-scsi

>On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
>> The test not [val1] or not [val2] always evaluates to true
>
>Looking at drivers with:
>
>$ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-
>]+\s*\)\s*\|\|\s*\(\s*\1\s*\!\=" drivers
>
>drivers/scsi/bfa/bfa_fcpim.c:			    ((cdb->scsi_cdb[0] != INQUIRY) ||
>			    (cdb->scsi_cdb[0] != REPORT_LUNS))) {
>
>Likely the || should be &&

This is a bug and it should be &&. Will provide a fix.

Thanks
Jing

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-13  0:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4EE688FC.8090606@gmail.com>
2011-12-13  0:02 ` drivers/scsi/bfa/bfa_fcpim.c: boolean and / or confusion Joe Perches
2011-12-13  0:45   ` Jing Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox