Patchwork of: mtd: nuke useless const qualifier

login
register
mail settings
Submitter Artem Bityutskiy
Date June 6, 2012, 1:59 p.m.
Message ID <1338991161-18176-1-git-send-email-dedekind1@gmail.com>
Download mbox | patch
Permalink /patch/163382/
State New
Headers show

Comments

Artem Bityutskiy - June 6, 2012, 1:59 p.m.
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

This patch does the following:
 -const int of_get_nand_ecc_mode(struct device_node *np)
 +int of_get_nand_ecc_mode(struct device_node *np)

because:
1. it is probably just a typo?
2. it causes warnings like this when people assing the returned
   value to an 'int' variable:
   include/linux/of_mtd.h:14:18: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

Remove also the unnecessary "extern" qualifier to be consistent with other
declarations in this file.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 drivers/of/of_mtd.c    |    2 +-
 include/linux/of_mtd.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Artem Bityutskiy - June 27, 2012, 10:46 a.m.
On Wed, 2012-06-06 at 16:59 +0300, Artem Bityutskiy wrote:
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> 
> This patch does the following:
>  -const int of_get_nand_ecc_mode(struct device_node *np)
>  +int of_get_nand_ecc_mode(struct device_node *np)
> 
> because:
> 1. it is probably just a typo?
> 2. it causes warnings like this when people assing the returned
>    value to an 'int' variable:
>    include/linux/of_mtd.h:14:18: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
> 
> Remove also the unnecessary "extern" qualifier to be consistent with other
> declarations in this file.
> 
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

Ping

Patch

diff --git a/drivers/of/of_mtd.c b/drivers/of/of_mtd.c
index e7cad62..a27ec94 100644
--- a/drivers/of/of_mtd.c
+++ b/drivers/of/of_mtd.c
@@ -32,7 +32,7 @@  static const char *nand_ecc_modes[] = {
  * The function gets ecc mode string from property 'nand-ecc-mode',
  * and return its index in nand_ecc_modes table, or errno in error case.
  */
-const int of_get_nand_ecc_mode(struct device_node *np)
+int of_get_nand_ecc_mode(struct device_node *np)
 {
 	const char *pm;
 	int err, i;
diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h
index bae1b60..ed7f267 100644
--- a/include/linux/of_mtd.h
+++ b/include/linux/of_mtd.h
@@ -11,7 +11,7 @@ 
 
 #ifdef CONFIG_OF_MTD
 #include <linux/of.h>
-extern const int of_get_nand_ecc_mode(struct device_node *np);
+int of_get_nand_ecc_mode(struct device_node *np);
 int of_get_nand_bus_width(struct device_node *np);
 bool of_get_nand_on_flash_bbt(struct device_node *np);
 #endif