mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* linux-4.8-rc1/drivers/scsi/sd.c:317: pointless test ?
@ 2016-08-08 13:46 David Binderman
  2016-08-08 20:17 ` Laurence Oberman
  0 siblings, 1 reply; 2+ messages in thread
From: David Binderman @ 2016-08-08 13:46 UTC (permalink / raw)
  To: jejb, martin.petersen, linux-scsi, Linux Kernel Mailing List, dcb314

Hello there,

linux-4.8-rc1/drivers/scsi/sd.c:317]: (style) Unsigned variable 'val'
can't be negative so it is unnecessary to test it.

Source code is

    if (val >= 0 && val <= SD_DIF_TYPE3_PROTECTION)

but

   unsigned int val;

Suggest new code

    if (val <= SD_DIF_TYPE3_PROTECTION)

Regards

David Binderman

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

end of thread, other threads:[~2016-08-08 20:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-08 13:46 linux-4.8-rc1/drivers/scsi/sd.c:317: pointless test ? David Binderman
2016-08-08 20:17 ` Laurence Oberman

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

all inboxes | Powered by JetHome®