2009-11-02 21:05:03

by Thiago Farina

[permalink] [raw]
Subject: [PATCH] blackfin/trivial: remove duplicated MAX macro from stamp.

Since the kernel api already has the macro "max",
just use it instead of declaring another one.

Signed-off-by: Thiago Farina <[email protected]>
---
arch/blackfin/mach-bf537/boards/stamp.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index c46baa5..c76da37 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -385,10 +385,9 @@ static struct platform_nand_data bfin_plat_nand_data = {
},
};

-#define MAX(x, y) (x > y ? x : y)
static struct resource bfin_plat_nand_resources = {
.start = 0x20212000,
- .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
+ .end = 0x20212000 + (1 << max(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
.flags = IORESOURCE_IO,
};

--
1.6.5.1.61.ge79999


2009-11-06 03:14:17

by Zhang, Sonic

[permalink] [raw]
Subject: RE: [Uclinux-dist-devel] [PATCH] blackfin/trivial: remove duplicatedMAX macro from stamp.

Acked-by: Sonic Zhang<[email protected]>

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Thiago Farina
Sent: Tuesday, November 03, 2009 5:05 AM
To: [email protected]
Cc: [email protected]; Hennerich, Michael; [email protected];
Song, Barry; [email protected]; Thiago Farina
Subject: [Uclinux-dist-devel] [PATCH] blackfin/trivial: remove
duplicatedMAX macro from stamp.

Since the kernel api already has the macro "max", just use it instead of
declaring another one.

Signed-off-by: Thiago Farina <[email protected]>
---
arch/blackfin/mach-bf537/boards/stamp.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/blackfin/mach-bf537/boards/stamp.c
b/arch/blackfin/mach-bf537/boards/stamp.c
index c46baa5..c76da37 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -385,10 +385,9 @@ static struct platform_nand_data
bfin_plat_nand_data = {
},
};

-#define MAX(x, y) (x > y ? x : y)
static struct resource bfin_plat_nand_resources = {
.start = 0x20212000,
- .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE,
BFIN_NAND_PLAT_ALE)),
+ .end = 0x20212000 + (1 << max(BFIN_NAND_PLAT_CLE,
BFIN_NAND_PLAT_ALE)),
.flags = IORESOURCE_IO,
};

--
1.6.5.1.61.ge79999

_______________________________________________
Uclinux-dist-devel mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/uclinux-dist-devel

2009-11-08 13:38:39

by Thiago Farina

[permalink] [raw]
Subject: Re: [Uclinux-dist-devel] [PATCH] blackfin/trivial: remove duplicatedMAX macro from stamp.

Hi Sonic,

On Fri, Nov 6, 2009 at 1:17 AM, Zhang, Sonic <[email protected]> wrote:
> Acked-by: Sonic Zhang<[email protected]>

Could you apply this to blackfin tree?

2009-11-08 13:58:07

by Mike Frysinger

[permalink] [raw]
Subject: Re: [Uclinux-dist-devel] [PATCH] blackfin/trivial: remove duplicatedMAX macro from stamp.

On Sun, Nov 8, 2009 at 08:38, Thiago Farina wrote:
> On Fri, Nov 6, 2009 at 1:17 AM, Zhang, Sonic wrote:
>> Acked-by: Sonic Zhang<[email protected]>
>
> Could you apply this to blackfin tree?

he has merged it into the svn tree we have. i havent picked it up in
the Blackfin git tree yet as ive been busy with some other projects.
i should be able to get it in before 2.6.32 final though.
-mike

2009-11-15 02:52:51

by Mike Frysinger

[permalink] [raw]
Subject: Re: [PATCH] blackfin/trivial: remove duplicated MAX macro from stamp.

On Mon, Nov 2, 2009 at 16:04, Thiago Farina wrote:
> Since the kernel api already has the macro "max",
> just use it instead of declaring another one.
>
> --- a/arch/blackfin/mach-bf537/boards/stamp.c
> +++ b/arch/blackfin/mach-bf537/boards/stamp.c
> @@ -385,10 +385,9 @@ static struct platform_nand_data bfin_plat_nand_data = {
>        },
>  };
>
> -#define MAX(x, y) (x > y ? x : y)
>  static struct resource bfin_plat_nand_resources = {
>        .start = 0x20212000,
> -       .end   = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
> +       .end   = 0x20212000 + (1 << max(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),

sorry, going to have to reject this. the common min/max defines are
not usable in this context. this patch produces a build failure:
CC arch/blackfin/mach-bf537/boards/stamp.o
arch/blackfin/mach-bf537/boards/stamp.c:430: error: braced-group
within expression allowed only inside a function
make[1]: *** [arch/blackfin/mach-bf537/boards/stamp.o] Error 1
-mike