[tj-libata:for-4.8 41/41] drivers/ata/libata-scsi.c:3637:28: warning: suggest parentheses around comparison in operand of '&'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git for-4.8
head:   9b7844a8c34a0afd7fc59bacd2cf96f129dd8ae5
commit: 9b7844a8c34a0afd7fc59bacd2cf96f129dd8ae5 [41/41] libata-scsi: fix read-only bits checking in ata_mselect_*()
config: i386-randconfig-s1-201629 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        git checkout 9b7844a8c34a0afd7fc59bacd2cf96f129dd8ae5
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/asm-generic/bug.h:4:0,
                    from arch/x86/include/asm/bug.h:35,
                    from include/linux/bug.h:4,
                    from include/linux/mmdebug.h:4,
                    from include/linux/gfp.h:4,
                    from include/linux/slab.h:14,
                    from drivers/ata/libata-scsi.c:36:
   drivers/ata/libata-scsi.c: In function 'ata_mselect_caching':
>> drivers/ata/libata-scsi.c:3637:28: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
       if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
                          ~~~~~^~~~~~~~~
   include/linux/compiler.h:151:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> drivers/ata/libata-scsi.c:3637:4: note: in expansion of macro 'if'
       if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
       ^~
>> drivers/ata/libata-scsi.c:3637:28: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
       if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
                          ~~~~~^~~~~~~~~
   include/linux/compiler.h:151:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^~~~
>> drivers/ata/libata-scsi.c:3637:4: note: in expansion of macro 'if'
       if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
       ^~
>> drivers/ata/libata-scsi.c:3637:28: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
       if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
                          ~~~~~^~~~~~~~~
   include/linux/compiler.h:162:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^~~~
>> drivers/ata/libata-scsi.c:3637:4: note: in expansion of macro 'if'
       if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
       ^~
   drivers/ata/libata-scsi.c: In function 'ata_mselect_control':
   drivers/ata/libata-scsi.c:3702:28: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
       if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
                          ~~~~~^~~~~~~~~
   include/linux/compiler.h:151:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
   drivers/ata/libata-scsi.c:3702:4: note: in expansion of macro 'if'
       if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
       ^~
   drivers/ata/libata-scsi.c:3702:28: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
       if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
                          ~~~~~^~~~~~~~~
   include/linux/compiler.h:151:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^~~~
   drivers/ata/libata-scsi.c:3702:4: note: in expansion of macro 'if'
       if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
       ^~
   drivers/ata/libata-scsi.c:3702:28: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
       if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
                          ~~~~~^~~~~~~~~
   include/linux/compiler.h:162:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^~~~
   drivers/ata/libata-scsi.c:3702:4: note: in expansion of macro 'if'
       if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
       ^~

vim +3637 drivers/ata/libata-scsi.c

  3621		if (len != CACHE_MPAGE_LEN - 2) {
  3622			if (len < CACHE_MPAGE_LEN - 2)
  3623				*fp = len;
  3624			else
  3625				*fp = CACHE_MPAGE_LEN - 2;
  3626			return -EINVAL;
  3627		}
  3628	
  3629		/*
  3630		 * Check that read-only bits are not modified.
  3631		 */
  3632		ata_msense_caching(dev->id, mpage, false);
  3633		for (i = 0; i < CACHE_MPAGE_LEN - 2; i++) {
  3634			/* Check the first byte */
  3635			if (i == 0) {
  3636				/* except the WCE bit */
> 3637				if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
  3638					*fp = i;
  3639					return -EINVAL;
  3640				} else {
  3641					continue;
  3642				}
  3643			}
  3644	
  3645			/* Check the remaining bytes */

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: Binary data


[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux