All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Paul Cercueil' <paul@crapouillou.net>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alex Smith <alex@alex-smith.me.uk>
Cc: "od@zcrc.me" <od@zcrc.me>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 3/4] memory: jz4780-nemc: Reduce size of const array
Date: Thu, 23 Aug 2018 10:41:45 +0000	[thread overview]
Message-ID: <b8fdca29afcb48aa9ee33cc896c24e66@AcuMS.aculab.com> (raw)
In-Reply-To: <20180822172953.11281-3-paul@crapouillou.net>

From: Paul Cercueil
> Sent: 22 August 2018 18:30
> The maximum value found in that array is 15, there's no need to store
> these values as uint32_t, a uint8_t is enough.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
>  drivers/memory/jz4780-nemc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/memory/jz4780-nemc.c b/drivers/memory/jz4780-nemc.c
> index bcf06adefc96..ef3f20e46590 100644
> --- a/drivers/memory/jz4780-nemc.c
> +++ b/drivers/memory/jz4780-nemc.c
> @@ -161,7 +161,7 @@ static bool jz4780_nemc_configure_bank(struct jz4780_nemc *nemc,
>  	 * Conversion of tBP and tAW cycle counts to values supported by the
>  	 * hardware (round up to the next supported value).
>  	 */
> -	static const uint32_t convert_tBP_tAW[] = {
> +	static const u8 convert_tBP_tAW[] = {
>  		0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
> 
>  		/* 11 - 12 -> 12 cycles */
> @@ -232,7 +232,7 @@ static bool jz4780_nemc_configure_bank(struct jz4780_nemc *nemc,
>  			return false;
>  		}
> 
> -		smcr |= convert_tBP_tAW[cycles] << NEMC_SMCR_TBP_SHIFT;
> +		smcr |= (u32)convert_tBP_tAW[cycles] << NEMC_SMCR_TBP_SHIFT;

You don't need the cast here.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  reply	other threads:[~2018-08-23 10:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-22 17:29 [PATCH 1/4] dt-bindings: memory: jz4780-nemc: Add compatible string for JZ4725B Paul Cercueil
2018-08-22 17:29 ` [PATCH 2/4] memory: jz4780_nemc: Drop dependency on MACH_JZ4780, use COMPILE_TEST Paul Cercueil
2018-08-22 17:29 ` [PATCH 3/4] memory: jz4780-nemc: Reduce size of const array Paul Cercueil
2018-08-23 10:41   ` David Laight [this message]
2018-08-23 12:52     ` Paul Cercueil
2018-08-31 12:18   ` Rob Herring
2018-08-31 12:18     ` Rob Herring
2018-08-22 17:29 ` [PATCH 4/4] memory: jz4780_nemc: Add support for the JZ4725B Paul Cercueil
  -- strict thread matches above, loose matches on Subject: below --
2019-01-17 22:45 [PATCH 1/4] dt-bindings: memory: jz4780: Add compatible string for JZ4725B SoC Paul Cercueil
2019-01-17 22:45 ` [PATCH 3/4] memory: jz4780-nemc: Reduce size of const array Paul Cercueil
2019-01-18  8:15   ` Boris Brezillon
2019-01-18 14:10     ` Paul Cercueil

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=b8fdca29afcb48aa9ee33cc896c24e66@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=alex@alex-smith.me.uk \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=od@zcrc.me \
    --cc=paul@crapouillou.net \
    --cc=robh+dt@kernel.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 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.