[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 10 Oct 2016 13:26:03 +0300
From: Felipe Balbi <balbi@...nel.org>
To: Juergen Gross <jgross@...e.com>, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org
Cc: gregkh@...uxfoundation.org, Juergen Gross <jgross@...e.com>
Subject: Re: [PATCH] usb/gadget: use kasprintf() instead of open coding it
Hi,
Juergen Gross <jgross@...e.com> writes:
> Signed-off-by: Juergen Gross <jgross@...e.com>
I can't apply anything without a commit log. Sorry.
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index 32176f7..455efec 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -2382,18 +2382,8 @@ EXPORT_SYMBOL_GPL(usb_composite_setup_continue);
>
> static char *composite_default_mfr(struct usb_gadget *gadget)
> {
> - char *mfr;
> - int len;
> -
> - len = snprintf(NULL, 0, "%s %s with %s", init_utsname()->sysname,
> - init_utsname()->release, gadget->name);
> - len++;
> - mfr = kmalloc(len, GFP_KERNEL);
> - if (!mfr)
> - return NULL;
> - snprintf(mfr, len, "%s %s with %s", init_utsname()->sysname,
> - init_utsname()->release, gadget->name);
> - return mfr;
> + return kasprintf(GFP_KERNEL, "%s %s with %s", init_utsname()->sysname,
> + init_utsname()->release, gadget->name);
> }
>
> void usb_composite_overwrite_options(struct usb_composite_dev *cdev,
> --
> 2.6.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (801 bytes)
Powered by blists - more mailing lists