[U-Boot] [PATCH 31/32] drivers/mtd/nand: sparse fixes

Scott Wood
2012-10-22T19:18:21Z

On 10/16/2012 07:28:47 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>
> ---
> drivers/mtd/nand/nand_base.c | 9 +++++----
> drivers/mtd/nand/nand_ecc.c | 1 +
> 2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_base.c
> b/drivers/mtd/nand/nand_base.c
> index 71f5027..110cebd 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -2849,12 +2849,13 @@ ident_done:
>
> /* 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,
> + " 0x%02x, Chip ID: 0x%02x (%s", *maf_id, *dev_id,
> + nand_manuf_ids[maf_idx].name);
> #ifdef CONFIG_SYS_NAND_ONFI_DETECTION
> - chip->onfi_version ? chip->onfi_params.model :
> type->name);
> + MTDDEBUG (MTD_DEBUG_LEVEL0, " %s)\n", chip->onfi_version ?
> + chip->onfi_params.model : type->name);
> #else
> - type->name);
> + MTDDEBUG (MTD_DEBUG_LEVEL0, " %s)\n", type->name);
> #endif

I didn't know preprocessor directives inside an argument list were
banned...

In any case how about something like:

const char *name = type->name;

#ifdef CONFIG_SYS_NAND_ONFI_DETECTION
if (chip->onfi_version)
name = chip->onfi_params.model;
#endif

MTDDEBUG(..., name);

-Scott