Commit 27bfa35f authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Greg Kroah-Hartman

[PATCH] PCI Hotplug: Kill spaces before \n in ibmphp*

Don't use a space directly before '\n' in error/debug messages. This adds
extra code size, causes unneeded line breaks in xterms, noone else does it
and it's just superfluos and ugly.

This also adds a missing ")" in a comment.
parent 54e64237
...@@ -116,7 +116,7 @@ static int __init get_max_slots (void) ...@@ -116,7 +116,7 @@ static int __init get_max_slots (void)
list_for_each (tmp, &ibmphp_slot_head) { list_for_each (tmp, &ibmphp_slot_head) {
slot_cur = list_entry (tmp, struct slot, ibm_slot_list); slot_cur = list_entry (tmp, struct slot, ibm_slot_list);
/* sometimes the hot-pluggable slots start with 4 (not always from 1 */ /* sometimes the hot-pluggable slots start with 4 (not always from 1) */
slot_count = max (slot_count, slot_cur->number); slot_count = max (slot_count, slot_cur->number);
} }
return slot_count; return slot_count;
...@@ -187,7 +187,7 @@ static inline int power_on (struct slot *slot_cur) ...@@ -187,7 +187,7 @@ static inline int power_on (struct slot *slot_cur)
return retval; return retval;
} }
if (CTLR_RESULT (slot_cur->ctrl->status)) { if (CTLR_RESULT (slot_cur->ctrl->status)) {
err ("command not completed successfully in power_on \n"); err ("command not completed successfully in power_on\n");
return -EIO; return -EIO;
} }
long_delay (3 * HZ); /* For ServeRAID cards, and some 66 PCI */ long_delay (3 * HZ); /* For ServeRAID cards, and some 66 PCI */
...@@ -201,12 +201,12 @@ static inline int power_off (struct slot *slot_cur) ...@@ -201,12 +201,12 @@ static inline int power_off (struct slot *slot_cur)
retval = ibmphp_hpc_writeslot (slot_cur, cmd); retval = ibmphp_hpc_writeslot (slot_cur, cmd);
if (retval) { if (retval) {
err ("power off failed \n"); err ("power off failed\n");
return retval; return retval;
} }
if (CTLR_RESULT (slot_cur->ctrl->status)) { if (CTLR_RESULT (slot_cur->ctrl->status)) {
err ("command not completed successfully in power_off \n"); err ("command not completed successfully in power_off\n");
return -EIO; retval = -EIO;
} }
return 0; return 0;
} }
...@@ -520,7 +520,7 @@ static int get_bus_name (struct hotplug_slot *hotplug_slot, char * value) ...@@ -520,7 +520,7 @@ static int get_bus_name (struct hotplug_slot *hotplug_slot, char * value)
int rc = -ENODEV; int rc = -ENODEV;
struct slot *pslot = NULL; struct slot *pslot = NULL;
debug ("get_bus_name - Entry hotplug_slot[%lx] \n", (ulong)hotplug_slot); debug ("get_bus_name - Entry hotplug_slot[%lx]\n", (ulong)hotplug_slot);
ibmphp_lock_operations (); ibmphp_lock_operations ();
...@@ -654,7 +654,7 @@ int ibmphp_update_slot_info (struct slot *slot_cur) ...@@ -654,7 +654,7 @@ int ibmphp_update_slot_info (struct slot *slot_cur)
info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL); info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
if (!info) { if (!info) {
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -794,7 +794,7 @@ static u8 bus_structure_fixup (u8 busno) ...@@ -794,7 +794,7 @@ static u8 bus_structure_fixup (u8 busno)
dev->bus = bus; dev->bus = bus;
for (dev->devfn = 0; dev->devfn < 256; dev->devfn += 8) { for (dev->devfn = 0; dev->devfn < 256; dev->devfn += 8) {
if (!pci_read_config_word (dev, PCI_VENDOR_ID, &l) && l != 0x0000 && l != 0xffff) { if (!pci_read_config_word (dev, PCI_VENDOR_ID, &l) && l != 0x0000 && l != 0xffff) {
debug ("%s - Inside bus_struture_fixup() \n", __FUNCTION__); debug ("%s - Inside bus_struture_fixup()\n", __FUNCTION__);
pci_scan_bus (busno, ibmphp_pci_bus->ops, NULL); pci_scan_bus (busno, ibmphp_pci_bus->ops, NULL);
break; break;
} }
...@@ -829,7 +829,7 @@ static int ibm_configure_device (struct pci_func *func) ...@@ -829,7 +829,7 @@ static int ibm_configure_device (struct pci_func *func)
func->dev = pci_find_slot(func->busno, PCI_DEVFN(func->device, func->function)); func->dev = pci_find_slot(func->busno, PCI_DEVFN(func->device, func->function));
if (func->dev == NULL) { if (func->dev == NULL) {
err ("ERROR... : pci_dev still NULL \n"); err ("ERROR... : pci_dev still NULL\n");
return 0; return 0;
} }
} }
...@@ -883,7 +883,7 @@ static int set_bus (struct slot * slot_cur) ...@@ -883,7 +883,7 @@ static int set_bus (struct slot * slot_cur)
struct pci_dev *dev = NULL; struct pci_dev *dev = NULL;
int retval; int retval;
debug ("%s - entry slot # %d \n", __FUNCTION__, slot_cur->number); debug ("%s - entry slot # %d\n", __FUNCTION__, slot_cur->number);
if (SET_BUS_STATUS (slot_cur->ctrl) && is_bus_empty (slot_cur)) { if (SET_BUS_STATUS (slot_cur->ctrl) && is_bus_empty (slot_cur)) {
rc = slot_update (&slot_cur); rc = slot_update (&slot_cur);
if (rc) if (rc)
...@@ -934,12 +934,12 @@ static int set_bus (struct slot * slot_cur) ...@@ -934,12 +934,12 @@ static int set_bus (struct slot * slot_cur)
cmd = HPC_BUS_133PCIXMODE; cmd = HPC_BUS_133PCIXMODE;
break; break;
default: default:
err ("Wrong bus speed \n"); err ("Wrong bus speed\n");
return -ENODEV; return -ENODEV;
} }
break; break;
default: default:
err ("wrong slot speed \n"); err ("wrong slot speed\n");
return -ENODEV; return -ENODEV;
} }
debug ("setting bus speed for slot %d, cmd %x\n", slot_cur->number, cmd); debug ("setting bus speed for slot %d, cmd %x\n", slot_cur->number, cmd);
...@@ -949,14 +949,14 @@ static int set_bus (struct slot * slot_cur) ...@@ -949,14 +949,14 @@ static int set_bus (struct slot * slot_cur)
return retval; return retval;
} }
if (CTLR_RESULT (slot_cur->ctrl->status)) { if (CTLR_RESULT (slot_cur->ctrl->status)) {
err ("command not completed successfully in set_bus \n"); err ("command not completed successfully in set_bus\n");
return -EIO; return -EIO;
} }
} }
/* This is for x440, once Brandon fixes the firmware, /* This is for x440, once Brandon fixes the firmware,
will not need this delay */ will not need this delay */
long_delay (1 * HZ); long_delay (1 * HZ);
debug ("%s -Exit \n", __FUNCTION__); debug ("%s -Exit\n", __FUNCTION__);
return 0; return 0;
} }
...@@ -1009,13 +1009,13 @@ static inline void print_card_capability (struct slot *slot_cur) ...@@ -1009,13 +1009,13 @@ static inline void print_card_capability (struct slot *slot_cur)
{ {
info ("capability of the card is "); info ("capability of the card is ");
if ((slot_cur->ext_status & CARD_INFO) == PCIX133) if ((slot_cur->ext_status & CARD_INFO) == PCIX133)
info (" 133 MHz PCI-X \n"); info (" 133 MHz PCI-X\n");
else if ((slot_cur->ext_status & CARD_INFO) == PCIX66) else if ((slot_cur->ext_status & CARD_INFO) == PCIX66)
info (" 66 MHz PCI-X \n"); info (" 66 MHz PCI-X\n");
else if ((slot_cur->ext_status & CARD_INFO) == PCI66) else if ((slot_cur->ext_status & CARD_INFO) == PCI66)
info (" 66 MHz PCI \n"); info (" 66 MHz PCI\n");
else else
info (" 33 MHz PCI \n"); info (" 33 MHz PCI\n");
} }
...@@ -1033,11 +1033,11 @@ static int enable_slot (struct hotplug_slot *hs) ...@@ -1033,11 +1033,11 @@ static int enable_slot (struct hotplug_slot *hs)
ibmphp_lock_operations (); ibmphp_lock_operations ();
debug ("ENABLING SLOT........ \n"); debug ("ENABLING SLOT........\n");
slot_cur = (struct slot *) hs->private; slot_cur = (struct slot *) hs->private;
if ((rc = validate (slot_cur, ENABLE))) { if ((rc = validate (slot_cur, ENABLE))) {
err ("validate function failed \n"); err ("validate function failed\n");
goto error_nopower; goto error_nopower;
} }
...@@ -1045,13 +1045,13 @@ static int enable_slot (struct hotplug_slot *hs) ...@@ -1045,13 +1045,13 @@ static int enable_slot (struct hotplug_slot *hs)
rc = set_bus (slot_cur); rc = set_bus (slot_cur);
if (rc) { if (rc) {
err ("was not able to set the bus \n"); err ("was not able to set the bus\n");
goto error_nopower; goto error_nopower;
} }
/*-----------------debugging------------------------------*/ /*-----------------debugging------------------------------*/
get_cur_bus_info (&slot_cur); get_cur_bus_info (&slot_cur);
debug ("the current bus speed right after set_bus = %x \n", slot_cur->bus_on->current_speed); debug ("the current bus speed right after set_bus = %x\n", slot_cur->bus_on->current_speed);
/*----------------------------------------------------------*/ /*----------------------------------------------------------*/
rc = check_limitations (slot_cur); rc = check_limitations (slot_cur);
...@@ -1059,7 +1059,7 @@ static int enable_slot (struct hotplug_slot *hs) ...@@ -1059,7 +1059,7 @@ static int enable_slot (struct hotplug_slot *hs)
err ("Adding this card exceeds the limitations of this bus.\n"); err ("Adding this card exceeds the limitations of this bus.\n");
err ("(i.e., >1 133MHz cards running on same bus, or " err ("(i.e., >1 133MHz cards running on same bus, or "
">2 66 PCI cards running on same bus\n."); ">2 66 PCI cards running on same bus\n.");
err ("Try hot-adding into another bus \n"); err ("Try hot-adding into another bus\n");
rc = -EINVAL; rc = -EINVAL;
goto error_nopower; goto error_nopower;
} }
...@@ -1079,12 +1079,12 @@ static int enable_slot (struct hotplug_slot *hs) ...@@ -1079,12 +1079,12 @@ static int enable_slot (struct hotplug_slot *hs)
} }
/* Check to see the error of why it failed */ /* Check to see the error of why it failed */
if ((SLOT_POWER (slot_cur->status)) && !(SLOT_PWRGD (slot_cur->status))) if ((SLOT_POWER (slot_cur->status)) && !(SLOT_PWRGD (slot_cur->status)))
err ("power fault occurred trying to power up \n"); err ("power fault occurred trying to power up\n");
else if (SLOT_BUS_SPEED (slot_cur->status)) { else if (SLOT_BUS_SPEED (slot_cur->status)) {
err ("bus speed mismatch occurred. please check current bus speed and card capability \n"); err ("bus speed mismatch occurred. please check current bus speed and card capability\n");
print_card_capability (slot_cur); print_card_capability (slot_cur);
} else if (SLOT_BUS_MODE (slot_cur->ext_status)) { } else if (SLOT_BUS_MODE (slot_cur->ext_status)) {
err ("bus mode mismatch occurred. please check current bus mode and card capability \n"); err ("bus mode mismatch occurred. please check current bus mode and card capability\n");
print_card_capability (slot_cur); print_card_capability (slot_cur);
} }
ibmphp_update_slot_info (slot_cur); ibmphp_update_slot_info (slot_cur);
...@@ -1093,7 +1093,7 @@ static int enable_slot (struct hotplug_slot *hs) ...@@ -1093,7 +1093,7 @@ static int enable_slot (struct hotplug_slot *hs)
debug ("after power_on\n"); debug ("after power_on\n");
/*-----------------------debugging---------------------------*/ /*-----------------------debugging---------------------------*/
get_cur_bus_info (&slot_cur); get_cur_bus_info (&slot_cur);
debug ("the current bus speed right after power_on = %x \n", slot_cur->bus_on->current_speed); debug ("the current bus speed right after power_on = %x\n", slot_cur->bus_on->current_speed);
/*----------------------------------------------------------*/ /*----------------------------------------------------------*/
rc = slot_update (&slot_cur); rc = slot_update (&slot_cur);
...@@ -1102,17 +1102,17 @@ static int enable_slot (struct hotplug_slot *hs) ...@@ -1102,17 +1102,17 @@ static int enable_slot (struct hotplug_slot *hs)
rc = -EINVAL; rc = -EINVAL;
if (SLOT_POWER (slot_cur->status) && !(SLOT_PWRGD (slot_cur->status))) { if (SLOT_POWER (slot_cur->status) && !(SLOT_PWRGD (slot_cur->status))) {
err ("power fault occurred trying to power up... \n"); err ("power fault occurred trying to power up...\n");
goto error_power; goto error_power;
} }
if (SLOT_POWER (slot_cur->status) && (SLOT_BUS_SPEED (slot_cur->status))) { if (SLOT_POWER (slot_cur->status) && (SLOT_BUS_SPEED (slot_cur->status))) {
err ("bus speed mismatch occurred. please check current bus speed and card capability \n"); err ("bus speed mismatch occurred. please check current bus speed and card capability\n");
print_card_capability (slot_cur); print_card_capability (slot_cur);
goto error_power; goto error_power;
} }
/* Don't think this case will happen after above checks... but just in case, for paranoia sake */ /* Don't think this case will happen after above checks... but just in case, for paranoia sake */
if (!(SLOT_POWER (slot_cur->status))) { if (!(SLOT_POWER (slot_cur->status))) {
err ("power on failed... \n"); err ("power on failed...\n");
goto error_power; goto error_power;
} }
...@@ -1120,7 +1120,7 @@ static int enable_slot (struct hotplug_slot *hs) ...@@ -1120,7 +1120,7 @@ static int enable_slot (struct hotplug_slot *hs)
if (!slot_cur->func) { if (!slot_cur->func) {
/* We cannot do update_slot_info here, since no memory for /* We cannot do update_slot_info here, since no memory for
* kmalloc n.e.ways, and update_slot_info allocates some */ * kmalloc n.e.ways, and update_slot_info allocates some */
err ("out of system memory \n"); err ("out of system memory\n");
rc = -ENOMEM; rc = -ENOMEM;
goto error_power; goto error_power;
} }
...@@ -1133,7 +1133,7 @@ static int enable_slot (struct hotplug_slot *hs) ...@@ -1133,7 +1133,7 @@ static int enable_slot (struct hotplug_slot *hs)
debug ("b4 configure_card, slot_cur->bus = %x, slot_cur->device = %x\n", slot_cur->bus, slot_cur->device); debug ("b4 configure_card, slot_cur->bus = %x, slot_cur->device = %x\n", slot_cur->bus, slot_cur->device);
if (ibmphp_configure_card (slot_cur->func, slot_cur->number)) { if (ibmphp_configure_card (slot_cur->func, slot_cur->number)) {
err ("configure_card was unsuccessful... \n"); err ("configure_card was unsuccessful...\n");
ibmphp_unconfigure_card (&slot_cur, 1); /* true because don't need to actually deallocate resources, just remove references */ ibmphp_unconfigure_card (&slot_cur, 1); /* true because don't need to actually deallocate resources, just remove references */
debug ("after unconfigure_card\n"); debug ("after unconfigure_card\n");
slot_cur->func = NULL; slot_cur->func = NULL;
...@@ -1204,7 +1204,7 @@ int ibmphp_do_disable_slot (struct slot *slot_cur) ...@@ -1204,7 +1204,7 @@ int ibmphp_do_disable_slot (struct slot *slot_cur)
int rc; int rc;
u8 flag; u8 flag;
debug ("DISABLING SLOT... \n"); debug ("DISABLING SLOT...\n");
if ((slot_cur == NULL) || (slot_cur->ctrl == NULL)) { if ((slot_cur == NULL) || (slot_cur->ctrl == NULL)) {
return -ENODEV; return -ENODEV;
...@@ -1224,7 +1224,7 @@ int ibmphp_do_disable_slot (struct slot *slot_cur) ...@@ -1224,7 +1224,7 @@ int ibmphp_do_disable_slot (struct slot *slot_cur)
/* We need this for fncs's that were there on bootup */ /* We need this for fncs's that were there on bootup */
slot_cur->func = (struct pci_func *) kmalloc (sizeof (struct pci_func), GFP_KERNEL); slot_cur->func = (struct pci_func *) kmalloc (sizeof (struct pci_func), GFP_KERNEL);
if (!slot_cur->func) { if (!slot_cur->func) {
err ("out of system memory \n"); err ("out of system memory\n");
rc = -ENOMEM; rc = -ENOMEM;
goto error; goto error;
} }
...@@ -1306,15 +1306,15 @@ struct hotplug_slot_ops ibmphp_hotplug_slot_ops = { ...@@ -1306,15 +1306,15 @@ struct hotplug_slot_ops ibmphp_hotplug_slot_ops = {
static void ibmphp_unload (void) static void ibmphp_unload (void)
{ {
free_slots (); free_slots ();
debug ("after slots \n"); debug ("after slots\n");
ibmphp_free_resources (); ibmphp_free_resources ();
debug ("after resources \n"); debug ("after resources\n");
ibmphp_free_bus_info_queue (); ibmphp_free_bus_info_queue ();
debug ("after bus info \n"); debug ("after bus info\n");
ibmphp_free_ebda_hpc_queue (); ibmphp_free_ebda_hpc_queue ();
debug ("after ebda hpc \n"); debug ("after ebda hpc\n");
ibmphp_free_ebda_pci_rsrc_queue (); ibmphp_free_ebda_pci_rsrc_queue ();
debug ("after ebda pci rsrc \n"); debug ("after ebda pci rsrc\n");
kfree (ibmphp_pci_bus); kfree (ibmphp_pci_bus);
} }
......
...@@ -171,7 +171,7 @@ static void print_lo_info (void) ...@@ -171,7 +171,7 @@ static void print_lo_info (void)
{ {
struct rio_detail *ptr; struct rio_detail *ptr;
struct list_head *ptr1; struct list_head *ptr1;
debug ("print_lo_info ---- \n"); debug ("print_lo_info ----\n");
list_for_each (ptr1, &rio_lo_head) { list_for_each (ptr1, &rio_lo_head) {
ptr = list_entry (ptr1, struct rio_detail, rio_detail_list); ptr = list_entry (ptr1, struct rio_detail, rio_detail_list);
debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id); debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id);
...@@ -188,7 +188,7 @@ static void print_vg_info (void) ...@@ -188,7 +188,7 @@ static void print_vg_info (void)
{ {
struct rio_detail *ptr; struct rio_detail *ptr;
struct list_head *ptr1; struct list_head *ptr1;
debug ("%s --- \n", __FUNCTION__); debug ("%s ---\n", __FUNCTION__);
list_for_each (ptr1, &rio_vg_head) { list_for_each (ptr1, &rio_vg_head) {
ptr = list_entry (ptr1, struct rio_detail, rio_detail_list); ptr = list_entry (ptr1, struct rio_detail, rio_detail_list);
debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id); debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id);
...@@ -220,7 +220,7 @@ static void __init print_ibm_slot (void) ...@@ -220,7 +220,7 @@ static void __init print_ibm_slot (void)
list_for_each (ptr1, &ibmphp_slot_head) { list_for_each (ptr1, &ibmphp_slot_head) {
ptr = list_entry (ptr1, struct slot, ibm_slot_list); ptr = list_entry (ptr1, struct slot, ibm_slot_list);
debug ("%s - slot_number: %x \n", __FUNCTION__, ptr->number); debug ("%s - slot_number: %x\n", __FUNCTION__, ptr->number);
} }
} }
...@@ -228,13 +228,13 @@ static void __init print_opt_vg (void) ...@@ -228,13 +228,13 @@ static void __init print_opt_vg (void)
{ {
struct opt_rio *ptr; struct opt_rio *ptr;
struct list_head *ptr1; struct list_head *ptr1;
debug ("%s --- \n", __FUNCTION__); debug ("%s ---\n", __FUNCTION__);
list_for_each (ptr1, &opt_vg_head) { list_for_each (ptr1, &opt_vg_head) {
ptr = list_entry (ptr1, struct opt_rio, opt_rio_list); ptr = list_entry (ptr1, struct opt_rio, opt_rio_list);
debug ("%s - rio_type %x \n", __FUNCTION__, ptr->rio_type); debug ("%s - rio_type %x\n", __FUNCTION__, ptr->rio_type);
debug ("%s - chassis_num: %x \n", __FUNCTION__, ptr->chassis_num); debug ("%s - chassis_num: %x\n", __FUNCTION__, ptr->chassis_num);
debug ("%s - first_slot_num: %x \n", __FUNCTION__, ptr->first_slot_num); debug ("%s - first_slot_num: %x\n", __FUNCTION__, ptr->first_slot_num);
debug ("%s - middle_num: %x \n", __FUNCTION__, ptr->middle_num); debug ("%s - middle_num: %x\n", __FUNCTION__, ptr->middle_num);
} }
} }
...@@ -670,7 +670,7 @@ static char *create_file_name (struct slot * slot_cur) ...@@ -670,7 +670,7 @@ static char *create_file_name (struct slot * slot_cur)
u8 flag = 0; u8 flag = 0;
if (!slot_cur) { if (!slot_cur) {
err ("Structure passed is empty \n"); err ("Structure passed is empty\n");
return NULL; return NULL;
} }
...@@ -1269,14 +1269,14 @@ static int ibmphp_probe (struct pci_dev * dev, const struct pci_device_id *ids) ...@@ -1269,14 +1269,14 @@ static int ibmphp_probe (struct pci_dev * dev, const struct pci_device_id *ids)
struct controller *ctrl; struct controller *ctrl;
struct list_head *tmp; struct list_head *tmp;
debug ("inside ibmphp_probe \n"); debug ("inside ibmphp_probe\n");
list_for_each (tmp, &ebda_hpc_head) { list_for_each (tmp, &ebda_hpc_head) {
ctrl = list_entry (tmp, struct controller, ebda_hpc_list); ctrl = list_entry (tmp, struct controller, ebda_hpc_list);
if (ctrl->ctlr_type == 1) { if (ctrl->ctlr_type == 1) {
if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) && (dev->bus->number == ctrl->u.pci_ctlr.bus)) { if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) && (dev->bus->number == ctrl->u.pci_ctlr.bus)) {
ctrl->ctrl_dev = dev; ctrl->ctrl_dev = dev;
debug ("found device!!! \n"); debug ("found device!!!\n");
debug ("dev->device = %x, dev->subsystem_device = %x\n", dev->device, dev->subsystem_device); debug ("dev->device = %x, dev->subsystem_device = %x\n", dev->device, dev->subsystem_device);
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -52,13 +52,13 @@ static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8 ...@@ -52,13 +52,13 @@ static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8
struct bus_node * newbus; struct bus_node * newbus;
if (!(curr) && !(flag)) { if (!(curr) && !(flag)) {
err ("NULL pointer passed \n"); err ("NULL pointer passed\n");
return NULL; return NULL;
} }
newbus = kmalloc (sizeof (struct bus_node), GFP_KERNEL); newbus = kmalloc (sizeof (struct bus_node), GFP_KERNEL);
if (!newbus) { if (!newbus) {
err ("out of system memory \n"); err ("out of system memory\n");
return NULL; return NULL;
} }
...@@ -76,13 +76,13 @@ static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * cur ...@@ -76,13 +76,13 @@ static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * cur
struct resource_node *rs; struct resource_node *rs;
if (!curr) { if (!curr) {
err ("NULL passed to allocate \n"); err ("NULL passed to allocate\n");
return NULL; return NULL;
} }
rs = kmalloc (sizeof (struct resource_node), GFP_KERNEL); rs = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!rs) { if (!rs) {
err ("out of system memory \n"); err ("out of system memory\n");
return NULL; return NULL;
} }
memset (rs, 0, sizeof (struct resource_node)); memset (rs, 0, sizeof (struct resource_node));
...@@ -103,7 +103,7 @@ static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node ...@@ -103,7 +103,7 @@ static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node
if (first_bus) { if (first_bus) {
newbus = kmalloc (sizeof (struct bus_node), GFP_KERNEL); newbus = kmalloc (sizeof (struct bus_node), GFP_KERNEL);
if (!newbus) { if (!newbus) {
err ("out of system memory. \n"); err ("out of system memory.\n");
return -ENOMEM; return -ENOMEM;
} }
memset (newbus, 0, sizeof (struct bus_node)); memset (newbus, 0, sizeof (struct bus_node));
...@@ -127,7 +127,7 @@ static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node ...@@ -127,7 +127,7 @@ static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node
if (!newrange) { if (!newrange) {
if (first_bus) if (first_bus)
kfree (newbus); kfree (newbus);
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (newrange, 0, sizeof (struct range_node)); memset (newrange, 0, sizeof (struct range_node));
...@@ -607,7 +607,7 @@ int ibmphp_add_resource (struct resource_node *res) ...@@ -607,7 +607,7 @@ int ibmphp_add_resource (struct resource_node *res)
debug ("%s - enter\n", __FUNCTION__); debug ("%s - enter\n", __FUNCTION__);
if (!res) { if (!res) {
err ("NULL passed to add \n"); err ("NULL passed to add\n");
return -ENODEV; return -ENODEV;
} }
...@@ -634,7 +634,7 @@ int ibmphp_add_resource (struct resource_node *res) ...@@ -634,7 +634,7 @@ int ibmphp_add_resource (struct resource_node *res)
res_start = bus_cur->firstPFMem; res_start = bus_cur->firstPFMem;
break; break;
default: default:
err ("cannot read the type of the resource to add... problem \n"); err ("cannot read the type of the resource to add... problem\n");
return -EINVAL; return -EINVAL;
} }
while (range_cur) { while (range_cur) {
...@@ -787,7 +787,7 @@ int ibmphp_remove_resource (struct resource_node *res) ...@@ -787,7 +787,7 @@ int ibmphp_remove_resource (struct resource_node *res)
char * type = ""; char * type = "";
if (!res) { if (!res) {
err ("resource to remove is NULL \n"); err ("resource to remove is NULL\n");
return -ENODEV; return -ENODEV;
} }
...@@ -813,7 +813,7 @@ int ibmphp_remove_resource (struct resource_node *res) ...@@ -813,7 +813,7 @@ int ibmphp_remove_resource (struct resource_node *res)
type = "pfmem"; type = "pfmem";
break; break;
default: default:
err ("unknown type for resource to remove \n"); err ("unknown type for resource to remove\n");
return -EINVAL; return -EINVAL;
} }
res_prev = NULL; res_prev = NULL;
...@@ -954,7 +954,7 @@ static struct range_node * find_range (struct bus_node *bus_cur, struct resource ...@@ -954,7 +954,7 @@ static struct range_node * find_range (struct bus_node *bus_cur, struct resource
range = bus_cur->rangePFMem; range = bus_cur->rangePFMem;
break; break;
default: default:
err ("cannot read resource type in find_range \n"); err ("cannot read resource type in find_range\n");
} }
while (range) { while (range) {
...@@ -1002,7 +1002,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge) ...@@ -1002,7 +1002,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
if (!bus_cur) { if (!bus_cur) {
/* didn't find a bus, smth's wrong!!! */ /* didn't find a bus, smth's wrong!!! */
debug ("no bus in the system, either pci_dev's wrong or allocation failed \n"); debug ("no bus in the system, either pci_dev's wrong or allocation failed\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1027,7 +1027,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge) ...@@ -1027,7 +1027,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
noranges = bus_cur->noPFMemRanges; noranges = bus_cur->noPFMemRanges;
break; break;
default: default:
err ("wrong type of resource to check \n"); err ("wrong type of resource to check\n");
return -EINVAL; return -EINVAL;
} }
res_prev = NULL; res_prev = NULL;
...@@ -1496,7 +1496,7 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour ...@@ -1496,7 +1496,7 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour
char * type = ""; char * type = "";
if (!bus) { if (!bus) {
err ("The bus passed in NULL to find resource \n"); err ("The bus passed in NULL to find resource\n");
return -ENODEV; return -ENODEV;
} }
...@@ -1514,7 +1514,7 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour ...@@ -1514,7 +1514,7 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour
type = "pfmem"; type = "pfmem";
break; break;
default: default:
err ("wrong type of flag \n"); err ("wrong type of flag\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1540,17 +1540,17 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour ...@@ -1540,17 +1540,17 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour
res_cur = res_cur->next; res_cur = res_cur->next;
} }
if (!res_cur) { if (!res_cur) {
debug ("SOS...cannot find %s resource in the bus. \n", type); debug ("SOS...cannot find %s resource in the bus.\n", type);
return -EINVAL; return -EINVAL;
} }
} else { } else {
debug ("SOS... cannot find %s resource in the bus. \n", type); debug ("SOS... cannot find %s resource in the bus.\n", type);
return -EINVAL; return -EINVAL;
} }
} }
if (*res) if (*res)
debug ("*res->start = %x \n", (*res)->start); debug ("*res->start = %x\n", (*res)->start);
return 0; return 0;
} }
...@@ -1708,7 +1708,7 @@ static int __init once_over (void) ...@@ -1708,7 +1708,7 @@ static int __init once_over (void)
mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL); mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!mem) { if (!mem) {
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (mem, 0, sizeof (struct resource_node)); memset (mem, 0, sizeof (struct resource_node));
...@@ -1792,7 +1792,7 @@ void ibmphp_print_test (void) ...@@ -1792,7 +1792,7 @@ void ibmphp_print_test (void)
list_for_each (tmp, &gbuses) { list_for_each (tmp, &gbuses) {
bus_cur = list_entry (tmp, struct bus_node, bus_list); bus_cur = list_entry (tmp, struct bus_node, bus_list);
debug_pci ("This is bus # %d. There are \n", bus_cur->busno); debug_pci ("This is bus # %d. There are\n", bus_cur->busno);
debug_pci ("IORanges = %d\t", bus_cur->noIORanges); debug_pci ("IORanges = %d\t", bus_cur->noIORanges);
debug_pci ("MemRanges = %d\t", bus_cur->noMemRanges); debug_pci ("MemRanges = %d\t", bus_cur->noMemRanges);
debug_pci ("PFMemRanges = %d\n", bus_cur->noPFMemRanges); debug_pci ("PFMemRanges = %d\n", bus_cur->noPFMemRanges);
...@@ -1903,7 +1903,7 @@ static int range_exists_already (struct range_node * range, struct bus_node * bu ...@@ -1903,7 +1903,7 @@ static int range_exists_already (struct range_node * range, struct bus_node * bu
range_cur = bus_cur->rangePFMem; range_cur = bus_cur->rangePFMem;
break; break;
default: default:
err ("wrong type passed to find out if range already exists \n"); err ("wrong type passed to find out if range already exists\n");
return -ENODEV; return -ENODEV;
} }
...@@ -1948,7 +1948,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -1948,7 +1948,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
return -ENODEV; return -ENODEV;
ibmphp_pci_bus->number = bus_cur->busno; ibmphp_pci_bus->number = bus_cur->busno;
debug ("inside %s \n", __FUNCTION__); debug ("inside %s\n", __FUNCTION__);
debug ("bus_cur->busno = %x\n", bus_cur->busno); debug ("bus_cur->busno = %x\n", bus_cur->busno);
for (device = 0; device < 32; device++) { for (device = 0; device < 32; device++) {
...@@ -1997,7 +1997,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -1997,7 +1997,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
if ((start_address) && (start_address <= end_address)) { if ((start_address) && (start_address <= end_address)) {
range = kmalloc (sizeof (struct range_node), GFP_KERNEL); range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
if (!range) { if (!range) {
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (range, 0, sizeof (struct range_node)); memset (range, 0, sizeof (struct range_node));
...@@ -2024,7 +2024,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -2024,7 +2024,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
io = kmalloc (sizeof (struct resource_node), GFP_KERNEL); io = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!io) { if (!io) {
kfree (range); kfree (range);
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (io, 0, sizeof (struct resource_node)); memset (io, 0, sizeof (struct resource_node));
...@@ -2048,7 +2048,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -2048,7 +2048,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
range = kmalloc (sizeof (struct range_node), GFP_KERNEL); range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
if (!range) { if (!range) {
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (range, 0, sizeof (struct range_node)); memset (range, 0, sizeof (struct range_node));
...@@ -2076,7 +2076,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -2076,7 +2076,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL); mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!mem) { if (!mem) {
kfree (range); kfree (range);
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (mem, 0, sizeof (struct resource_node)); memset (mem, 0, sizeof (struct resource_node));
...@@ -2104,7 +2104,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -2104,7 +2104,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
range = kmalloc (sizeof (struct range_node), GFP_KERNEL); range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
if (!range) { if (!range) {
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (range, 0, sizeof (struct range_node)); memset (range, 0, sizeof (struct range_node));
...@@ -2131,7 +2131,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -2131,7 +2131,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
pfmem = kmalloc (sizeof (struct resource_node), GFP_KERNEL); pfmem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!pfmem) { if (!pfmem) {
kfree (range); kfree (range);
err ("out of system memory \n"); err ("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
memset (pfmem, 0, sizeof (struct resource_node)); memset (pfmem, 0, sizeof (struct resource_node));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment