From: Scott Wood Date: Tue, 8 Oct 2013 12:28:40 -0500 Subject: [U-Boot] [PATCH v7 3/5] mtd: nand: omap: optimize chip->ecc.calculate() for H/W ECC schemes In-Reply-To: <1380550418-17327-4-git-send-email-pekon@ti.com> References: <1380550418-17327-1-git-send-email-pekon@ti.com> <1380550418-17327-4-git-send-email-pekon@ti.com> Message-ID: <1381253320.7979.249.camel@snotra.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, 2013-09-30 at 19:43 +0530, Pekon Gupta wrote: > + /* ECC scheme specific syndrome customizations */ > + switch (bch->ecc_scheme) { > + case OMAP_ECC_HAM1_CODE_HW: > + break; > + case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW: > +#ifdef CONFIG_BCH > + for (i = 0; i < chip->ecc.bytes; i++) > + *(ecc_code + i) = *(ecc_code + i) ^ > + bch8_polynomial[i]; > +#endif > + break; > + case OMAP_ECC_BCH8_CODE_HW: > + ecc_code[chip->ecc.bytes - 1] = 0x00; > + break; > + default: > + return -EINVAL; > } Shouldn't "case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW:" be inside the "#ifdef CONFIG_BCH" so that you get -EINVAL if the implementation isn't there? -Scott