diff mbox series

[U-Boot,v3,4/4] rk3288: Convert register defines to const uintptr_t

Message ID 20180611190051.6897-5-carlo@caione.org
State Accepted
Delegated to: Philipp Tomsich
Headers show
Series rk3288: veyron: Enable SDMMC when booting from SPI | expand

Commit Message

Carlo Caione June 11, 2018, 7 p.m. UTC
From: Carlo Caione <carlo@endlessm.com>

No functional change but at least we can now guarantee type safety.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
---
 arch/arm/mach-rockchip/rk3288-board.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Simon Glass July 9, 2018, 3:05 a.m. UTC | #1
On 11 June 2018 at 13:00, Carlo Caione <carlo@caione.org> wrote:
> From: Carlo Caione <carlo@endlessm.com>
>
> No functional change but at least we can now guarantee type safety.
>
> Signed-off-by: Carlo Caione <carlo@endlessm.com>
> ---
>  arch/arm/mach-rockchip/rk3288-board.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

I'm not sure this affects type safety. The value in the #define has
the same value (and type) as your variables.
Philipp Tomsich July 13, 2018, 10:26 a.m. UTC | #2
> On 9 Jul 2018, at 05:05, Simon Glass <sjg@chromium.org> wrote:
> 
> On 11 June 2018 at 13:00, Carlo Caione <carlo@caione.org> wrote:
>> From: Carlo Caione <carlo@endlessm.com>
>> 
>> No functional change but at least we can now guarantee type safety.
>> 
>> Signed-off-by: Carlo Caione <carlo@endlessm.com>
>> ---
>> arch/arm/mach-rockchip/rk3288-board.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> I'm not sure this affects type safety. The value in the #define has
> the same value (and type) as your variables.

I prefer this as locally defined const variables, so I’ve squashed this onto 2/4.

Philipp.
diff mbox series

Patch

diff --git a/arch/arm/mach-rockchip/rk3288-board.c b/arch/arm/mach-rockchip/rk3288-board.c
index 0e83c0a947..9c4f7f219f 100644
--- a/arch/arm/mach-rockchip/rk3288-board.c
+++ b/arch/arm/mach-rockchip/rk3288-board.c
@@ -317,11 +317,10 @@  U_BOOT_CMD(
 	""
 );
 
-#define GRF_SOC_CON0 0xff770244
-#define GRF_SOC_CON2 0xff77024c
-
 int board_early_init_f(void)
 {
+	const uintptr_t GRF_SOC_CON0 = 0xff770244;
+	const uintptr_t GRF_SOC_CON2 = 0xff77024c;
 	struct udevice *pinctrl;
 	struct udevice *dev;
 	int ret;