lkml.org 
[lkml]   [2020]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 13/40] scsi: qla4xxx: ql4_init: Check return value of pci_set_mwi()
Date
pci_set_mwi() has 'warn_unused_result' so the result should be checked.

Fixes the following W=1 kernel build warning(s):

drivers/scsi/qla4xxx/ql4_init.c: In function ‘qla4xxx_pci_config’:
drivers/scsi/qla4xxx/ql4_init.c:664:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]

And if 'status' is removed:

drivers/scsi/qla4xxx/ql4_init.c: In function ‘qla4xxx_pci_config’:
drivers/scsi/qla4xxx/ql4_init.c:666:2: warning: ignoring return value of ‘pci_set_mwi’, declared with attribute warn_unused_result [-Wunused-result]
666 | pci_set_mwi(ha->pdev);
| ^~~~~~~~~~~~~~~~~~~~~

Cc: QLogic-Storage-Upstream@qlogic.com
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/scsi/qla4xxx/ql4_init.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c
index 82f6e7f3969ec..4afd43610f68f 100644
--- a/drivers/scsi/qla4xxx/ql4_init.c
+++ b/drivers/scsi/qla4xxx/ql4_init.c
@@ -665,6 +665,9 @@ void qla4xxx_pci_config(struct scsi_qla_host *ha)

pci_set_master(ha->pdev);
status = pci_set_mwi(ha->pdev);
+ if (status)
+ ql4_printk(KERN_WARNING, ha, "Failed to set MWI\n");
+
/*
* We want to respect framework's setting of PCI configuration space
* command register and also want to make sure that all bits of
--
2.25.1
\
 
 \ /
  Last update: 2020-07-21 18:44    [W:1.325 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site