diff mbox

mtd: nand: omap: fix compile warning on ‘erased_sector_bitflips’

Message ID 20140415003205.0bb2cf44@spike
State Accepted
Commit 9fd6c6c18c1a4a3220473c76fd447c5708b5ecf9
Headers show

Commit Message

Christian Engelmayer April 14, 2014, 10:32 p.m. UTC
Commit 2c9f2365 (mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch4
in omap_calculate_ecc_bch) introduced minor compile warning
"‘erased_sector_bitflips’ defined but not used [-Wunused-function]" when
compiling without CONFIG_MTD_NAND_OMAP_BCH. Move function
erased_sector_bitflips() into the same ifdef section as the only caller.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
---
 drivers/mtd/nand/omap2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jingoo Han April 15, 2014, 12:33 a.m. UTC | #1
On Tuesday, April 15, 2014 7:32 AM, Christian Engelmayer wrote:
> 
> Commit 2c9f2365 (mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch4
> in omap_calculate_ecc_bch) introduced minor compile warning
> "‘erased_sector_bitflips’ defined but not used [-Wunused-function]" when
> compiling without CONFIG_MTD_NAND_OMAP_BCH. Move function
> erased_sector_bitflips() into the same ifdef section as the only caller.
> 
> Signed-off-by: Christian Engelmayer <cengelma@gmx.at>

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> ---
>  drivers/mtd/nand/omap2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> index 1ff49b8..1b800bc 100644
> --- a/drivers/mtd/nand/omap2.c
> +++ b/drivers/mtd/nand/omap2.c
> @@ -1237,6 +1237,7 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,
>  	return 0;
>  }
> 
> +#ifdef CONFIG_MTD_NAND_OMAP_BCH
>  /**
>   * erased_sector_bitflips - count bit flips
>   * @data:	data sector buffer
> @@ -1276,7 +1277,6 @@ static int erased_sector_bitflips(u_char *data, u_char *oob,
>  	return flip_bits;
>  }
> 
> -#ifdef CONFIG_MTD_NAND_OMAP_BCH
>  /**
>   * omap_elm_correct_data - corrects page data area in case error reported
>   * @mtd:	MTD device structure
> --
> 1.8.3.2
pekon gupta April 15, 2014, 3:58 a.m. UTC | #2
>From: Jingoo Han [mailto:jg1.han@samsung.com]

>>On Tuesday, April 15, 2014 7:32 AM, Christian Engelmayer wrote:

>>

>> Commit 2c9f2365 (mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch4

>> in omap_calculate_ecc_bch) introduced minor compile warning

>> "‘erased_sector_bitflips’ defined but not used [-Wunused-function]" when

>> compiling without CONFIG_MTD_NAND_OMAP_BCH. Move function

>> erased_sector_bitflips() into the same ifdef section as the only caller.

>>

>> Signed-off-by: Christian Engelmayer <cengelma@gmx.at>

>

>Reviewed-by: Jingoo Han <jg1.han@samsung.com>

>

Thanks for the patch..
Acked-by: Pekon Gupta <pekon@ti.com>



With regards, pekon
Brian Norris April 16, 2014, 6:21 a.m. UTC | #3
On Tue, Apr 15, 2014 at 03:58:56AM +0000, Pekon Gupta wrote:
> >From: Jingoo Han [mailto:jg1.han@samsung.com]
> >>On Tuesday, April 15, 2014 7:32 AM, Christian Engelmayer wrote:
> >>
> >> Commit 2c9f2365 (mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch4
> >> in omap_calculate_ecc_bch) introduced minor compile warning
> >> "‘erased_sector_bitflips’ defined but not used [-Wunused-function]" when
> >> compiling without CONFIG_MTD_NAND_OMAP_BCH. Move function
> >> erased_sector_bitflips() into the same ifdef section as the only caller.
> >>
> >> Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
> >
> >Reviewed-by: Jingoo Han <jg1.han@samsung.com>
> >
> Thanks for the patch..
> Acked-by: Pekon Gupta <pekon@ti.com>

Pushed to l2-mtd.git. Thanks!

Brian
diff mbox

Patch

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 1ff49b8..1b800bc 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1237,6 +1237,7 @@  static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,
 	return 0;
 }
 
+#ifdef CONFIG_MTD_NAND_OMAP_BCH
 /**
  * erased_sector_bitflips - count bit flips
  * @data:	data sector buffer
@@ -1276,7 +1277,6 @@  static int erased_sector_bitflips(u_char *data, u_char *oob,
 	return flip_bits;
 }
 
-#ifdef CONFIG_MTD_NAND_OMAP_BCH
 /**
  * omap_elm_correct_data - corrects page data area in case error reported
  * @mtd:	MTD device structure