Skip to contentSkip to conversation

mpi3mr: Fix partly outside array bounds type warnings

PATCH In review Sreekanth Reddy 2 participants 3 messages Aug 30, 2022 – Sep 1, 2022

Subsystems (2)
lore
Share & tools
lore

Sreekanth Reddy

author maintainer
#0 lore raw

cover mpi3mr: Fix partly outside array bounds type warnings

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(-)
Signature · 1 line
2.27.0
author maintainer
#1 lore raw

PATCH 1/1 mpi3mr: Fix partly outside array bounds type warnings

Fixed 'is partly outside array bounds of' type
compilation warnings.

---
 drivers/scsi/mpi3mr/mpi3mr_transport.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/mpi3mr/mpi3mr_transport.c +2 -1
index 203251c..2367d9f 100644
@@ -1607,7 +1607,8 @@ mpi3mr_update_mr_sas_port(struct mpi3mr_ioc *mrioc, struct host_port *h_port,
 	struct mpi3mr_sas_port *mr_sas_port)
 {
 	struct mpi3mr_sas_phy *mr_sas_phy;
-	u32 phy_mask_xor, phys_to_be_added, phys_to_be_removed;
+	u32 phy_mask_xor;
+	u64 phys_to_be_added, phys_to_be_removed;
 	int i;
 
 	h_port->used = 1;
Signature · 1 line
2.27.0