* =?UTF-8?q?=5BPATCH=201/6=5D=20sh=3A=20fix=20compiler=20warning=20by=20properly=20inlining=20flat=5Fs
@ 2012-06-09 8:13 Ezequiel Garcia
2012-06-09 9:14 ` [PATCH 1/6] sh: fix compiler warning by properly inlining flat_set_persistent() Paul Mundt
0 siblings, 1 reply; 6+ messages in thread
From: Ezequiel Garcia @ 2012-06-09 8:13 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-arch, Ezequiel Garcia, Paul Mundt, linux-sh
This patch removes the following warning:
fs/binfmt_flat.c:752: warning: unused variable ‘persistent’
There is neither change in functionality, nor extra code generated.
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: <linux-sh@vger.kernel.org>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
arch/sh/include/asm/flat.h | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/arch/sh/include/asm/flat.h b/arch/sh/include/asm/flat.h
index 5d84df5..51dd7af 100644
--- a/arch/sh/include/asm/flat.h
+++ b/arch/sh/include/asm/flat.h
@@ -18,7 +18,12 @@
#define flat_get_addr_from_rp(rp, relval, flags, p) get_unaligned(rp)
#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp)
#define flat_get_relocate_addr(rel) (rel)
-#define flat_set_persistent(relval, p) ({ (void)p; 0; })
+
+static inline int flat_set_persistent(unsigned long relval,
+ unsigned long *persistent)
+{
+ return 0;
+}
#define FLAT_PLAT_INIT(_r) \
do { _r->regs[0]=0; _r->regs[1]=0; _r->regs[2]=0; _r->regs[3]=0; \
--
1.7.3.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 1/6] sh: fix compiler warning by properly inlining flat_set_persistent()
2012-06-09 8:13 =?UTF-8?q?=5BPATCH=201/6=5D=20sh=3A=20fix=20compiler=20warning=20by=20properly=20inlining=20flat=5Fs Ezequiel Garcia
@ 2012-06-09 9:14 ` Paul Mundt
2012-06-09 12:01 ` Ezequiel Garcia
2012-06-10 21:33 ` Ezequiel Garcia
0 siblings, 2 replies; 6+ messages in thread
From: Paul Mundt @ 2012-06-09 9:14 UTC (permalink / raw)
To: Ezequiel Garcia; +Cc: linux-kernel, linux-arch, linux-sh
On Sat, Jun 09, 2012 at 05:13:26AM -0300, Ezequiel Garcia wrote:
> This patch removes the following warning:
> fs/binfmt_flat.c:752: warning: unused variable ???persistent???
> There is neither change in functionality, nor extra code generated.
>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: <linux-sh@vger.kernel.org>
> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
That's what the cast was for, with what gcc version did that stop
working?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/6] sh: fix compiler warning by properly inlining flat_set_persistent()
2012-06-09 9:14 ` [PATCH 1/6] sh: fix compiler warning by properly inlining flat_set_persistent() Paul Mundt
@ 2012-06-09 12:01 ` Ezequiel Garcia
2012-06-10 21:33 ` Ezequiel Garcia
1 sibling, 0 replies; 6+ messages in thread
From: Ezequiel Garcia @ 2012-06-09 12:01 UTC (permalink / raw)
To: Paul Mundt; +Cc: linux-kernel, linux-arch, linux-sh
On Sat, Jun 9, 2012 at 6:14 AM, Paul Mundt <lethal@linux-sh.org> wrote:
> On Sat, Jun 09, 2012 at 05:13:26AM -0300, Ezequiel Garcia wrote:
>> This patch removes the following warning:
>> fs/binfmt_flat.c:752: warning: unused variable ???persistent???
>> There is neither change in functionality, nor extra code generated.
>>
>> Cc: Paul Mundt <lethal@linux-sh.org>
>> Cc: <linux-sh@vger.kernel.org>
>> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
>
> That's what the cast was for, with what gcc version did that stop
> working?
Mmm. You're right. I did this change first for m68k [1] and when that
went ok, I decided it
was best to propagate this fix to every other arch.
Originally, my first try was to propagate your cast:
#define flat_set_persistent(relval, p) ({ (void)p; 0; })
to the other arches, that just do:
#define flat_set_persistent(relval, p) 0
But, then someone pointed out that inlining would produce some (nil) code
and it seemed better.
To conclude: sh was the only one doing it right, and there is no good
reason to change
it, except to make code more homogeneous.
Hope it is clear now,
Ezequiel.
[1] https://lkml.org/lkml/2012/5/21/491
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/6] sh: fix compiler warning by properly inlining flat_set_persistent()
2012-06-09 9:14 ` [PATCH 1/6] sh: fix compiler warning by properly inlining flat_set_persistent() Paul Mundt
2012-06-09 12:01 ` Ezequiel Garcia
@ 2012-06-10 21:33 ` Ezequiel Garcia
2012-06-11 3:50 ` Paul Mundt
1 sibling, 1 reply; 6+ messages in thread
From: Ezequiel Garcia @ 2012-06-10 21:33 UTC (permalink / raw)
To: Paul Mundt; +Cc: linux-kernel, linux-arch, linux-sh
On Sat, Jun 9, 2012 at 6:14 AM, Paul Mundt <lethal@linux-sh.org> wrote:
> On Sat, Jun 09, 2012 at 05:13:26AM -0300, Ezequiel Garcia wrote:
>> This patch removes the following warning:
>> fs/binfmt_flat.c:752: warning: unused variable ???persistent???
>> There is neither change in functionality, nor extra code generated.
>>
>> Cc: Paul Mundt <lethal@linux-sh.org>
>> Cc: <linux-sh@vger.kernel.org>
>> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
>
> That's what the cast was for, with what gcc version did that stop
> working?
I just realized that I should send a v2 (not the whole series just this one)
correcting the commit message, since there wasn't a warning to fix
in first place.
I'll do this soon.
Regards,
Ezequiel.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/6] sh: fix compiler warning by properly inlining flat_set_persistent()
2012-06-10 21:33 ` Ezequiel Garcia
@ 2012-06-11 3:50 ` Paul Mundt
2012-06-11 16:29 ` Ezequiel Garcia
0 siblings, 1 reply; 6+ messages in thread
From: Paul Mundt @ 2012-06-11 3:50 UTC (permalink / raw)
To: Ezequiel Garcia; +Cc: linux-kernel, linux-arch, linux-sh
On Sun, Jun 10, 2012 at 06:33:10PM -0300, Ezequiel Garcia wrote:
> On Sat, Jun 9, 2012 at 6:14 AM, Paul Mundt <lethal@linux-sh.org> wrote:
> > On Sat, Jun 09, 2012 at 05:13:26AM -0300, Ezequiel Garcia wrote:
> >> This patch removes the following warning:
> >> fs/binfmt_flat.c:752: warning: unused variable ???persistent???
> >> There is neither change in functionality, nor extra code generated.
> >>
> >> Cc: Paul Mundt <lethal@linux-sh.org>
> >> Cc: <linux-sh@vger.kernel.org>
> >> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
> >
> > That's what the cast was for, with what gcc version did that stop
> > working?
>
> I just realized that I should send a v2 (not the whole series just this one)
> correcting the commit message, since there wasn't a warning to fix
> in first place.
>
> I'll do this soon.
If there's no warning then the point of the patch eludes me. There's
nothing wrong with consistency, but attempting to fix that which isn't
broken in the name of consistency borders a bit too closely on pointless
busy work for my liking.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/6] sh: fix compiler warning by properly inlining flat_set_persistent()
2012-06-11 3:50 ` Paul Mundt
@ 2012-06-11 16:29 ` Ezequiel Garcia
0 siblings, 0 replies; 6+ messages in thread
From: Ezequiel Garcia @ 2012-06-11 16:29 UTC (permalink / raw)
To: Paul Mundt; +Cc: linux-kernel, linux-arch, linux-sh
On Mon, Jun 11, 2012 at 12:50 AM, Paul Mundt <lethal@linux-sh.org> wrote:
> On Sun, Jun 10, 2012 at 06:33:10PM -0300, Ezequiel Garcia wrote:
>> On Sat, Jun 9, 2012 at 6:14 AM, Paul Mundt <lethal@linux-sh.org> wrote:
>> > On Sat, Jun 09, 2012 at 05:13:26AM -0300, Ezequiel Garcia wrote:
>> >> This patch removes the following warning:
>> >> fs/binfmt_flat.c:752: warning: unused variable ???persistent???
>> >> There is neither change in functionality, nor extra code generated.
>> >>
>> >> Cc: Paul Mundt <lethal@linux-sh.org>
>> >> Cc: <linux-sh@vger.kernel.org>
>> >> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
>> >
>> > That's what the cast was for, with what gcc version did that stop
>> > working?
>>
>> I just realized that I should send a v2 (not the whole series just this one)
>> correcting the commit message, since there wasn't a warning to fix
>> in first place.
>>
>> I'll do this soon.
>
> If there's no warning then the point of the patch eludes me. There's
> nothing wrong with consistency, but attempting to fix that which isn't
> broken in the name of consistency borders a bit too closely on pointless
> busy work for my liking.
If you feel like that, then it's perfectly fine with me.
As I already told you, I was going to propagate your magical define to
the rest of arches,
but the inline looked a bit more readable.
Sorry for the noise and thanks for your time.
Regards,
Ezequiel.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-06-11 16:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-09 8:13 =?UTF-8?q?=5BPATCH=201/6=5D=20sh=3A=20fix=20compiler=20warning=20by=20properly=20inlining=20flat=5Fs Ezequiel Garcia
2012-06-09 9:14 ` [PATCH 1/6] sh: fix compiler warning by properly inlining flat_set_persistent() Paul Mundt
2012-06-09 12:01 ` Ezequiel Garcia
2012-06-10 21:33 ` Ezequiel Garcia
2012-06-11 3:50 ` Paul Mundt
2012-06-11 16:29 ` Ezequiel Garcia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox