2013-06-01 09:36:59

by Thomas Meyer

[permalink] [raw]
Subject: [PATCH] usb: gadget: lpc32xx_udc: Cocci spatch "memdup.spatch"


Signed-off-by: Thomas Meyer <[email protected]>
---

diff -u -p a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c
--- a/drivers/usb/gadget/lpc32xx_udc.c
+++ b/drivers/usb/gadget/lpc32xx_udc.c
@@ -3046,11 +3046,10 @@ static int __init lpc32xx_udc_probe(stru
dma_addr_t dma_handle;
struct device_node *isp1301_node;

- udc = kzalloc(sizeof(*udc), GFP_KERNEL);
+ udc = kmemdup(&controller_template, sizeof(*udc), GFP_KERNEL);
if (!udc)
return -ENOMEM;

- memcpy(udc, &controller_template, sizeof(*udc));
for (i = 0; i <= 15; i++)
udc->ep[i].udc = udc;
udc->gadget.ep0 = &udc->ep[0].ep;


2013-06-01 17:00:04

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH] usb: gadget: lpc32xx_udc: Cocci spatch "memdup.spatch"

On Sat, Jun 01, 2013 at 11:36:46AM +0200, Thomas Meyer wrote:
>

-ENOLOG

please add a commit log.

> Signed-off-by: Thomas Meyer <[email protected]>
> ---
>
> diff -u -p a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c
> --- a/drivers/usb/gadget/lpc32xx_udc.c
> +++ b/drivers/usb/gadget/lpc32xx_udc.c
> @@ -3046,11 +3046,10 @@ static int __init lpc32xx_udc_probe(stru
> dma_addr_t dma_handle;
> struct device_node *isp1301_node;
>
> - udc = kzalloc(sizeof(*udc), GFP_KERNEL);
> + udc = kmemdup(&controller_template, sizeof(*udc), GFP_KERNEL);
> if (!udc)
> return -ENOMEM;
>
> - memcpy(udc, &controller_template, sizeof(*udc));
> for (i = 0; i <= 15; i++)
> udc->ep[i].udc = udc;
> udc->gadget.ep0 = &udc->ep[0].ep;
>
>

--
balbi


Attachments:
(No filename) (775.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments