Re: Linux 2.4.21rc1-ac4

Andreas Haumer (andreas@xss.co.at)
Sun, 04 May 2003 18:17:02 +0200


Hi!

Alan Cox wrote:
> Linux 2.4.21rc1-ac4
[...]
> o Merge some of Greg's ibmphp cleanups (Greg Kroah-Hartmann)
[...]

There are some problems with this merge...

*) It doesn't compile due to several problems in ibmphp_ebda.c
*) create_file_name() was changed to return -1 on failure
and 0 success, but it has still some return statements
inside returning NULL on error condition (having several
exit points in a single function is bad programming style
anyway, but here we have the worst case, it seems... )

The following patch makes it at least compile and tries to
fix the return-code mess. But IMHO the whole thing should
be cleaned up, so please re-check...

--- linux-2.4.21-rc1-ac4/drivers/hotplug/ibmphp_ebda.c.orig Sun May 4 11:30:18 2003
+++ linux-2.4.21-rc1-ac4/drivers/hotplug/ibmphp_ebda.c Sun May 4 18:05:57 2003
@@ -672,7 +672,7 @@

if (!slot_cur) {
err ("Structure passed is empty \n");
- return NULL;
+ return -1;
}

slot_num = slot_cur->number;
@@ -708,7 +708,7 @@
} else if (rio_table_ptr) {
if (rio_table_ptr->ver_num == 3) {
/* if both NULL and we DO have correct RIO table in BIOS */
- return NULL;
+ return -1;
}
}
if (!flag) {
@@ -754,7 +754,7 @@
struct ebda_hpc_slot *slot_ptr;
struct bus_info *bus_info_ptr1, *bus_info_ptr2;
int rc;
- struct slot *tmp_slot;
+ struct slot *tmp_slot, *slot_cur;
struct list_head *list;
char buf[32];

@@ -992,7 +992,7 @@
slot_cur = list_entry (list, struct slot, ibm_slot_list);
if(create_file_name (slot_cur, buf)==0)
{
- snprintf (slot_cur->hotplug_slot->name, 30, "%s", );
+ snprintf (slot_cur->hotplug_slot->name, 30, "%s", buf);
pci_hp_register (slot_cur->hotplug_slot);
}
}

Regards,

- andreas

-- 
Andreas Haumer                     | mailto:andreas@xss.co.at
*x Software + Systeme              | http://www.xss.co.at/
Karmarschgasse 51/2/20             | Tel: +43-1-6060114-0
A-1100 Vienna, Austria             | Fax: +43-1-6060114-71

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/