mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Felipe Balbi <balbi@kernel.org>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Cc: gregkh@linuxfoundation.org
Subject: Re: [PATCH] usb/gadget: use kasprintf() instead of open coding it
Date: Mon, 10 Oct 2016 12:34:17 +0200	[thread overview]
Message-ID: <6ca032f4-6279-6edb-0ca7-6fa5722343dd@suse.com> (raw)
In-Reply-To: <87vax0wldw.fsf@linux.intel.com>

On 10/10/16 12:26, Felipe Balbi wrote:
> 
> Hi,
> 
> Juergen Gross <jgross@suse.com> writes:
> 
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> I can't apply anything without a commit log. Sorry.

I always thought a subject line telling the complete story would be
enough. I'll resend with the subject duplicated to the body.


Juergen

> 
>> 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@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

      reply	other threads:[~2016-10-10 10:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10 10:17 Juergen Gross
2016-10-10 10:26 ` Felipe Balbi
2016-10-10 10:34   ` Juergen Gross [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ca032f4-6279-6edb-0ca7-6fa5722343dd@suse.com \
    --to=jgross@suse.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®