drivers/mtd/chips/cfi_cmdset_0002.c bug report
David Binderman
dcb314 at hotmail.com
Sat Apr 30 02:13:47 PDT 2016
Hello there,
drivers/mtd/chips/cfi_cmdset_0002.c:569]: (style) Redundant condition: extp.MajorVersion=='1'. 'A || (!A && B)' is equivalent to 'A || B'
Source code is
if (extp->MajorVersion != '1' ||
(extp->MajorVersion == '1' && (extp->MinorVersion < '0' || extp->MinorVersion> '5'))) {
Suggest new code
if (extp->MajorVersion != '1' ||
(extp->MinorVersion < '0' || extp->MinorVersion> '5')) {
Also, some minor errors in the same file
[drivers/mtd/chips/cfi_cmdset_0002.c:1106]: (style) Variable 'cfi' is assigned a value that is never used.
[drivers/mtd/chips/cfi_cmdset_0002.c:2004]: (style) Variable 'cfi' is assigned a value that is never used.
Regards
David Binderman
More information about the linux-mtd
mailing list