Skip to contentSkip to conversation

qla2xxx: Fix for build warning

PATCH In review Anirban Chakraborty 2 participants 3 messages Nov 10, 2008 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 qla2xxx: Fix for build warning

Here is the patch that takes care of the build warning due to a missing initializer for a local variable in qla probe function. Please apply.

Thanks,
Anirban

---
 drivers/scsi/qla2xxx/qla_os.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +1 -1
index 05db166..9aa24a4 100644
@@ -1563,7 +1563,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	char pci_info[30];
 	char fw_str[30];
 	struct scsi_host_template *sht;
-	int bars, mem_only, max_id = 0;
+	int bars, mem_only = 0, max_id = 0;
 	uint16_t req_length = 0, rsp_length = 0;
 
 	bars = pci_select_bars(pdev, IORESOURCE_MEM | IORESOURCE_IO);
#2 lore raw

Hi Anirban,

Quoted 19 lines · On Mon, 10 Nov 2008 12:26:23 -0800 (PST) Anirban Chakraborty…

Here is the patch that takes care of the build warning due to a missing initializer for a local variable in qla probe function. Please apply.

Thanks,
Anirban

---
 drivers/scsi/qla2xxx/qla_os.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +0 -0
index 05db166..9aa24a4 100644

drivers/scsi/qla2xxx/qla_os.c qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) · line 1566

Quoted 5 lines
drivers/scsi/qla2xxx/qla_os.c +1 -1
@@ -1563,7 +1563,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	char pci_info[30];
 	char fw_str[30];
 	struct scsi_host_template *sht;
-	int bars, mem_only, max_id = 0;
+	int bars, mem_only = 0, max_id = 0;

Except that max_id does not need to be initialised (its is assigned unconditionally before being used). I suspect what happened is that in the origin patch, the ", max_id" was inserted before the " = 0" instead of after it.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#3 lore raw
In reply to Anirban Chakraborty

Thanks Stephen for pointing it out. The updated patch goes here.

Thanks,
Anirban

---
 drivers/scsi/qla2xxx/qla_os.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +1 -1
index 05db166..9830fcb 100644
@@ -1563,7 +1563,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	char pci_info[30];
 	char fw_str[30];
 	struct scsi_host_template *sht;
-	int bars, mem_only, max_id = 0;
+	int bars, max_id, mem_only = 0;
 	uint16_t req_length = 0, rsp_length = 0;
 
 	bars = pci_select_bars(pdev, IORESOURCE_MEM | IORESOURCE_IO);