Skip to contentSkip to conversation

iscsi_ibft_find unused variable i

PATCH In review Connor Hansen 3 participants 3 messages Jun 5, 2011 – Jun 6, 2011 iSCSI boot firmware table (iBFT) driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iscsi_ibft_find unused variable i

int i is only needed if CONFIG_ACPI is set so move it within ifdef so kernels without ACPI dont allocate space for nothing. Fixes warning too.

---
 drivers/firmware/iscsi_ibft_find.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/firmware/iscsi_ibft_find.c +1 -1
index f032e44..c2bfa50 100644
@@ -108,10 +108,10 @@ done:
  */
 unsigned long __init find_ibft_region(unsigned long *sizep)
 {
-	int i;
 	ibft_addr = NULL;
 
 #ifdef CONFIG_ACPI
+	int i;
 	for (i = 0; i < ARRAY_SIZE(ibft_signs) && !ibft_addr; i++)
 		acpi_table_parse(ibft_signs[i].sign, acpi_find_ibft);
 #endif /* CONFIG_ACPI */
Signature · 1 line
1.7.4.4
maintainer
#1 lore raw
Quoted 5 lines · Connor Hansen

int i is only needed if CONFIG_ACPI is set so move it within ifdef so kernels without ACPI dont allocate space for nothing. Fixes warning too.

Reasonable enough.

Quoted 20 lines
---
 drivers/firmware/iscsi_ibft_find.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/firmware/iscsi_ibft_find.c +1 -1
index f032e44..c2bfa50 100644
@@ -108,10 +108,10 @@ done:
  */
 unsigned long __init find_ibft_region(unsigned long *sizep)
 {
-	int i;
 	ibft_addr = NULL;
 
 #ifdef CONFIG_ACPI
+	int i;
 	for (i = 0; i < ARRAY_SIZE(ibft_signs) && !ibft_addr; i++)
 		acpi_table_parse(ibft_signs[i].sign, acpi_find_ibft);
 #endif /* CONFIG_ACPI */
Signature · 8 lines
        Peter

Space, is big. Really big. You just won't believe how vastly hugely
mindbogglingly big it is. I mean you may think it's a long way down the
road to the chemist, but that's just peanuts to space.
		-- The Hitchhiker's Guide to the Galaxy

01234567890123456789012345678901234567890123456789012345678901234567890123456789