linux/drivers/mtd/maps
Arnd Bergmann 3dc8f1e3a8 mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy
commit 906b268477 upstream.

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>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-18 19:09:56 +08:00
..
amd76xrom.c
bfin-async-flash.c
cfi_flagadm.c
ck804xrom.c
dc21285.c
esb2rom.c
gpio-addr-flash.c
ichxrom.c
impa7.c
intel_vr_nor.c
ixp4xx.c
Kconfig
l440gx.c
lantiq-flash.c
latch-addr-flash.c
Makefile
map_funcs.c
netsc520.c
nettel.c
pci.c
pcmciamtd.c
physmap_of.c
physmap.c
pismo.c
plat-ram.c
pmcmsp-flash.c mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy 2017-03-18 19:09:56 +08:00
pxa2xx-flash.c
rbtx4939-flash.c
sa1100-flash.c
sbc_gxx.c
sc520cdp.c
scb2_flash.c
scx200_docflash.c
solutionengine.c
sun_uflash.c
ts5500_flash.c
tsunami_flash.c
uclinux.c
vmu-flash.c