lkml.org 
[lkml]   [2018]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] usb: isp1760: Use kasprintf
On Wed, Mar 7, 2018 at 8:08 PM, Himanshu Jha
<himanshujha199640@gmail.com> wrote:
> Use kasprintf instead of combination of kmalloc and sprintf and
> therefore avoid unnecessary computation of string length.

> devname = dev_name(isp->dev);

Do you still need this temporary variable?

> - udc->irqname = kmalloc(strlen(devname) + 7, GFP_KERNEL);
> + udc->irqname = kasprintf(GFP_KERNEL, "%s (udc)", devname);

Perhaps

devname -> dev_name(isp->dev)

?


--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-03-07 19:22    [W:0.031 / U:6.668 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site