* [RFC][PATCH 5/6] PCI PM: kzalloc() cleanup
@ 2005-11-16 3:31 Adam Belay
2005-11-16 6:22 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Adam Belay @ 2005-11-16 3:31 UTC (permalink / raw)
To: Linux-pm mailing list, Greg KH; +Cc: linux-kernel
Use kzalloc() instead of kmalloc() and memset().
--- a/drivers/pci/pm.c 2005-11-08 17:10:37.000000000 -0500
+++ b/drivers/pci/pm.c 2005-11-08 17:11:33.000000000 -0500
@@ -300,12 +300,10 @@
return -EIO;
}
- dev->pm = pm_data = kmalloc(sizeof(struct pci_dev_pm), GFP_KERNEL);
+ dev->pm = pm_data = kzalloc(sizeof(struct pci_dev_pm), GFP_KERNEL);
if (!pm_data)
return -ENOMEM;
- memset(pm_data, 0, sizeof(struct pci_dev_pm));
-
pm_data->pm_offset = pm;
/* determine supported device states */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC][PATCH 5/6] PCI PM: kzalloc() cleanup
2005-11-16 3:31 [RFC][PATCH 5/6] PCI PM: kzalloc() cleanup Adam Belay
@ 2005-11-16 6:22 ` Greg KH
2005-11-16 7:21 ` Adam Belay
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2005-11-16 6:22 UTC (permalink / raw)
To: Adam Belay; +Cc: Linux-pm mailing list, linux-kernel
On Tue, Nov 15, 2005 at 10:31:31PM -0500, Adam Belay wrote:
> Use kzalloc() instead of kmalloc() and memset().
>
>
> --- a/drivers/pci/pm.c 2005-11-08 17:10:37.000000000 -0500
> +++ b/drivers/pci/pm.c 2005-11-08 17:11:33.000000000 -0500
> @@ -300,12 +300,10 @@
> return -EIO;
> }
>
> - dev->pm = pm_data = kmalloc(sizeof(struct pci_dev_pm), GFP_KERNEL);
> + dev->pm = pm_data = kzalloc(sizeof(struct pci_dev_pm), GFP_KERNEL);
> if (!pm_data)
> return -ENOMEM;
>
> - memset(pm_data, 0, sizeof(struct pci_dev_pm));
> -
You can merge this back with your other patch :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC][PATCH 5/6] PCI PM: kzalloc() cleanup
2005-11-16 6:22 ` Greg KH
@ 2005-11-16 7:21 ` Adam Belay
0 siblings, 0 replies; 3+ messages in thread
From: Adam Belay @ 2005-11-16 7:21 UTC (permalink / raw)
To: Greg KH; +Cc: Linux-pm mailing list, linux-kernel
On Tue, 2005-11-15 at 22:22 -0800, Greg KH wrote:
> On Tue, Nov 15, 2005 at 10:31:31PM -0500, Adam Belay wrote:
> > Use kzalloc() instead of kmalloc() and memset().
> >
> >
> > --- a/drivers/pci/pm.c 2005-11-08 17:10:37.000000000 -0500
> > +++ b/drivers/pci/pm.c 2005-11-08 17:11:33.000000000 -0500
> > @@ -300,12 +300,10 @@
> > return -EIO;
> > }
> >
> > - dev->pm = pm_data = kmalloc(sizeof(struct pci_dev_pm), GFP_KERNEL);
> > + dev->pm = pm_data = kzalloc(sizeof(struct pci_dev_pm), GFP_KERNEL);
> > if (!pm_data)
> > return -ENOMEM;
> >
> > - memset(pm_data, 0, sizeof(struct pci_dev_pm));
> > -
>
> You can merge this back with your other patch :)
>
> thanks,
>
> greg k-h
Will do.
Thanks,
Adam
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-16 7:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-16 3:31 [RFC][PATCH 5/6] PCI PM: kzalloc() cleanup Adam Belay
2005-11-16 6:22 ` Greg KH
2005-11-16 7:21 ` Adam Belay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox