Patchwork [U-Boot,v2,24/25] drivers/mtd/nand: sparse fixes

login
register
mail settings
Submitter Kim Phillips
Date Oct. 29, 2012, 11:34 p.m.
Message ID <1351553687-12469-25-git-send-email-kim.phillips@freescale.com>
Download mbox | patch
Permalink /patch/195146/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Kim Phillips - Oct. 29, 2012, 11:34 p.m.
nand_ecc.c:82:5: warning: symbol 'nand_calculate_ecc' was not declared. Should it be static?
nand_ecc.c:155:5: warning: symbol 'nand_correct_data' was not declared. Should it be static?
nand_base.c:2854:1: error: directive in argument list
nand_base.c:2856:1: error: directive in argument list

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
v2: re-worked based upon input from Scott, checkpatch fixes.

 drivers/mtd/nand/nand_base.c | 13 +++++++------
 drivers/mtd/nand/nand_ecc.c  |  1 +
 2 files changed, 8 insertions(+), 6 deletions(-)
Scott Wood - Oct. 30, 2012, 12:43 a.m.
On 10/29/2012 06:34:46 PM, Kim Phillips wrote:
> nand_ecc.c:82:5: warning: symbol 'nand_calculate_ecc' was not  
> declared. Should it be static?
> nand_ecc.c:155:5: warning: symbol 'nand_correct_data' was not  
> declared. Should it be static?
> nand_base.c:2854:1: error: directive in argument list
> nand_base.c:2856:1: error: directive in argument list
> 
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> ---
> v2: re-worked based upon input from Scott, checkpatch fixes.
> 
>  drivers/mtd/nand/nand_base.c | 13 +++++++------
>  drivers/mtd/nand/nand_ecc.c  |  1 +
>  2 files changed, 8 insertions(+), 6 deletions(-)

Acked-by: Scott Wood <scottwood@freescale.com>

-Scott

Patch

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 71f5027..d3b71a5 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2601,6 +2601,7 @@  static const struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
 						  int *maf_id, int *dev_id,
 						  const struct nand_flash_dev *type)
 {
+	const char *name;
 	int i, maf_idx;
 	u8 id_data[8];
 	int ret;
@@ -2848,14 +2849,14 @@  ident_done:
 		chip->cmdfunc = nand_command_lp;
 
 	/* TODO onfi flash name */
-	MTDDEBUG (MTD_DEBUG_LEVEL0, "NAND device: Manufacturer ID:"
-		" 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, *dev_id,
-		nand_manuf_ids[maf_idx].name,
+	name = type->name;
 #ifdef CONFIG_SYS_NAND_ONFI_DETECTION
-		chip->onfi_version ? chip->onfi_params.model : type->name);
-#else
-		type->name);
+	if (chip->onfi_version)
+		name = chip->onfi_params.model;
 #endif
+	MTDDEBUG(MTD_DEBUG_LEVEL0, "NAND device: Manufacturer ID:"
+		 " 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, *dev_id,
+		 nand_manuf_ids[maf_idx].name, name);
 
 	return type;
 }
diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c
index 81f0e08..097cf62 100644
--- a/drivers/mtd/nand/nand_ecc.c
+++ b/drivers/mtd/nand/nand_ecc.c
@@ -39,6 +39,7 @@ 
 
 #include <asm/errno.h>
 #include <linux/mtd/mtd.h>
+#include <linux/mtd/nand_ecc.h>
 
 /* The PPC4xx NDFC uses Smart Media (SMC) bytes order */
 #ifdef CONFIG_NAND_NDFC