mbox series

[0/1] mpi3mr: Fix partly outside array bounds type warnings

Message ID 20220830085011.26079-1-sreekanth.reddy@broadcom.com
Headers show
Series mpi3mr: Fix partly outside array bounds type warnings | expand

Message

Sreekanth Reddy Aug. 30, 2022, 8:50 a.m. UTC
Fix below compilation warning reported with W=1,

include/linux/find.h:40:23: warning: array subscript 'long unsigned int[0]'
is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'}
[-Warray-bounds]
      40 |                 val = *addr & GENMASK(size - 1, offset);
         |                       ^~~~~
   drivers/scsi/mpi3mr/mpi3mr_transport.c:1610:27: note: while referencing
'phys_to_be_added'
    1610 |         u32 phy_mask_xor, phys_to_be_added, phys_to_be_removed;
         |                           ^~~~~~~~~~~~~~~~

Sreekanth Reddy (1):
  mpi3mr: Fix partly outside array bounds type warnings

 drivers/scsi/mpi3mr/mpi3mr_transport.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Martin K. Petersen Sept. 1, 2022, 4:18 a.m. UTC | #1
Sreekanth,

> Fix below compilation warning reported with W=1,

Amended original commit. Thanks!