From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miquel Raynal Subject: Re: [PATCH v3 13/16] mtd: rawnand: qcom: minor code reorganization for bad block check Date: Sat, 26 May 2018 10:58:38 +0200 Message-ID: <20180526104900.139dd19b@xps13> References: <1527250904-21988-1-git-send-email-absahu@codeaurora.org> <1527250904-21988-14-git-send-email-absahu@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Return-path: In-Reply-To: <1527250904-21988-14-git-send-email-absahu@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org To: Abhishek Sahu Cc: Boris Brezillon , David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , Cyrille Pitchen , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Andy Gross , Archit Taneja List-Id: linux-arm-msm@vger.kernel.org Hi Abhishek, > @@ -2141,12 +2127,10 @@ static int qcom_nandc_block_bad(struct mtd_info *mtd, loff_t ofs) > goto err; > } > > - bbpos = mtd->writesize - host->cw_size * (ecc->steps - 1); > - > - bad = nandc->data_buffer[bbpos] != 0xff; > + bad = bbm_bytes_buf[0] != 0xff; BTW, as there are host->bbm_size bytes that can inform on the block state, don't we need to check all of them? > > if (chip->options & NAND_BUSWIDTH_16) > - bad = bad || (nandc->data_buffer[bbpos + 1] != 0xff); > + bad = bad || (bbm_bytes_buf[1] != 0xff); > err: > return bad; > } Thanks, Miquèl