From: Josh Triplett <josh@joshtriplett.org>
To: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Huang Shijie <shijie8@gmail.com>,
linux-kernel@vger.kernel.org,
Rashika Kheria <rashika.kheria@gmail.com>,
linux-mtd@lists.infradead.org,
"grmoore@altera.com" <grmoore@altera.com>,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH 6/7] mtd: denali: remove unnecessary parentheses
Date: Mon, 8 Sep 2014 01:34:48 -0700 [thread overview]
Message-ID: <20140908083443.GC5361@thin> (raw)
In-Reply-To: <1410163813-31783-7-git-send-email-yamada.m@jp.panasonic.com>
On Mon, Sep 08, 2014 at 05:10:12PM +0900, Masahiro Yamada wrote:
> We should use parentheses only when they are necessary
> or they really improve the readability.
>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
This seems fine; none of these parentheses are needed, since the
relative precedence of the relevant operators is always clear.
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> drivers/mtd/nand/denali.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
> index d37c2e1..ed37b76 100644
> --- a/drivers/mtd/nand/denali.c
> +++ b/drivers/mtd/nand/denali.c
> @@ -267,10 +267,10 @@ static void nand_onfi_timing_set(struct denali_nand_info *denali,
>
> acc_clks = CEIL_DIV(Trea[mode], CLK_X);
>
> - while (((acc_clks * CLK_X) - Trea[mode]) < 3)
> + while (acc_clks * CLK_X - Trea[mode] < 3)
> acc_clks++;
>
> - if ((data_invalid - acc_clks * CLK_X) < 2)
> + if (data_invalid - acc_clks * CLK_X < 2)
> dev_warn(denali->dev, "%s, Line %d: Warning!\n",
> __FILE__, __LINE__);
>
> @@ -285,7 +285,7 @@ static void nand_onfi_timing_set(struct denali_nand_info *denali,
> cs_cnt = 1;
>
> if (Tcea[mode]) {
> - while (((cs_cnt * CLK_X) + Trea[mode]) < Tcea[mode])
> + while (cs_cnt * CLK_X + Trea[mode] < Tcea[mode])
> cs_cnt++;
> }
>
> @@ -295,8 +295,8 @@ static void nand_onfi_timing_set(struct denali_nand_info *denali,
> #endif
>
> /* Sighting 3462430: Temporary hack for MT29F128G08CJABAWP:B */
> - if ((ioread32(denali->flash_reg + MANUFACTURER_ID) == 0) &&
> - (ioread32(denali->flash_reg + DEVICE_ID) == 0x88))
> + if (ioread32(denali->flash_reg + MANUFACTURER_ID) == 0 &&
> + ioread32(denali->flash_reg + DEVICE_ID) == 0x88)
> acc_clks = 6;
>
> iowrite32(acc_clks, denali->flash_reg + ACC_CLKS);
> @@ -577,7 +577,7 @@ static void denali_set_intr_modes(struct denali_nand_info *denali,
> */
> static inline bool is_flash_bank_valid(int flash_bank)
> {
> - return (flash_bank >= 0 && flash_bank < 4);
> + return flash_bank >= 0 && flash_bank < 4;
> }
>
> static void denali_irq_init(struct denali_nand_info *denali)
> @@ -1103,7 +1103,7 @@ static int write_page(struct mtd_info *mtd, struct nand_chip *chip,
> "timeout on write_page (type = %d)\n",
> raw_xfer);
> denali->status =
> - (irq_status & INTR_STATUS__PROGRAM_FAIL) ?
> + irq_status & INTR_STATUS__PROGRAM_FAIL ?
> NAND_STATUS_FAIL : PASS;
> }
>
> @@ -1296,7 +1296,7 @@ static int denali_erase(struct mtd_info *mtd, int page)
> irq_status = wait_for_irq(denali, INTR_STATUS__ERASE_COMP |
> INTR_STATUS__ERASE_FAIL);
>
> - return (irq_status & INTR_STATUS__ERASE_FAIL) ? NAND_STATUS_FAIL : PASS;
> + return irq_status & INTR_STATUS__ERASE_FAIL ? NAND_STATUS_FAIL : PASS;
> }
>
> static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col,
> --
> 1.9.1
>
WARNING: multiple messages have this Message-ID (diff)
From: Josh Triplett <josh@joshtriplett.org>
To: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: linux-mtd@lists.infradead.org,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Huang Shijie <shijie8@gmail.com>,
"grmoore@altera.com" <grmoore@altera.com>,
Rashika Kheria <rashika.kheria@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/7] mtd: denali: remove unnecessary parentheses
Date: Mon, 8 Sep 2014 01:34:48 -0700 [thread overview]
Message-ID: <20140908083443.GC5361@thin> (raw)
In-Reply-To: <1410163813-31783-7-git-send-email-yamada.m@jp.panasonic.com>
On Mon, Sep 08, 2014 at 05:10:12PM +0900, Masahiro Yamada wrote:
> We should use parentheses only when they are necessary
> or they really improve the readability.
>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
This seems fine; none of these parentheses are needed, since the
relative precedence of the relevant operators is always clear.
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> drivers/mtd/nand/denali.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
> index d37c2e1..ed37b76 100644
> --- a/drivers/mtd/nand/denali.c
> +++ b/drivers/mtd/nand/denali.c
> @@ -267,10 +267,10 @@ static void nand_onfi_timing_set(struct denali_nand_info *denali,
>
> acc_clks = CEIL_DIV(Trea[mode], CLK_X);
>
> - while (((acc_clks * CLK_X) - Trea[mode]) < 3)
> + while (acc_clks * CLK_X - Trea[mode] < 3)
> acc_clks++;
>
> - if ((data_invalid - acc_clks * CLK_X) < 2)
> + if (data_invalid - acc_clks * CLK_X < 2)
> dev_warn(denali->dev, "%s, Line %d: Warning!\n",
> __FILE__, __LINE__);
>
> @@ -285,7 +285,7 @@ static void nand_onfi_timing_set(struct denali_nand_info *denali,
> cs_cnt = 1;
>
> if (Tcea[mode]) {
> - while (((cs_cnt * CLK_X) + Trea[mode]) < Tcea[mode])
> + while (cs_cnt * CLK_X + Trea[mode] < Tcea[mode])
> cs_cnt++;
> }
>
> @@ -295,8 +295,8 @@ static void nand_onfi_timing_set(struct denali_nand_info *denali,
> #endif
>
> /* Sighting 3462430: Temporary hack for MT29F128G08CJABAWP:B */
> - if ((ioread32(denali->flash_reg + MANUFACTURER_ID) == 0) &&
> - (ioread32(denali->flash_reg + DEVICE_ID) == 0x88))
> + if (ioread32(denali->flash_reg + MANUFACTURER_ID) == 0 &&
> + ioread32(denali->flash_reg + DEVICE_ID) == 0x88)
> acc_clks = 6;
>
> iowrite32(acc_clks, denali->flash_reg + ACC_CLKS);
> @@ -577,7 +577,7 @@ static void denali_set_intr_modes(struct denali_nand_info *denali,
> */
> static inline bool is_flash_bank_valid(int flash_bank)
> {
> - return (flash_bank >= 0 && flash_bank < 4);
> + return flash_bank >= 0 && flash_bank < 4;
> }
>
> static void denali_irq_init(struct denali_nand_info *denali)
> @@ -1103,7 +1103,7 @@ static int write_page(struct mtd_info *mtd, struct nand_chip *chip,
> "timeout on write_page (type = %d)\n",
> raw_xfer);
> denali->status =
> - (irq_status & INTR_STATUS__PROGRAM_FAIL) ?
> + irq_status & INTR_STATUS__PROGRAM_FAIL ?
> NAND_STATUS_FAIL : PASS;
> }
>
> @@ -1296,7 +1296,7 @@ static int denali_erase(struct mtd_info *mtd, int page)
> irq_status = wait_for_irq(denali, INTR_STATUS__ERASE_COMP |
> INTR_STATUS__ERASE_FAIL);
>
> - return (irq_status & INTR_STATUS__ERASE_FAIL) ? NAND_STATUS_FAIL : PASS;
> + return irq_status & INTR_STATUS__ERASE_FAIL ? NAND_STATUS_FAIL : PASS;
> }
>
> static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col,
> --
> 1.9.1
>
next prev parent reply other threads:[~2014-09-08 8:35 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-08 8:10 [PATCH 0/7] mtd: denali: A collection of trivial coding style fixes Masahiro Yamada
2014-09-08 8:10 ` Masahiro Yamada
2014-09-08 8:10 ` [PATCH 1/7] mtd: denali: fix the format of comment blocks Masahiro Yamada
2014-09-08 8:10 ` Masahiro Yamada
2014-09-08 8:29 ` Josh Triplett
2014-09-08 8:29 ` Josh Triplett
2014-09-08 8:10 ` [PATCH 2/7] mtd: denali: remove unnecessary variable initializations Masahiro Yamada
2014-09-08 8:10 ` Masahiro Yamada
2014-09-08 8:10 ` [PATCH 3/7] mtd: denali: remove unnecessary casts Masahiro Yamada
2014-09-08 8:10 ` Masahiro Yamada
2014-09-08 8:10 ` [PATCH 4/7] mtd: denali: change the type of iterators to int Masahiro Yamada
2014-09-08 8:10 ` Masahiro Yamada
2014-09-08 8:10 ` [PATCH 5/7] mtd: denali: remove a set-but-unused variable Masahiro Yamada
2014-09-08 8:10 ` Masahiro Yamada
2014-09-08 8:30 ` Josh Triplett
2014-09-08 8:30 ` Josh Triplett
2014-09-08 8:10 ` [PATCH 6/7] mtd: denali: remove unnecessary parentheses Masahiro Yamada
2014-09-08 8:10 ` Masahiro Yamada
2014-09-08 8:34 ` Josh Triplett [this message]
2014-09-08 8:34 ` Josh Triplett
2014-09-08 8:10 ` [PATCH 7/7] mtd: denali: fix indentations and other trivial things Masahiro Yamada
2014-09-08 8:10 ` Masahiro Yamada
2014-09-08 8:39 ` Josh Triplett
2014-09-08 8:39 ` Josh Triplett
2014-09-08 9:14 ` Masahiro Yamada
2014-09-08 9:14 ` Masahiro Yamada
2014-09-08 10:00 ` Sudip Mukherjee
2014-09-08 10:00 ` Sudip Mukherjee
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=20140908083443.GC5361@thin \
--to=josh@joshtriplett.org \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=grmoore@altera.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=rashika.kheria@gmail.com \
--cc=shijie8@gmail.com \
--cc=yamada.m@jp.panasonic.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.