All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] blackfin, powerpc: remove redundant definitions of ARRAY_SIZE
@ 2014-07-03  4:55 Masahiro Yamada
  2014-07-03  5:41 ` Stefan Roese
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Masahiro Yamada @ 2014-07-03  4:55 UTC (permalink / raw)
  To: u-boot

Since ARRAY_SIZE macro is defined in include/common.h,
re-defining it in arch-specific files is redundant.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Sonic Zhang <sonic.zhang@analog.com>
---

I built all Blackfin and Powerpc boards.
I confirmed this patch has no bad impact.


 arch/blackfin/include/asm/config-pre.h | 3 ---
 arch/powerpc/cpu/ppc4xx/speed.c        | 2 --
 2 files changed, 5 deletions(-)

diff --git a/arch/blackfin/include/asm/config-pre.h b/arch/blackfin/include/asm/config-pre.h
index d0fd537..2d8b293 100644
--- a/arch/blackfin/include/asm/config-pre.h
+++ b/arch/blackfin/include/asm/config-pre.h
@@ -9,9 +9,6 @@
 #ifndef __ASM_BLACKFIN_CONFIG_PRE_H__
 #define __ASM_BLACKFIN_CONFIG_PRE_H__
 
-/* Misc helper functions */
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
 /* Bootmode defines -- your config needs to select this via CONFIG_BFIN_BOOT_MODE.
  * Depending on your cpu, some of these may not be valid, check your HRM.
  * The actual values here are meaningless as long as they're unique.
diff --git a/arch/powerpc/cpu/ppc4xx/speed.c b/arch/powerpc/cpu/ppc4xx/speed.c
index 7e077d5..4baee77 100644
--- a/arch/powerpc/cpu/ppc4xx/speed.c
+++ b/arch/powerpc/cpu/ppc4xx/speed.c
@@ -19,8 +19,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define DEBUGF(fmt,args...)
 #endif
 
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
 #if defined(CONFIG_405GP)
 
 void get_sys_info (PPC4xx_SYS_INFO * sysInfo)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] blackfin, powerpc: remove redundant definitions of ARRAY_SIZE
  2014-07-03  4:55 [U-Boot] [PATCH] blackfin, powerpc: remove redundant definitions of ARRAY_SIZE Masahiro Yamada
@ 2014-07-03  5:41 ` Stefan Roese
  2014-07-03  5:48 ` Zhang, Sonic
  2014-07-08  1:38 ` [U-Boot] " Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Roese @ 2014-07-03  5:41 UTC (permalink / raw)
  To: u-boot

On 03.07.2014 06:55, Masahiro Yamada wrote:
> Since ARRAY_SIZE macro is defined in include/common.h,
> re-defining it in arch-specific files is redundant.
>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Stefan Roese <sr@denx.de>
> Cc: Sonic Zhang <sonic.zhang@analog.com>

Thanks for catching this.

Acked-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] blackfin, powerpc: remove redundant definitions of ARRAY_SIZE
  2014-07-03  4:55 [U-Boot] [PATCH] blackfin, powerpc: remove redundant definitions of ARRAY_SIZE Masahiro Yamada
  2014-07-03  5:41 ` Stefan Roese
@ 2014-07-03  5:48 ` Zhang, Sonic
  2014-07-08  1:38 ` [U-Boot] " Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Zhang, Sonic @ 2014-07-03  5:48 UTC (permalink / raw)
  To: u-boot

Acked-by: Sonic Zhang <sonic.zhang@analog.com>

Thanks,

Sonic

>-----Original Message-----
>From: Masahiro Yamada [mailto:yamada.m at jp.panasonic.com]
>Sent: Thursday, July 03, 2014 12:56 PM
>To: u-boot at lists.denx.de
>Cc: Masahiro Yamada; Stefan Roese; Zhang, Sonic
>Subject: [PATCH] blackfin,powerpc: remove redundant definitions of ARRAY_SIZE
>
>Since ARRAY_SIZE macro is defined in include/common.h, re-defining it in arch-
>specific files is redundant.
>
>Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
>Cc: Stefan Roese <sr@denx.de>
>Cc: Sonic Zhang <sonic.zhang@analog.com>
>---
>
>I built all Blackfin and Powerpc boards.
>I confirmed this patch has no bad impact.
>
>
> arch/blackfin/include/asm/config-pre.h | 3 ---
> arch/powerpc/cpu/ppc4xx/speed.c        | 2 --
> 2 files changed, 5 deletions(-)
>
>diff --git a/arch/blackfin/include/asm/config-pre.h b/arch/blackfin/include/asm/config-
>pre.h
>index d0fd537..2d8b293 100644
>--- a/arch/blackfin/include/asm/config-pre.h
>+++ b/arch/blackfin/include/asm/config-pre.h
>@@ -9,9 +9,6 @@
> #ifndef __ASM_BLACKFIN_CONFIG_PRE_H__
> #define __ASM_BLACKFIN_CONFIG_PRE_H__
>
>-/* Misc helper functions */
>-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
>-
> /* Bootmode defines -- your config needs to select this via
>CONFIG_BFIN_BOOT_MODE.
>  * Depending on your cpu, some of these may not be valid, check your HRM.
>  * The actual values here are meaningless as long as they're unique.
>diff --git a/arch/powerpc/cpu/ppc4xx/speed.c b/arch/powerpc/cpu/ppc4xx/speed.c
>index 7e077d5..4baee77 100644
>--- a/arch/powerpc/cpu/ppc4xx/speed.c
>+++ b/arch/powerpc/cpu/ppc4xx/speed.c
>@@ -19,8 +19,6 @@ DECLARE_GLOBAL_DATA_PTR;  #define
>DEBUGF(fmt,args...)  #endif
>
>-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
>-
> #if defined(CONFIG_405GP)
>
> void get_sys_info (PPC4xx_SYS_INFO * sysInfo)
>--
>1.9.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] blackfin, powerpc: remove redundant definitions of ARRAY_SIZE
  2014-07-03  4:55 [U-Boot] [PATCH] blackfin, powerpc: remove redundant definitions of ARRAY_SIZE Masahiro Yamada
  2014-07-03  5:41 ` Stefan Roese
  2014-07-03  5:48 ` Zhang, Sonic
@ 2014-07-08  1:38 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2014-07-08  1:38 UTC (permalink / raw)
  To: u-boot

On Thu, Jul 03, 2014 at 01:55:51PM +0900, Masahiro Yamada wrote:

> Since ARRAY_SIZE macro is defined in include/common.h,
> re-defining it in arch-specific files is redundant.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Stefan Roese <sr@denx.de>
> Cc: Sonic Zhang <sonic.zhang@analog.com>
> Acked-by: Stefan Roese <sr@denx.de>
> Acked-by: Sonic Zhang <sonic.zhang@analog.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140707/04da2bd1/attachment.pgp>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-08  1:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-03  4:55 [U-Boot] [PATCH] blackfin, powerpc: remove redundant definitions of ARRAY_SIZE Masahiro Yamada
2014-07-03  5:41 ` Stefan Roese
2014-07-03  5:48 ` Zhang, Sonic
2014-07-08  1:38 ` [U-Boot] " Tom Rini

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.