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)
list_for_each (tmp, &ibmphp_slot_head) {
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);
}
return slot_count;
......@@ -187,7 +187,7 @@ static inline int power_on (struct slot *slot_cur)
return retval;
}
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;
}
long_delay (3 * HZ); /* For ServeRAID cards, and some 66 PCI */
......@@ -201,12 +201,12 @@ static inline int power_off (struct slot *slot_cur)
retval = ibmphp_hpc_writeslot (slot_cur, cmd);
if (retval) {
err ("power off failed \n");
err ("power off failed\n");
return retval;
}
if (CTLR_RESULT (slot_cur->ctrl->status)) {
err ("command not completed successfully in power_off \n");
return -EIO;
err ("command not completed successfully in power_off\n");
retval = -EIO;
}
return 0;
}
......@@ -520,7 +520,7 @@ static int get_bus_name (struct hotplug_slot *hotplug_slot, char * value)
int rc = -ENODEV;
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 ();
......@@ -654,7 +654,7 @@ int ibmphp_update_slot_info (struct slot *slot_cur)
info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
if (!info) {
err ("out of system memory \n");
err ("out of system memory\n");
return -ENOMEM;
}
......@@ -794,7 +794,7 @@ static u8 bus_structure_fixup (u8 busno)
dev->bus = bus;
for (dev->devfn = 0; dev->devfn < 256; dev->devfn += 8) {
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);
break;
}
......@@ -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));
if (func->dev == NULL) {
err ("ERROR... : pci_dev still NULL \n");
err ("ERROR... : pci_dev still NULL\n");
return 0;
}
}
......@@ -883,7 +883,7 @@ static int set_bus (struct slot * slot_cur)
struct pci_dev *dev = NULL;
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)) {
rc = slot_update (&slot_cur);
if (rc)
......@@ -934,12 +934,12 @@ static int set_bus (struct slot * slot_cur)
cmd = HPC_BUS_133PCIXMODE;
break;
default:
err ("Wrong bus speed \n");
err ("Wrong bus speed\n");
return -ENODEV;
}
break;
default:
err ("wrong slot speed \n");
err ("wrong slot speed\n");
return -ENODEV;
}
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)
return retval;
}
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;
}
}
/* This is for x440, once Brandon fixes the firmware,
will not need this delay */
long_delay (1 * HZ);
debug ("%s -Exit \n", __FUNCTION__);
debug ("%s -Exit\n", __FUNCTION__);
return 0;
}
......@@ -1009,13 +1009,13 @@ static inline void print_card_capability (struct slot *slot_cur)
{
info ("capability of the card is ");
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)
info (" 66 MHz PCI-X \n");
info (" 66 MHz PCI-X\n");
else if ((slot_cur->ext_status & CARD_INFO) == PCI66)
info (" 66 MHz PCI \n");
info (" 66 MHz PCI\n");
else
info (" 33 MHz PCI \n");
info (" 33 MHz PCI\n");
}
......@@ -1033,11 +1033,11 @@ static int enable_slot (struct hotplug_slot *hs)
ibmphp_lock_operations ();
debug ("ENABLING SLOT........ \n");
debug ("ENABLING SLOT........\n");
slot_cur = (struct slot *) hs->private;
if ((rc = validate (slot_cur, ENABLE))) {
err ("validate function failed \n");
err ("validate function failed\n");
goto error_nopower;
}
......@@ -1045,13 +1045,13 @@ static int enable_slot (struct hotplug_slot *hs)
rc = set_bus (slot_cur);
if (rc) {
err ("was not able to set the bus \n");
err ("was not able to set the bus\n");
goto error_nopower;
}
/*-----------------debugging------------------------------*/
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);
......@@ -1059,7 +1059,7 @@ static int enable_slot (struct hotplug_slot *hs)
err ("Adding this card exceeds the limitations of this bus.\n");
err ("(i.e., >1 133MHz cards running on same bus, or "
">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;
goto error_nopower;
}
......@@ -1079,12 +1079,12 @@ static int enable_slot (struct hotplug_slot *hs)
}
/* Check to see the error of why it failed */
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)) {
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);
} 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);
}
ibmphp_update_slot_info (slot_cur);
......@@ -1093,7 +1093,7 @@ static int enable_slot (struct hotplug_slot *hs)
debug ("after power_on\n");
/*-----------------------debugging---------------------------*/
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);
......@@ -1102,17 +1102,17 @@ static int enable_slot (struct hotplug_slot *hs)
rc = -EINVAL;
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;
}
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);
goto error_power;
}
/* Don't think this case will happen after above checks... but just in case, for paranoia sake */
if (!(SLOT_POWER (slot_cur->status))) {
err ("power on failed... \n");
err ("power on failed...\n");
goto error_power;
}
......@@ -1120,7 +1120,7 @@ static int enable_slot (struct hotplug_slot *hs)
if (!slot_cur->func) {
/* We cannot do update_slot_info here, since no memory for
* kmalloc n.e.ways, and update_slot_info allocates some */
err ("out of system memory \n");
err ("out of system memory\n");
rc = -ENOMEM;
goto error_power;
}
......@@ -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);
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 */
debug ("after unconfigure_card\n");
slot_cur->func = NULL;
......@@ -1204,7 +1204,7 @@ int ibmphp_do_disable_slot (struct slot *slot_cur)
int rc;
u8 flag;
debug ("DISABLING SLOT... \n");
debug ("DISABLING SLOT...\n");
if ((slot_cur == NULL) || (slot_cur->ctrl == NULL)) {
return -ENODEV;
......@@ -1224,7 +1224,7 @@ int ibmphp_do_disable_slot (struct slot *slot_cur)
/* We need this for fncs's that were there on bootup */
slot_cur->func = (struct pci_func *) kmalloc (sizeof (struct pci_func), GFP_KERNEL);
if (!slot_cur->func) {
err ("out of system memory \n");
err ("out of system memory\n");
rc = -ENOMEM;
goto error;
}
......@@ -1306,15 +1306,15 @@ struct hotplug_slot_ops ibmphp_hotplug_slot_ops = {
static void ibmphp_unload (void)
{
free_slots ();
debug ("after slots \n");
debug ("after slots\n");
ibmphp_free_resources ();
debug ("after resources \n");
debug ("after resources\n");
ibmphp_free_bus_info_queue ();
debug ("after bus info \n");
debug ("after bus info\n");
ibmphp_free_ebda_hpc_queue ();
debug ("after ebda hpc \n");
debug ("after ebda hpc\n");
ibmphp_free_ebda_pci_rsrc_queue ();
debug ("after ebda pci rsrc \n");
debug ("after ebda pci rsrc\n");
kfree (ibmphp_pci_bus);
}
......
......@@ -171,7 +171,7 @@ static void print_lo_info (void)
{
struct rio_detail *ptr;
struct list_head *ptr1;
debug ("print_lo_info ---- \n");
debug ("print_lo_info ----\n");
list_for_each (ptr1, &rio_lo_head) {
ptr = list_entry (ptr1, struct rio_detail, rio_detail_list);
debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id);
......@@ -188,7 +188,7 @@ static void print_vg_info (void)
{
struct rio_detail *ptr;
struct list_head *ptr1;
debug ("%s --- \n", __FUNCTION__);
debug ("%s ---\n", __FUNCTION__);
list_for_each (ptr1, &rio_vg_head) {
ptr = list_entry (ptr1, struct rio_detail, rio_detail_list);
debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id);
......@@ -220,7 +220,7 @@ static void __init print_ibm_slot (void)
list_for_each (ptr1, &ibmphp_slot_head) {
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)
{
struct opt_rio *ptr;
struct list_head *ptr1;
debug ("%s --- \n", __FUNCTION__);
debug ("%s ---\n", __FUNCTION__);
list_for_each (ptr1, &opt_vg_head) {
ptr = list_entry (ptr1, struct opt_rio, opt_rio_list);
debug ("%s - rio_type %x \n", __FUNCTION__, ptr->rio_type);
debug ("%s - chassis_num: %x \n", __FUNCTION__, ptr->chassis_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 - rio_type %x\n", __FUNCTION__, ptr->rio_type);
debug ("%s - chassis_num: %x\n", __FUNCTION__, ptr->chassis_num);
debug ("%s - first_slot_num: %x\n", __FUNCTION__, ptr->first_slot_num);
debug ("%s - middle_num: %x\n", __FUNCTION__, ptr->middle_num);
}
}
......@@ -670,7 +670,7 @@ static char *create_file_name (struct slot * slot_cur)
u8 flag = 0;
if (!slot_cur) {
err ("Structure passed is empty \n");
err ("Structure passed is empty\n");
return NULL;
}
......@@ -1269,14 +1269,14 @@ static int ibmphp_probe (struct pci_dev * dev, const struct pci_device_id *ids)
struct controller *ctrl;
struct list_head *tmp;
debug ("inside ibmphp_probe \n");
debug ("inside ibmphp_probe\n");
list_for_each (tmp, &ebda_hpc_head) {
ctrl = list_entry (tmp, struct controller, ebda_hpc_list);
if (ctrl->ctlr_type == 1) {
if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) && (dev->bus->number == ctrl->u.pci_ctlr.bus)) {
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);
return 0;
}
......
This diff is collapsed.
......@@ -52,13 +52,13 @@ static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8
struct bus_node * newbus;
if (!(curr) && !(flag)) {
err ("NULL pointer passed \n");
err ("NULL pointer passed\n");
return NULL;
}
newbus = kmalloc (sizeof (struct bus_node), GFP_KERNEL);
if (!newbus) {
err ("out of system memory \n");
err ("out of system memory\n");
return NULL;
}
......@@ -76,13 +76,13 @@ static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * cur
struct resource_node *rs;
if (!curr) {
err ("NULL passed to allocate \n");
err ("NULL passed to allocate\n");
return NULL;
}
rs = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!rs) {
err ("out of system memory \n");
err ("out of system memory\n");
return NULL;
}
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
if (first_bus) {
newbus = kmalloc (sizeof (struct bus_node), GFP_KERNEL);
if (!newbus) {
err ("out of system memory. \n");
err ("out of system memory.\n");
return -ENOMEM;
}
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
if (!newrange) {
if (first_bus)
kfree (newbus);
err ("out of system memory \n");
err ("out of system memory\n");
return -ENOMEM;
}
memset (newrange, 0, sizeof (struct range_node));
......@@ -607,7 +607,7 @@ int ibmphp_add_resource (struct resource_node *res)
debug ("%s - enter\n", __FUNCTION__);
if (!res) {
err ("NULL passed to add \n");
err ("NULL passed to add\n");
return -ENODEV;
}
......@@ -634,7 +634,7 @@ int ibmphp_add_resource (struct resource_node *res)
res_start = bus_cur->firstPFMem;
break;
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;
}
while (range_cur) {
......@@ -787,7 +787,7 @@ int ibmphp_remove_resource (struct resource_node *res)
char * type = "";
if (!res) {
err ("resource to remove is NULL \n");
err ("resource to remove is NULL\n");
return -ENODEV;
}
......@@ -813,7 +813,7 @@ int ibmphp_remove_resource (struct resource_node *res)
type = "pfmem";
break;
default:
err ("unknown type for resource to remove \n");
err ("unknown type for resource to remove\n");
return -EINVAL;
}
res_prev = NULL;
......@@ -954,7 +954,7 @@ static struct range_node * find_range (struct bus_node *bus_cur, struct resource
range = bus_cur->rangePFMem;
break;
default:
err ("cannot read resource type in find_range \n");
err ("cannot read resource type in find_range\n");
}
while (range) {
......@@ -1002,7 +1002,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
if (!bus_cur) {
/* 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;
}
......@@ -1027,7 +1027,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
noranges = bus_cur->noPFMemRanges;
break;
default:
err ("wrong type of resource to check \n");
err ("wrong type of resource to check\n");
return -EINVAL;
}
res_prev = NULL;
......@@ -1496,7 +1496,7 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour
char * type = "";
if (!bus) {
err ("The bus passed in NULL to find resource \n");
err ("The bus passed in NULL to find resource\n");
return -ENODEV;
}
......@@ -1514,7 +1514,7 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour
type = "pfmem";
break;
default:
err ("wrong type of flag \n");
err ("wrong type of flag\n");
return -EINVAL;
}
......@@ -1540,17 +1540,17 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour
res_cur = res_cur->next;
}
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;
}
} 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;
}
}
if (*res)
debug ("*res->start = %x \n", (*res)->start);
debug ("*res->start = %x\n", (*res)->start);
return 0;
}
......@@ -1708,7 +1708,7 @@ static int __init once_over (void)
mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!mem) {
err ("out of system memory \n");
err ("out of system memory\n");
return -ENOMEM;
}
memset (mem, 0, sizeof (struct resource_node));
......@@ -1792,7 +1792,7 @@ void ibmphp_print_test (void)
list_for_each (tmp, &gbuses) {
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 ("MemRanges = %d\t", bus_cur->noMemRanges);
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
range_cur = bus_cur->rangePFMem;
break;
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;
}
......@@ -1948,7 +1948,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
return -ENODEV;
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);
for (device = 0; device < 32; device++) {
......@@ -1997,7 +1997,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
if ((start_address) && (start_address <= end_address)) {
range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
if (!range) {
err ("out of system memory \n");
err ("out of system memory\n");
return -ENOMEM;
}
memset (range, 0, sizeof (struct range_node));
......@@ -2024,7 +2024,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
io = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!io) {
kfree (range);
err ("out of system memory \n");
err ("out of system memory\n");
return -ENOMEM;
}
memset (io, 0, sizeof (struct resource_node));
......@@ -2048,7 +2048,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
if (!range) {
err ("out of system memory \n");
err ("out of system memory\n");
return -ENOMEM;
}
memset (range, 0, sizeof (struct range_node));
......@@ -2076,7 +2076,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!mem) {
kfree (range);
err ("out of system memory \n");
err ("out of system memory\n");
return -ENOMEM;
}
memset (mem, 0, sizeof (struct resource_node));
......@@ -2104,7 +2104,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
if (!range) {
err ("out of system memory \n");
err ("out of system memory\n");
return -ENOMEM;
}
memset (range, 0, sizeof (struct range_node));
......@@ -2131,7 +2131,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
pfmem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
if (!pfmem) {
kfree (range);
err ("out of system memory \n");
err ("out of system memory\n");
return -ENOMEM;
}
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