Skip to contentSkip to conversation

dmi_table counting in ipmi_si_intf.c

PATCH Vernon Mauery 2 participants 2 messages Aug 9, 2005 IPMI

lore
Share & tools
lore
#0 lore raw

I am working on getting one of the IBM blades to use ipmi and have run into a problem. The driver doesn't load because it says it can't find the device.

dmidecode shows that there are 39 entries and that the last one is the BMC. I looked into dmi_table and noticed that it parses the table by length and by number of entries. But I found that it goes from i=1 to i<num. This causes it to skip the last entry in the table. Is there a reason it is i=1 instead of i=0? or for that matter i<num instead of i<=num?

Ensure that all dmi table entries get parsed.

---

drivers/char/ipmi/ipmi_si_intf.c +1 -1
diff -uar a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1690,7 +1690,7 @@ static int dmi_table(u32 base, int len, 
 	u8 		  __iomem *buf;
 	struct dmi_header __iomem *dm;
 	u8 		  __iomem *data;
-	int 		  i=1;
+	int 		  i=0;
 	int		  status=-1;
 	int               intf_num = 0;
 
#1 lore raw

I have no idea why that value was a "1". However, looking at this, the "0" does seem correct; this is a valid patch.

-Corey

Quoted 32 lines · Vernon Mauery

I am working on getting one of the IBM blades to use ipmi and have run into a problem. The driver doesn't load because it says it can't find the device.

dmidecode shows that there are 39 entries and that the last one is the BMC. I looked into dmi_table and noticed that it parses the table by length and by number of entries. But I found that it goes from i=1 to i<num. This causes it to skip the last entry in the table. Is there a reason it is i=1 instead of i=0? or for that matter i<num instead of i<=num?

Ensure that all dmi table entries get parsed.

---

diff -uar a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c

drivers/char/ipmi/ipmi_si_intf.c +1 -1
@@ -1690,7 +1690,7 @@ static int dmi_table(u32 base, int len, 
 	u8 		  __iomem *buf;
 	struct dmi_header __iomem *dm;
 	u8 		  __iomem *data;
-	int 		  i=1;
+	int 		  i=0;
 	int		  status=-1;
 	int               intf_num = 0;