From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Wed, 28 Sep 2011 17:23:59 -0500 Subject: [U-Boot] [PATCH 09/15] iMX28: Add GPMI NAND driver In-Reply-To: <201109290012.23189.marek.vasut@gmail.com> References: <1315800409-19876-1-git-send-email-marek.vasut@gmail.com> <1315800409-19876-10-git-send-email-marek.vasut@gmail.com> <4E839115.6000409@freescale.com> <201109290012.23189.marek.vasut@gmail.com> Message-ID: <4E839E7F.3030100@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09/28/2011 05:12 PM, Marek Vasut wrote: > On Wednesday, September 28, 2011 11:26:45 PM Scott Wood wrote: >> On 09/11/2011 11:06 PM, Marek Vasut wrote: >>> +static void mxs_nand_return_dma_descs(struct mxs_nand_info *info) >>> +{ >>> + int i = info->desc_index; >>> + struct mxs_dma_desc *desc; >>> + >>> + for (--i; i >= 0; i--) { >> >> This is an awkward construct. >> >> Why not just the usual: >> >> for (i = 0; i < info->desc_index; i++) >> > > Checking the driver, this modifies the global data so this is ok I don't follow... I'm assuming by "this" you mean the original code since you didn't change it, so are you saying that the global data has to be modified in descending order? If that's really a requirement, put in a comment saying so (and ideally why), and you could still just do: for (i = info->desc_index - 1; i >= 0; i--) or while (--i >= 0) -Scott