]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
scsi_debug: test always evaluates to false, || should be used instead
authorColin Ian King <colin.king@canonical.com>
Thu, 22 Jan 2015 11:20:40 +0000 (11:20 +0000)
committerChristoph Hellwig <hch@lst.de>
Thu, 22 Jan 2015 16:50:52 +0000 (17:50 +0100)
commit6d310dfb382a303cbaf838e1b680f55cef18ae03
tree2c4ad24491b50fc5ed5737cb5cce46ac5a754d79
parent91724c20613484555ba7e7b3d8549dac1e24f7a8
scsi_debug: test always evaluates to false, || should be used instead

cppcheck found the following issue:
(warning) Logical conjunction always evaluates to false:
  alloc_len < 4 && alloc_len > 65535.

..the test should be instead:

  if (alloc_len < 4 || alloc_len > 65536)

This error was introduced by recent commit 38d5c8336e60bf6e53a1da9
("scsi_debug: add Report supported opcodes+tmfs; Compare and write")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/scsi_debug.c