Re: [PATCH] usb: isp1760: Use kasprintf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 7, 2018 at 8:08 PM, Himanshu Jha
<himanshujha199640@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux