[bug report] [SCSI] esas2r: Directly call kernel functions for atomic bit operations

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

 



[ Ancient code, but the fix should be obvious if anyone wanted to test
  it.  - dan ]

Hello Bradley Grove,

The patch 9588d24e3600: "[SCSI] esas2r: Directly call kernel
functions for atomic bit operations" from Oct 1, 2013, leads to the
following static checker warning:

	drivers/scsi/esas2r/esas2r_init.c:858 esas2r_init_adapter_struct()
	warn: 'AF2_SERIAL_FLASH' is a shifter (not for '|=').

drivers/scsi/esas2r/esas2r_init.c
   849          /*
   850           * the thunder_stream boards all have a serial flash part that has a
   851           * different base address on the AHB bus.
   852           */
   853          if ((a->pcid->subsystem_vendor == ATTO_VENDOR_ID)
   854              && (a->pcid->subsystem_device & ATTO_SSDID_TBT))
   855                  a->flags2 |= AF2_THUNDERBOLT;
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This should be "a->flags2 |= BIT(AF2_THUNDERBOLT)" or
set_bit(AF2_THUNDERBOLT, &&a->flags2);

   856  
   857          if (test_bit(AF2_THUNDERBOLT, &a->flags2))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
So that it matches this line.

   858                  a->flags2 |= AF2_SERIAL_FLASH;
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   859  
   860          if (a->pcid->subsystem_device == ATTO_TLSH_1068)
   861                  a->flags2 |= AF2_THUNDERLINK;
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Same for these.  But the code is really old and no one has noticed the
bug...

   862  
   863          /* Uncached Area */
   864          high = (u8 *)*uncached_area;
   865  

regards,
dan carpenter



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux