diff mbox series

PCI: Replace kmalloc with kzalloc in the comment/message

Message ID 1594279708-34369-1-git-send-email-wang.yi59@zte.com.cn (mailing list archive)
State Accepted, archived
Headers show
Series PCI: Replace kmalloc with kzalloc in the comment/message | expand

Commit Message

Yi Wang July 9, 2020, 7:28 a.m. UTC
From: Liao Pingfang <liao.pingfang@zte.com.cn>

Use kzalloc instead of kmalloc in the comment/message according to
the previous kzalloc() call.

Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
 drivers/pci/hotplug/ibmphp_pci.c | 2 +-
 drivers/pci/setup-bus.c          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Bjorn Helgaas July 9, 2020, 9:05 p.m. UTC | #1
On Thu, Jul 09, 2020 at 03:28:28PM +0800, Yi Wang wrote:
> From: Liao Pingfang <liao.pingfang@zte.com.cn>
> 
> Use kzalloc instead of kmalloc in the comment/message according to
> the previous kzalloc() call.
> 
> Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
> Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>

I applied the setup-bus.c change to pci/misc for v5.9, thanks!

I dropped the ibmphp_pci.c comment change because (a) it's not clear
the comment is correct even after the change, and (b) that file is so
out-of-date and hard to read that I don't want to touch it unless
we're really fixing something significant.

> ---
>  drivers/pci/hotplug/ibmphp_pci.c | 2 +-
>  drivers/pci/setup-bus.c          | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c
> index e22d023..2d36992 100644
> --- a/drivers/pci/hotplug/ibmphp_pci.c
> +++ b/drivers/pci/hotplug/ibmphp_pci.c
> @@ -205,7 +205,7 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno)
>  								cur_func->next = newfunc;
>  
>  							rc = ibmphp_configure_card(newfunc, slotno);
> -							/* This could only happen if kmalloc failed */
> +							/* This could only happen if kzalloc failed */
>  							if (rc) {
>  								/* We need to do this in case bridge itself got configured properly, but devices behind it failed */
>  								func->bus = 1; /* To indicate to the unconfigure function that this is a PPB */
> diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
> index bbcef1a..13c5a44 100644
> --- a/drivers/pci/setup-bus.c
> +++ b/drivers/pci/setup-bus.c
> @@ -151,7 +151,7 @@ static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
>  
>  		tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
>  		if (!tmp)
> -			panic("pdev_sort_resources(): kmalloc() failed!\n");
> +			panic("%s: kzalloc() failed!\n", __func__);
>  		tmp->res = r;
>  		tmp->dev = dev;
>  
> -- 
> 2.9.5
>
diff mbox series

Patch

diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c
index e22d023..2d36992 100644
--- a/drivers/pci/hotplug/ibmphp_pci.c
+++ b/drivers/pci/hotplug/ibmphp_pci.c
@@ -205,7 +205,7 @@  int ibmphp_configure_card(struct pci_func *func, u8 slotno)
 								cur_func->next = newfunc;
 
 							rc = ibmphp_configure_card(newfunc, slotno);
-							/* This could only happen if kmalloc failed */
+							/* This could only happen if kzalloc failed */
 							if (rc) {
 								/* We need to do this in case bridge itself got configured properly, but devices behind it failed */
 								func->bus = 1; /* To indicate to the unconfigure function that this is a PPB */
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index bbcef1a..13c5a44 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -151,7 +151,7 @@  static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
 
 		tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
 		if (!tmp)
-			panic("pdev_sort_resources(): kmalloc() failed!\n");
+			panic("%s: kzalloc() failed!\n", __func__);
 		tmp->res = r;
 		tmp->dev = dev;