* [PATCH v2] mtd: mark devname argument of add_mtd_device as const
@ 2015-07-03 7:49 Marc Kleine-Budde
2015-07-03 7:51 ` Marc Kleine-Budde
0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2015-07-03 7:49 UTC (permalink / raw)
To: barebox; +Cc: sha
This patch fixes the following warning:
| 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
| flash_name = dev->id_entry->name;
| ^
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/mtd/core.c | 2 +-
drivers/mtd/devices/m25p80.c | 2 +-
drivers/mtd/mtd.h | 2 +-
drivers/mtd/mtdoob.c | 2 +-
drivers/mtd/mtdraw.c | 2 +-
include/linux/mtd/mtd.h | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 681dc9313c3a..8b8254c2d3a8 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -542,7 +542,7 @@ static int of_mtd_fixup(struct device_node *root, void *ctx)
return 0;
}
-int add_mtd_device(struct mtd_info *mtd, char *devname, int device_id)
+int add_mtd_device(struct mtd_info *mtd, const char *devname, int device_id)
{
struct mtddev_hook *hook;
int ret;
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index c941767de94c..7f955ee28716 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -233,7 +233,7 @@ static int m25p_probe(struct device_d *dev)
struct m25p *flash;
struct spi_nor *nor;
enum read_mode mode = SPI_NOR_NORMAL;
- char *flash_name = NULL;
+ const char *flash_name = NULL;
int device_id;
int ret;
diff --git a/drivers/mtd/mtd.h b/drivers/mtd/mtd.h
index 414bd6cdb53a..2a85265f98bd 100644
--- a/drivers/mtd/mtd.h
+++ b/drivers/mtd/mtd.h
@@ -25,7 +25,7 @@
*/
struct mtddev_hook {
struct list_head hook;
- int (*add_mtd_device)(struct mtd_info *mtd, char *devname, void **priv);
+ int (*add_mtd_device)(struct mtd_info *mtd, const char *devname, void **priv);
int (*del_mtd_device)(struct mtd_info *mtd, void **priv);
void *priv;
};
diff --git a/drivers/mtd/mtdoob.c b/drivers/mtd/mtdoob.c
index 10d17e90d27f..6160ddba0804 100644
--- a/drivers/mtd/mtdoob.c
+++ b/drivers/mtd/mtdoob.c
@@ -69,7 +69,7 @@ static struct file_operations mtd_ops_oob = {
.lseek = dev_lseek_default,
};
-static int add_mtdoob_device(struct mtd_info *mtd, char *devname, void **priv)
+static int add_mtdoob_device(struct mtd_info *mtd, const char *devname, void **priv)
{
struct mtdoob *mtdoob;
diff --git a/drivers/mtd/mtdraw.c b/drivers/mtd/mtdraw.c
index c25e4062eea9..ae4bec2a4cbf 100644
--- a/drivers/mtd/mtdraw.c
+++ b/drivers/mtd/mtdraw.c
@@ -281,7 +281,7 @@ static const struct file_operations mtd_raw_fops = {
.lseek = dev_lseek_default,
};
-static int add_mtdraw_device(struct mtd_info *mtd, char *devname, void **priv)
+static int add_mtdraw_device(struct mtd_info *mtd, const char *devname, void **priv)
{
struct mtdraw *mtdraw;
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 33f1fd512ddd..7e828bc98f92 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -270,7 +270,7 @@ static inline uint32_t mtd_div_by_wb(uint64_t sz, struct mtd_info *mtd)
/* Kernel-side ioctl definitions */
-extern int add_mtd_device(struct mtd_info *mtd, char *devname, int device_id);
+extern int add_mtd_device(struct mtd_info *mtd, const char *devname, int device_id);
extern int del_mtd_device (struct mtd_info *mtd);
extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] mtd: mark devname argument of add_mtd_device as const
2015-07-03 7:49 [PATCH v2] mtd: mark devname argument of add_mtd_device as const Marc Kleine-Budde
@ 2015-07-03 7:51 ` Marc Kleine-Budde
2015-07-03 9:44 ` Sascha Hauer
0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2015-07-03 7:51 UTC (permalink / raw)
To: barebox; +Cc: sha
[-- Attachment #1.1: Type: text/plain, Size: 751 bytes --]
On 07/03/2015 09:49 AM, Marc Kleine-Budde wrote:
> This patch fixes the following warning:
>
> | 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
> | flash_name = dev->id_entry->name;
> | ^
>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This patch applies to master. I can rebase it to -next if needed.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] mtd: mark devname argument of add_mtd_device as const
2015-07-03 7:51 ` Marc Kleine-Budde
@ 2015-07-03 9:44 ` Sascha Hauer
2015-07-03 9:49 ` Marc Kleine-Budde
0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2015-07-03 9:44 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: barebox
On Fri, Jul 03, 2015 at 09:51:47AM +0200, Marc Kleine-Budde wrote:
> On 07/03/2015 09:49 AM, Marc Kleine-Budde wrote:
> > This patch fixes the following warning:
> >
> > | 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
> > | flash_name = dev->id_entry->name;
> > | ^
> >
> > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>
> This patch applies to master. I can rebase it to -next if needed.
Not necessary. It's already included as:
commit 5f11e80670a7cf9acfca05b91b3ccf054b8457ae
Author: Sascha Hauer <s.hauer@pengutronix.de>
Date: Mon Jun 29 07:04:52 2015 +0200
mtd: Make devname argument to add_mtd_device const
add_mtd_device duplicates the string where necessary, so make it
const.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] mtd: mark devname argument of add_mtd_device as const
2015-07-03 9:44 ` Sascha Hauer
@ 2015-07-03 9:49 ` Marc Kleine-Budde
0 siblings, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2015-07-03 9:49 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
[-- Attachment #1.1: Type: text/plain, Size: 969 bytes --]
On 07/03/2015 11:44 AM, Sascha Hauer wrote:
> On Fri, Jul 03, 2015 at 09:51:47AM +0200, Marc Kleine-Budde wrote:
>> On 07/03/2015 09:49 AM, Marc Kleine-Budde wrote:
>>> This patch fixes the following warning:
>>>
>>> | 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
>>> | flash_name = dev->id_entry->name;
>>> | ^
>>>
>>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>>
>> This patch applies to master. I can rebase it to -next if needed.
>
> Not necessary. It's already included as:
Okay. sorry for the noise. :)
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-03 9:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-03 7:49 [PATCH v2] mtd: mark devname argument of add_mtd_device as const Marc Kleine-Budde
2015-07-03 7:51 ` Marc Kleine-Budde
2015-07-03 9:44 ` Sascha Hauer
2015-07-03 9:49 ` Marc Kleine-Budde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox