[PATCH 1/4] mtd: m25p80: explicitly cast name pointer
Sascha Hauer
s.hauer at pengutronix.de
Sun Jun 28 22:17:31 PDT 2015
On Fri, Jun 26, 2015 at 08:59:20PM +0200, Lucas Stach wrote:
> Fixes:
> drivers/mtd/devices/m25p80.c: In function 'm25p_probe':
> drivers/mtd/devices/m25p80.c:271:14: warning:
> assignment discards 'const' qualifier from pointer target type [enabled by default]
>
> Signed-off-by: Lucas Stach <dev at lynxeye.de>
> ---
> drivers/mtd/devices/m25p80.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index c941767..c2e481e 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -268,7 +268,7 @@ static int m25p_probe(struct device_d *dev)
> else if (data && data->name)
> flash_name = data->name;
> else if (dev->id_entry)
> - flash_name = dev->id_entry->name;
> + flash_name = (char *)dev->id_entry->name;
Rather than patching the warning away we should make the add_mtd_device
devname argument const, see the patch I just sent.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list