aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/ibmphp_core.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-12-29 06:15:16 -0500
committerBjorn Helgaas <bhelgaas@google.com>2018-01-17 09:41:41 -0500
commitc7abb2352c298e8ac2ccfd843f036ae5244d6f35 (patch)
tree7fbfb980fd5bacb12d8a31633a771a0f96a7ef14 /drivers/pci/hotplug/ibmphp_core.c
parentfdabc3fe998203038a78763c1b3d6ace517e0eea (diff)
PCI: Remove unnecessary messages for memory allocation failures
Per ebfdc40969f2 ("checkpatch: attempt to find unnecessary 'out of memory' messages"), when a memory allocation fails, the memory subsystem emits generic "out of memory" messages (see slab_out_of_memory() for some of this logging). Therefore, additional error messages in the caller don't add much value. Remove messages that merely report "out of memory". This preserves some messages that report additional information, e.g., allocation failures that mean we drop hotplug events. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> [bhelgaas: changelog, squash patches, make similar changes to acpiphp, cpqphp, ibmphp, keep warning when dropping hotplug event] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/hotplug/ibmphp_core.c')
-rw-r--r--drivers/pci/hotplug/ibmphp_core.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
index 73cf84645c82..4f5c0b936797 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -603,10 +603,8 @@ int ibmphp_update_slot_info(struct slot *slot_cur)
603 u8 mode; 603 u8 mode;
604 604
605 info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL); 605 info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL);
606 if (!info) { 606 if (!info)
607 err("out of system memory\n");
608 return -ENOMEM; 607 return -ENOMEM;
609 }
610 608
611 info->power_status = SLOT_PWRGD(slot_cur->status); 609 info->power_status = SLOT_PWRGD(slot_cur->status);
612 info->attention_status = SLOT_ATTN(slot_cur->status, 610 info->attention_status = SLOT_ATTN(slot_cur->status,
@@ -734,14 +732,12 @@ static u8 bus_structure_fixup(u8 busno)
734 return 1; 732 return 1;
735 733
736 bus = kmalloc(sizeof(*bus), GFP_KERNEL); 734 bus = kmalloc(sizeof(*bus), GFP_KERNEL);
737 if (!bus) { 735 if (!bus)
738 err("%s - out of memory\n", __func__);
739 return 1; 736 return 1;
740 } 737
741 dev = kmalloc(sizeof(*dev), GFP_KERNEL); 738 dev = kmalloc(sizeof(*dev), GFP_KERNEL);
742 if (!dev) { 739 if (!dev) {
743 kfree(bus); 740 kfree(bus);
744 err("%s - out of memory\n", __func__);
745 return 1; 741 return 1;
746 } 742 }
747 743
@@ -1101,7 +1097,6 @@ static int enable_slot(struct hotplug_slot *hs)
1101 if (!slot_cur->func) { 1097 if (!slot_cur->func) {
1102 /* We cannot do update_slot_info here, since no memory for 1098 /* We cannot do update_slot_info here, since no memory for
1103 * kmalloc n.e.ways, and update_slot_info allocates some */ 1099 * kmalloc n.e.ways, and update_slot_info allocates some */
1104 err("out of system memory\n");
1105 rc = -ENOMEM; 1100 rc = -ENOMEM;
1106 goto error_power; 1101 goto error_power;
1107 } 1102 }
@@ -1208,7 +1203,6 @@ int ibmphp_do_disable_slot(struct slot *slot_cur)
1208 /* We need this for functions that were there on bootup */ 1203 /* We need this for functions that were there on bootup */
1209 slot_cur->func = kzalloc(sizeof(struct pci_func), GFP_KERNEL); 1204 slot_cur->func = kzalloc(sizeof(struct pci_func), GFP_KERNEL);
1210 if (!slot_cur->func) { 1205 if (!slot_cur->func) {
1211 err("out of system memory\n");
1212 rc = -ENOMEM; 1206 rc = -ENOMEM;
1213 goto error; 1207 goto error;
1214 } 1208 }
@@ -1306,7 +1300,6 @@ static int __init ibmphp_init(void)
1306 1300
1307 ibmphp_pci_bus = kmalloc(sizeof(*ibmphp_pci_bus), GFP_KERNEL); 1301 ibmphp_pci_bus = kmalloc(sizeof(*ibmphp_pci_bus), GFP_KERNEL);
1308 if (!ibmphp_pci_bus) { 1302 if (!ibmphp_pci_bus) {
1309 err("out of memory\n");
1310 rc = -ENOMEM; 1303 rc = -ENOMEM;
1311 goto exit; 1304 goto exit;
1312 } 1305 }