From: Huang Shijie <b32955@freescale.com>
To: Caizhiyong <caizhiyong@hisilicon.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
"Wanglin (Albert)" <albert.wanglin@hisilicon.com>,
David Woodhouse <David.Woodhouse@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Subject: Re: [PATCH] mtd: nand: remove unused function input parameter
Date: Thu, 26 Dec 2013 10:32:07 +0800 [thread overview]
Message-ID: <20131226023206.GB6752@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <C3050A4DBA34F345975765E43127F10F25E47D50@SZXEMA512-MBX.china.huawei.com>
On Wed, Dec 25, 2013 at 12:40:50PM +0000, Caizhiyong wrote:
> From: Cai Zhiyong <caizhiyong@huawei.com>
> Date: Wed, 25 Dec 2013 20:11:15 +0800
> Subject: [PATCH] mtd: nand: remove unused function input parameter
>
> The nand_get_flash_type parameter "busw" input value is not used by any
> branch, and it is updated before use it in the function, so remove it,
> define the "busw" as an internal variable.
>
> Signed-off-by: Cai Zhiyong <caizhiyong@huawei.com>
> ---
> drivers/mtd/nand/nand_base.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 9b3bb3c..a123afa 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -3337,10 +3337,10 @@ static bool find_full_id_nand(struct mtd_info *mtd, struct nand_chip *chip,
> */
> static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
> struct nand_chip *chip,
> - int busw,
> int *maf_id, int *dev_id,
> struct nand_flash_dev *type)
> {
> + int busw;
> int i, maf_idx;
> u8 id_data[8];
>
> @@ -3497,18 +3497,16 @@ ident_done:
> int nand_scan_ident(struct mtd_info *mtd, int maxchips,
> struct nand_flash_dev *table)
> {
> - int i, busw, nand_maf_id, nand_dev_id;
> + int i, nand_maf_id, nand_dev_id;
> struct nand_chip *chip = mtd->priv;
> struct nand_flash_dev *type;
>
> - /* Get buswidth to select the correct functions */
> - busw = chip->options & NAND_BUSWIDTH_16;
> /* Set the default functions */
> - nand_set_defaults(chip, busw);
> + nand_set_defaults(chip, chip->options & NAND_BUSWIDTH_16);
>
> /* Read the flash type */
> - type = nand_get_flash_type(mtd, chip, busw,
> - &nand_maf_id, &nand_dev_id, table);
> + type = nand_get_flash_type(mtd, chip, &nand_maf_id,
> + &nand_dev_id, table);
I think the "busw" is to make the code more readable, since the nand_set_defaults
also needs a busw.
Let Brian judge it.
thanks
Huang Shijie
next prev parent reply other threads:[~2013-12-26 3:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-25 12:40 Caizhiyong
2013-12-26 2:32 ` Huang Shijie [this message]
2014-04-16 5:09 ` 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=20131226023206.GB6752@shlinux2.ap.freescale.net \
--to=b32955@freescale.com \
--cc=David.Woodhouse@intel.com \
--cc=albert.wanglin@hisilicon.com \
--cc=artem.bityutskiy@linux.intel.com \
--cc=caizhiyong@hisilicon.com \
--cc=computersforpeace@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®