lkml.org 
[lkml]   [2016]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Subjectlinux-4.8-rc1/drivers/scsi/sd.c:317: pointless test ?
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

\
 
 \ /
  Last update: 2016-08-08 16:21    [W:0.031 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site