Received: by 10.223.164.202 with SMTP id h10csp480613wrb; Thu, 30 Nov 2017 13:40:52 -0800 (PST) X-Google-Smtp-Source: AGs4zMZjMCh45MuxCiTlPAqu6yEJISpl17jkLvYDa89mWswqZULTKez9WfMBSvclC5dSqpPjGqm1 X-Received: by 10.99.108.67 with SMTP id h64mr3693829pgc.119.1512078052770; Thu, 30 Nov 2017 13:40:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512078052; cv=none; d=google.com; s=arc-20160816; b=zJGqPgVoaNhyL0KEcZEupuRTU1C9BD2ibBXhLzCtqcXHkfKjkci3pU/kxtBdFDJEaR cn8pJj+vPjrjm1Gmx06x126pQxR/9G5d9lw206xb7dDo9eD5IxLQeRAlZ9Upk2K6ftvd MhN/7MAfCgLHREqbILvY/kAPXa87BW54AVrPLOlP9KDoG2+4n/D4JRofRkH6F/MbJRBe sSF8uCgiVoloFLFizLlrafjK5c3CELCub3xD35AK86nu5ZkKNQMSlaIfCfh8/r6eHN3o rRYmn8iKcill93N8bcSkkgfte7F0DrYwXLVlzk73cQRt+rjqaUIVcG4ztiJrPCI5zork euoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=FfDqtis9nZkLARgG2Eeh25TqEtAI0C7iN0KB9ZH7T1A=; b=NY4xL9yjhzCCcvE6aHtc0dlVdfpK+CZ2I7+tsmo71yqhK6XowtFyNrnwSOkVFelRJu jvb6Ilyt0E2UkeOyikiolHpu6I7iDmXmZ4AEoxUkrJFyhMVXr2nA5Oi/PfIxlPOUKvZZ A2Rs8DtIRd5Hq33TIkurGL6plofYV7uO4+U4XJR7V83SSJx1wxKAL/DAXbQoJeYl8aqo Kd0qzOSInNBnpm+/ySXs0qPlZsjdSQca69WZ3+jgUqUMnkryJf63IHtW037r+BtLuMvX SMyawPN6BHpIvqyOtI4InSFClCf17Da5r9T3Eyft823Pg07SPbWPZAJoxo3WtsX6ET+q cRAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o128si3897411pfg.203.2017.11.30.13.40.39; Thu, 30 Nov 2017 13:40:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751560AbdK3VjY (ORCPT + 99 others); Thu, 30 Nov 2017 16:39:24 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:45282 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975AbdK3VjU (ORCPT ); Thu, 30 Nov 2017 16:39:20 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id A0CE220749; Thu, 30 Nov 2017 22:39:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (unknown [91.160.177.164]) by mail.free-electrons.com (Postfix) with ESMTPSA id 6274920386; Thu, 30 Nov 2017 22:39:18 +0100 (CET) Date: Thu, 30 Nov 2017 22:39:17 +0100 From: Boris Brezillon To: Masahiro Yamada Cc: linux-mtd@lists.infradead.org, Cyrille Pitchen , linux-kernel@vger.kernel.org, Marek Vasut , Brian Norris , Richard Weinberger , David Woodhouse Subject: Re: [PATCH] mtd: nand: denali: rename misleading dma_buf to tmp_buf Message-ID: <20171130223917.25ea42ea@bbrezillon> In-Reply-To: <1511443948-18474-1-git-send-email-yamada.masahiro@socionext.com> References: <1511443948-18474-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 23 Nov 2017 22:32:28 +0900 Masahiro Yamada wrote: > The "dma_buf" is not used for a DMA bounce buffer, but for arranging > the transferred data for the syndrome page layout. In fact, it is > used in the PIO mode as well, so "dma_buf" is a misleading name. > Rename it to "tmp_buf". Applied. Thanks, Boris > > Signed-off-by: Masahiro Yamada > --- > > drivers/mtd/nand/denali.c | 34 +++++++++++++++++----------------- > 1 file changed, 17 insertions(+), 17 deletions(-) > > diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c > index 5124f8a..34008a0 100644 > --- a/drivers/mtd/nand/denali.c > +++ b/drivers/mtd/nand/denali.c > @@ -710,12 +710,12 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, > int ecc_steps = chip->ecc.steps; > int ecc_size = chip->ecc.size; > int ecc_bytes = chip->ecc.bytes; > - void *dma_buf = denali->buf; > + void *tmp_buf = denali->buf; > int oob_skip = denali->oob_skip_bytes; > size_t size = writesize + oobsize; > int ret, i, pos, len; > > - ret = denali_data_xfer(denali, dma_buf, size, page, 1, 0); > + ret = denali_data_xfer(denali, tmp_buf, size, page, 1, 0); > if (ret) > return ret; > > @@ -730,11 +730,11 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, > else if (pos + len > writesize) > len = writesize - pos; > > - memcpy(buf, dma_buf + pos, len); > + memcpy(buf, tmp_buf + pos, len); > buf += len; > if (len < ecc_size) { > len = ecc_size - len; > - memcpy(buf, dma_buf + writesize + oob_skip, > + memcpy(buf, tmp_buf + writesize + oob_skip, > len); > buf += len; > } > @@ -745,7 +745,7 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, > uint8_t *oob = chip->oob_poi; > > /* BBM at the beginning of the OOB area */ > - memcpy(oob, dma_buf + writesize, oob_skip); > + memcpy(oob, tmp_buf + writesize, oob_skip); > oob += oob_skip; > > /* OOB ECC */ > @@ -758,11 +758,11 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, > else if (pos + len > writesize) > len = writesize - pos; > > - memcpy(oob, dma_buf + pos, len); > + memcpy(oob, tmp_buf + pos, len); > oob += len; > if (len < ecc_bytes) { > len = ecc_bytes - len; > - memcpy(oob, dma_buf + writesize + oob_skip, > + memcpy(oob, tmp_buf + writesize + oob_skip, > len); > oob += len; > } > @@ -770,7 +770,7 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, > > /* OOB free */ > len = oobsize - (oob - chip->oob_poi); > - memcpy(oob, dma_buf + size - len, len); > + memcpy(oob, tmp_buf + size - len, len); > } > > return 0; > @@ -841,7 +841,7 @@ static int denali_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, > int ecc_steps = chip->ecc.steps; > int ecc_size = chip->ecc.size; > int ecc_bytes = chip->ecc.bytes; > - void *dma_buf = denali->buf; > + void *tmp_buf = denali->buf; > int oob_skip = denali->oob_skip_bytes; > size_t size = writesize + oobsize; > int i, pos, len; > @@ -851,7 +851,7 @@ static int denali_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, > * This simplifies the logic. > */ > if (!buf || !oob_required) > - memset(dma_buf, 0xff, size); > + memset(tmp_buf, 0xff, size); > > /* Arrange the buffer for syndrome payload/ecc layout */ > if (buf) { > @@ -864,11 +864,11 @@ static int denali_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, > else if (pos + len > writesize) > len = writesize - pos; > > - memcpy(dma_buf + pos, buf, len); > + memcpy(tmp_buf + pos, buf, len); > buf += len; > if (len < ecc_size) { > len = ecc_size - len; > - memcpy(dma_buf + writesize + oob_skip, buf, > + memcpy(tmp_buf + writesize + oob_skip, buf, > len); > buf += len; > } > @@ -879,7 +879,7 @@ static int denali_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, > const uint8_t *oob = chip->oob_poi; > > /* BBM at the beginning of the OOB area */ > - memcpy(dma_buf + writesize, oob, oob_skip); > + memcpy(tmp_buf + writesize, oob, oob_skip); > oob += oob_skip; > > /* OOB ECC */ > @@ -892,11 +892,11 @@ static int denali_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, > else if (pos + len > writesize) > len = writesize - pos; > > - memcpy(dma_buf + pos, oob, len); > + memcpy(tmp_buf + pos, oob, len); > oob += len; > if (len < ecc_bytes) { > len = ecc_bytes - len; > - memcpy(dma_buf + writesize + oob_skip, oob, > + memcpy(tmp_buf + writesize + oob_skip, oob, > len); > oob += len; > } > @@ -904,10 +904,10 @@ static int denali_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, > > /* OOB free */ > len = oobsize - (oob - chip->oob_poi); > - memcpy(dma_buf + size - len, oob, len); > + memcpy(tmp_buf + size - len, oob, len); > } > > - return denali_data_xfer(denali, dma_buf, size, page, 1, 1); > + return denali_data_xfer(denali, tmp_buf, size, page, 1, 1); > } > > static int denali_write_page(struct mtd_info *mtd, struct nand_chip *chip, From 1584864061637860995@xxx Thu Nov 23 13:35:50 +0000 2017 X-GM-THRID: 1584864061637860995 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread