All of lore.kernel.org
 help / color / mirror / Atom feed
From: pekon <pekon@pek-sem.com>
To: Nicholas Mc Guire <hofrat@osadl.org>,
	David Woodhouse <dwmw2@infradead.org>
Cc: pekon gupta <pekon@ti.com>, Tony Lindgren <tony@atomide.com>,
	linux-kernel@vger.kernel.org, Rostislav Lisovy <lisovy@gmail.com>,
	linux-mtd@lists.infradead.org,
	Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
	Brian Norris <computersforpeace@gmail.com>,
	Roger Quadros <rogerq@ti.com>
Subject: Re: [PATCH v2] mtd: nand: omap: drop condition with no effect
Date: Thu, 05 Feb 2015 07:50:26 +0530	[thread overview]
Message-ID: <54D2D36A.4030800@pek-sem.com> (raw)
In-Reply-To: <1423070646-12906-1-git-send-email-hofrat@osadl.org>

On Wednesday 04 February 2015 10:54 PM, Nicholas Mc Guire wrote:
> The if and the else branch code are identical - so the condition has no
> effect on the effective code. This patch removes the condition and the
> duplicated code and updates the documentation as suggested by
> Roger Quadros <rogerq@ti.com>.
>
> Acked-by: Roger Quadros <rogerq@ti.com>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
>
> v2: Confirmation of proposed patch and update of the related documentation
>      as provided by Roger Quadros <rogerq@ti.com>
>
> The conditions in the OMAP_ECC_BCH8_CODE_HW_DETECTION_SW and
> OMAP_ECC_BCH4_CODE_HW_DETECTION_SW case have no effect and can
> be removed.
>
> Patch was only compile tested with arm-linux-gnueabi-4.7-, current
> crosstool-ng did not seem to build omap2 properly.
> Config is omap2plus_defconfig which implies CONFIG_MTD_NAND_OMAP2=y.
>
> Patch is against 3.19.0-rc7 (localversion-next is -next-20150204)
>
>   drivers/mtd/nand/omap2.c |   31 +++++++++----------------------
>   1 file changed, 9 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> index 63f858e..60fa899 100644
> --- a/drivers/mtd/nand/omap2.c
> +++ b/drivers/mtd/nand/omap2.c
> @@ -1048,10 +1048,9 @@ static int omap_dev_ready(struct mtd_info *mtd)
>    * @mtd: MTD device structure
>    * @mode: Read/Write mode
>    *
> - * When using BCH, sector size is hardcoded to 512 bytes.
> - * Using wrapping mode 6 both for reading and writing if ELM module not uses
> - * for error correction.
> - * On writing,
> + * When using BCH with SW correction (i.e. no ELM), sector size is set
> + * to 512 bytes and we use BCH_WRAPMODE_6 wrapping mode
> + * for both reading and writing with:
>    * eccsize0 = 0  (no additional protected byte in spare area)
>    * eccsize1 = 32 (skip 32 nibbles = 16 bytes per sector in spare area)
>    */
> @@ -1071,15 +1070,9 @@ static void __maybe_unused omap_enable_hwecc_bch(struct mtd_info *mtd, int mode)
>   	case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW:
>   		bch_type = 0;
>   		nsectors = 1;
> -		if (mode == NAND_ECC_READ) {
> -			wr_mode	  = BCH_WRAPMODE_6;
> -			ecc_size0 = BCH_ECC_SIZE0;
> -			ecc_size1 = BCH_ECC_SIZE1;
> -		} else {
> -			wr_mode   = BCH_WRAPMODE_6;
> -			ecc_size0 = BCH_ECC_SIZE0;
> -			ecc_size1 = BCH_ECC_SIZE1;
> -		}
> +		wr_mode	  = BCH_WRAPMODE_6;
> +		ecc_size0 = BCH_ECC_SIZE0;
> +		ecc_size1 = BCH_ECC_SIZE1;
>   		break;
>   	case OMAP_ECC_BCH4_CODE_HW:
>   		bch_type = 0;
> @@ -1097,15 +1090,9 @@ static void __maybe_unused omap_enable_hwecc_bch(struct mtd_info *mtd, int mode)
>   	case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW:
>   		bch_type = 1;
>   		nsectors = 1;
> -		if (mode == NAND_ECC_READ) {
> -			wr_mode	  = BCH_WRAPMODE_6;
> -			ecc_size0 = BCH_ECC_SIZE0;
> -			ecc_size1 = BCH_ECC_SIZE1;
> -		} else {
> -			wr_mode   = BCH_WRAPMODE_6;
> -			ecc_size0 = BCH_ECC_SIZE0;
> -			ecc_size1 = BCH_ECC_SIZE1;
> -		}
> +		wr_mode	  = BCH_WRAPMODE_6;
> +		ecc_size0 = BCH_ECC_SIZE0;
> +		ecc_size1 = BCH_ECC_SIZE1;
>   		break;
>   	case OMAP_ECC_BCH8_CODE_HW:
>   		bch_type = 1;
>
Thanks for the clean-up ..
Reviewed-by: Pekon Gupta <pekon@pek-sem.com>

with regards, pekon

------------------------
Powered by BigRock.com

WARNING: multiple messages have this Message-ID (diff)
From: pekon <pekon@pek-sem.com>
To: Nicholas Mc Guire <hofrat@osadl.org>,
	David Woodhouse <dwmw2@infradead.org>
Cc: Roger Quadros <rogerq@ti.com>, Tony Lindgren <tony@atomide.com>,
	linux-kernel@vger.kernel.org, Rostislav Lisovy <lisovy@gmail.com>,
	linux-mtd@lists.infradead.org,
	Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
	Brian Norris <computersforpeace@gmail.com>,
	pekon gupta <pekon@ti.com>
Subject: Re: [PATCH v2] mtd: nand: omap: drop condition with no effect
Date: Thu, 05 Feb 2015 07:50:26 +0530	[thread overview]
Message-ID: <54D2D36A.4030800@pek-sem.com> (raw)
In-Reply-To: <1423070646-12906-1-git-send-email-hofrat@osadl.org>

On Wednesday 04 February 2015 10:54 PM, Nicholas Mc Guire wrote:
> The if and the else branch code are identical - so the condition has no
> effect on the effective code. This patch removes the condition and the
> duplicated code and updates the documentation as suggested by
> Roger Quadros <rogerq@ti.com>.
>
> Acked-by: Roger Quadros <rogerq@ti.com>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
>
> v2: Confirmation of proposed patch and update of the related documentation
>      as provided by Roger Quadros <rogerq@ti.com>
>
> The conditions in the OMAP_ECC_BCH8_CODE_HW_DETECTION_SW and
> OMAP_ECC_BCH4_CODE_HW_DETECTION_SW case have no effect and can
> be removed.
>
> Patch was only compile tested with arm-linux-gnueabi-4.7-, current
> crosstool-ng did not seem to build omap2 properly.
> Config is omap2plus_defconfig which implies CONFIG_MTD_NAND_OMAP2=y.
>
> Patch is against 3.19.0-rc7 (localversion-next is -next-20150204)
>
>   drivers/mtd/nand/omap2.c |   31 +++++++++----------------------
>   1 file changed, 9 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> index 63f858e..60fa899 100644
> --- a/drivers/mtd/nand/omap2.c
> +++ b/drivers/mtd/nand/omap2.c
> @@ -1048,10 +1048,9 @@ static int omap_dev_ready(struct mtd_info *mtd)
>    * @mtd: MTD device structure
>    * @mode: Read/Write mode
>    *
> - * When using BCH, sector size is hardcoded to 512 bytes.
> - * Using wrapping mode 6 both for reading and writing if ELM module not uses
> - * for error correction.
> - * On writing,
> + * When using BCH with SW correction (i.e. no ELM), sector size is set
> + * to 512 bytes and we use BCH_WRAPMODE_6 wrapping mode
> + * for both reading and writing with:
>    * eccsize0 = 0  (no additional protected byte in spare area)
>    * eccsize1 = 32 (skip 32 nibbles = 16 bytes per sector in spare area)
>    */
> @@ -1071,15 +1070,9 @@ static void __maybe_unused omap_enable_hwecc_bch(struct mtd_info *mtd, int mode)
>   	case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW:
>   		bch_type = 0;
>   		nsectors = 1;
> -		if (mode == NAND_ECC_READ) {
> -			wr_mode	  = BCH_WRAPMODE_6;
> -			ecc_size0 = BCH_ECC_SIZE0;
> -			ecc_size1 = BCH_ECC_SIZE1;
> -		} else {
> -			wr_mode   = BCH_WRAPMODE_6;
> -			ecc_size0 = BCH_ECC_SIZE0;
> -			ecc_size1 = BCH_ECC_SIZE1;
> -		}
> +		wr_mode	  = BCH_WRAPMODE_6;
> +		ecc_size0 = BCH_ECC_SIZE0;
> +		ecc_size1 = BCH_ECC_SIZE1;
>   		break;
>   	case OMAP_ECC_BCH4_CODE_HW:
>   		bch_type = 0;
> @@ -1097,15 +1090,9 @@ static void __maybe_unused omap_enable_hwecc_bch(struct mtd_info *mtd, int mode)
>   	case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW:
>   		bch_type = 1;
>   		nsectors = 1;
> -		if (mode == NAND_ECC_READ) {
> -			wr_mode	  = BCH_WRAPMODE_6;
> -			ecc_size0 = BCH_ECC_SIZE0;
> -			ecc_size1 = BCH_ECC_SIZE1;
> -		} else {
> -			wr_mode   = BCH_WRAPMODE_6;
> -			ecc_size0 = BCH_ECC_SIZE0;
> -			ecc_size1 = BCH_ECC_SIZE1;
> -		}
> +		wr_mode	  = BCH_WRAPMODE_6;
> +		ecc_size0 = BCH_ECC_SIZE0;
> +		ecc_size1 = BCH_ECC_SIZE1;
>   		break;
>   	case OMAP_ECC_BCH8_CODE_HW:
>   		bch_type = 1;
>
Thanks for the clean-up ..
Reviewed-by: Pekon Gupta <pekon@pek-sem.com>

with regards, pekon

------------------------
Powered by BigRock.com


  reply	other threads:[~2015-02-05  2:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 17:24 [PATCH v2] mtd: nand: omap: drop condition with no effect Nicholas Mc Guire
2015-02-04 17:24 ` Nicholas Mc Guire
2015-02-05  2:20 ` pekon [this message]
2015-02-05  2:20   ` pekon
2015-02-06  4:01 ` Brian Norris
2015-02-06  4:01   ` Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54D2D36A.4030800@pek-sem.com \
    --to=pekon@pek-sem.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=hofrat@osadl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=lisovy@gmail.com \
    --cc=pekon@ti.com \
    --cc=rogerq@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.