Skip to contentSkip to conversation

mpt2sas: _scsih_sas_broadcast_primitive_event: Quiet unused variable warning

PATCH In review Tim Gardner 2 participants 2 messages Feb 20, 2013 – Feb 26, 2013 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpt2sas: _scsih_sas_broadcast_primitive_event: Quiet unused variable warning

If CONFIG_SCSI_MPT2SAS_LOGGING is undefined, then these warnings are emitted:

drivers/scsi/mpt2sas/mpt2sas_scsih.c: In function '_scsih_sas_broadcast_primitive_event':
drivers/scsi/mpt2sas/mpt2sas_scsih.c:5810:40: warning: unused variable 'event_data' [-Wunused-variable]

Add __maybe_unused to the definition of event_data.

Cc Nagalakshmi Nandigama <[email protected]>
Cc Sreekanth Reddy <[email protected]>
Cc "James E.J. Bottomley" <[email protected]>
---
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/mpt2sas/mpt2sas_scsih.c +2 -1
index c6bdc92..416f907 100644
@@ -5807,7 +5807,8 @@ _scsih_sas_broadcast_primitive_event(struct MPT2SAS_ADAPTER *ioc,
 	u32 termination_count;
 	u32 query_count;
 	Mpi2SCSITaskManagementReply_t *mpi_reply;
-	Mpi2EventDataSasBroadcastPrimitive_t *event_data = fw_event->event_data;
+	Mpi2EventDataSasBroadcastPrimitive_t *event_data __maybe_unused =
+		fw_event->event_data;
 	u16 ioc_status;
 	unsigned long flags;
 	int r;
Signature · 1 line
1.7.9.5
#1 lore raw

Hi Tim,

Today I have sent the below titled patch to upstream which fix the "Unused variable 'event_data' warning".
The Patch title is
"[PATCH][SCSI] mpt2sas: fix for unused variable 'event_data' warning"

This patch will help you in fixing the "Unused variable 'event_data' warning".

Thanks,
Sreekanth

Quoted 56 lines

-----Original Message-----
From: [email protected] [mailto:linux-scsi- [email protected]] On Behalf Of Tim Gardner
Sent: Thursday, February 21, 2013 12:18 AM
To: [email protected]
Cc: Tim Gardner; Nandigama, Nagalakshmi; Reddy, Sreekanth; Support; James E.J. Bottomley; DL-MPT Fusion Linux; [email protected]
Subject: [PATCH linux/linux-next] mpt2sas:
_scsih_sas_broadcast_primitive_event: Quiet unused variable warning

If CONFIG_SCSI_MPT2SAS_LOGGING is undefined, then these warnings are emitted:

drivers/scsi/mpt2sas/mpt2sas_scsih.c: In function '_scsih_sas_broadcast_primitive_event':
drivers/scsi/mpt2sas/mpt2sas_scsih.c:5810:40: warning: unused variable 'event_data' [-Wunused-variable]

Add __maybe_unused to the definition of event_data.

Cc Nagalakshmi Nandigama <[email protected]>
Cc Sreekanth Reddy <[email protected]>
Cc "James E.J. Bottomley" <[email protected]>
---
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/mpt2sas/mpt2sas_scsih.c +1 -1
index c6bdc92..416f907 100644
@@ -5807,7 +5807,8 @@ _scsih_sas_broadcast_primitive_event(struct
 MPT2SAS_ADAPTER *ioc,
 	u32 termination_count;
 	u32 query_count;
 	Mpi2SCSITaskManagementReply_t *mpi_reply;
-	Mpi2EventDataSasBroadcastPrimitive_t *event_data = fw_event-
 >event_data;
+	Mpi2EventDataSasBroadcastPrimitive_t *event_data

__maybe_unused =

drivers/scsi/mpt2sas/mpt2sas_scsih.c +1 -1
+		fw_event->event_data;
 	u16 ioc_status;
 	unsigned long flags;
 	int r;
--

1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html