lkml.org 
[lkml]   [2017]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy
On Sat, Feb 04, 2017 at 10:12:35PM +0100, Marek Vasut wrote:
> On 02/03/2017 10:49 AM, Arnd Bergmann wrote:
> > kernelci.org reports a warning for this driver, as it copies a local
> > variable into a 'const char *' string:
> >
> > drivers/mtd/maps/pmcmsp-flash.c:149:30: warning: passing argument 1 of 'strncpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> >
> > Using kstrndup() simplifies the code and avoids the warning.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Acked-by: Marek Vasut <marek.vasut@gmail.com>

Applied to l2-mtd.git.

\
 
 \ /
  Last update: 2017-02-08 22:23    [W:0.059 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site