From: Randy Dunlap <rdunlap@infradead.org>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
linux-kernel@vger.kernel.org
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>,
Rich Felker <dalias@libc.org>,
linux-sh@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Subject: Re: [PATCH 3/3 v2] sh: fix READ/WRITE redefinition warnings
Date: Wed, 30 Jun 2021 12:33:23 -0700 [thread overview]
Message-ID: <8efd6e1d-9949-9598-9e6b-41d9b2f4ea7a@infradead.org> (raw)
In-Reply-To: <6af41806-e715-4084-418f-4a8924d26c07@physik.fu-berlin.de>
On 6/30/21 2:36 AM, John Paul Adrian Glaubitz wrote:
> On 6/28/21 12:05 AM, Randy Dunlap wrote:
>> kernel.h defines READ and WRITE, so rename the SH math-emu macros
>> to MREAD and MWRITE.
>>
>> Fixes these warnings:
>>
>> ../arch/sh/math-emu/math.c:54: warning: "WRITE" redefined
>> 54 | #define WRITE(d,a) ({if(put_user(d, (typeof (d) __user *)a)) return -EFAULT;})
>> In file included from ../arch/sh/math-emu/math.c:10:
>> ../include/linux/kernel.h:37: note: this is the location of the previous definition
>> 37 | #define WRITE 1
>> ../arch/sh/math-emu/math.c:55: warning: "READ" redefined
>> 55 | #define READ(d,a) ({if(get_user(d, (typeof (d) __user *)a)) return -EFAULT;})
>> In file included from ../arch/sh/math-emu/math.c:10:
>> ../include/linux/kernel.h:36: note: this is the location of the previous definition
>> 36 | #define READ 0
>>
>> Fixes: 4b565680d163 ("sh: math-emu support")
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
>> Cc: Rich Felker <dalias@libc.org>
>> Cc: linux-sh@vger.kernel.org
>> Cc: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
>> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
>> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
>> ---
>> v2: renumber patches, otherwise no change;
>>
>> arch/sh/math-emu/math.c | 44 +++++++++++++++++++-------------------
>> 1 file changed, 22 insertions(+), 22 deletions(-)
>>
>> --- linux-next-20210625.orig/arch/sh/math-emu/math.c
>> +++ linux-next-20210625/arch/sh/math-emu/math.c
>> @@ -51,8 +51,8 @@
>> #define Rn (regs->regs[n])
>> #define Rm (regs->regs[m])
>>
>> -#define WRITE(d,a) ({if(put_user(d, (typeof (d) __user *)a)) return -EFAULT;})
>> -#define READ(d,a) ({if(get_user(d, (typeof (d) __user *)a)) return -EFAULT;})
>> +#define MWRITE(d,a) ({if(put_user(d, (typeof (d) __user *)a)) return -EFAULT;})
>> +#define MREAD(d,a) ({if(get_user(d, (typeof (d) __user *)a)) return -EFAULT;})
>>
>> #define PACK_S(r,f) FP_PACK_SP(&r,f)
>> #define UNPACK_S(f,r) FP_UNPACK_SP(f,&r)
>> @@ -157,11 +157,11 @@ fmov_idx_reg(struct sh_fpu_soft_struct *
>> {
>> if (FPSCR_SZ) {
>> FMOV_EXT(n);
>> - READ(FRn, Rm + R0 + 4);
>> + MREAD(FRn, Rm + R0 + 4);
>> n++;
>> - READ(FRn, Rm + R0);
>> + MREAD(FRn, Rm + R0);
>> } else {
>> - READ(FRn, Rm + R0);
>> + MREAD(FRn, Rm + R0);
>> }
>>
>> return 0;
>> @@ -173,11 +173,11 @@ fmov_mem_reg(struct sh_fpu_soft_struct *
>> {
>> if (FPSCR_SZ) {
>> FMOV_EXT(n);
>> - READ(FRn, Rm + 4);
>> + MREAD(FRn, Rm + 4);
>> n++;
>> - READ(FRn, Rm);
>> + MREAD(FRn, Rm);
>> } else {
>> - READ(FRn, Rm);
>> + MREAD(FRn, Rm);
>> }
>>
>> return 0;
>> @@ -189,12 +189,12 @@ fmov_inc_reg(struct sh_fpu_soft_struct *
>> {
>> if (FPSCR_SZ) {
>> FMOV_EXT(n);
>> - READ(FRn, Rm + 4);
>> + MREAD(FRn, Rm + 4);
>> n++;
>> - READ(FRn, Rm);
>> + MREAD(FRn, Rm);
>> Rm += 8;
>> } else {
>> - READ(FRn, Rm);
>> + MREAD(FRn, Rm);
>> Rm += 4;
>> }
>>
>> @@ -207,11 +207,11 @@ fmov_reg_idx(struct sh_fpu_soft_struct *
>> {
>> if (FPSCR_SZ) {
>> FMOV_EXT(m);
>> - WRITE(FRm, Rn + R0 + 4);
>> + MWRITE(FRm, Rn + R0 + 4);
>> m++;
>> - WRITE(FRm, Rn + R0);
>> + MWRITE(FRm, Rn + R0);
>> } else {
>> - WRITE(FRm, Rn + R0);
>> + MWRITE(FRm, Rn + R0);
>> }
>>
>> return 0;
>> @@ -223,11 +223,11 @@ fmov_reg_mem(struct sh_fpu_soft_struct *
>> {
>> if (FPSCR_SZ) {
>> FMOV_EXT(m);
>> - WRITE(FRm, Rn + 4);
>> + MWRITE(FRm, Rn + 4);
>> m++;
>> - WRITE(FRm, Rn);
>> + MWRITE(FRm, Rn);
>> } else {
>> - WRITE(FRm, Rn);
>> + MWRITE(FRm, Rn);
>> }
>>
>> return 0;
>> @@ -240,12 +240,12 @@ fmov_reg_dec(struct sh_fpu_soft_struct *
>> if (FPSCR_SZ) {
>> FMOV_EXT(m);
>> Rn -= 8;
>> - WRITE(FRm, Rn + 4);
>> + MWRITE(FRm, Rn + 4);
>> m++;
>> - WRITE(FRm, Rn);
>> + MWRITE(FRm, Rn);
>> } else {
>> Rn -= 4;
>> - WRITE(FRm, Rn);
>> + MWRITE(FRm, Rn);
>> }
>>
>> return 0;
>> @@ -445,11 +445,11 @@ id_sys(struct sh_fpu_soft_struct *fregs,
>> case 0x4052:
>> case 0x4062:
>> Rn -= 4;
>> - WRITE(*reg, Rn);
>> + MWRITE(*reg, Rn);
>> break;
>> case 0x4056:
>> case 0x4066:
>> - READ(*reg, Rn);
>> + MREAD(*reg, Rn);
>> Rn += 4;
>> break;
>> default:
>>
>
> This one no longer applies to Linus' tree:
>
> glaubitz@node54:/data/home/glaubitz/linux> git am ../sh-patches-2021/\[PATCH\ 3_3\ v2\]\ sh\:\ fix\ READ_WRITE\ redefinition\ warnings.eml
> Applying: sh: fix READ/WRITE redefinition warnings
> error: patch failed: arch/sh/math-emu/math.c:51
> error: arch/sh/math-emu/math.c: patch does not apply
> Patch failed at 0001 sh: fix READ/WRITE redefinition warnings
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
> glaubitz@node54:/data/home/glaubitz/linux>
OK. Thanks for all of the testing.
--
~Randy
next prev parent reply other threads:[~2021-06-30 19:33 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-27 22:05 [PATCH 0/3 v2] sh: fixes for various build and kconfig warnings Randy Dunlap
2021-06-27 22:05 ` [PATCH 1/3 v2] sh: fix kconfig unmet dependency warning for FRAME_POINTER Randy Dunlap
2021-06-28 8:44 ` Geert Uytterhoeven
2021-06-30 9:32 ` John Paul Adrian Glaubitz
2021-06-27 22:05 ` [PATCH 2/3 v2] sh: define __BIG_ENDIAN for math-emu Randy Dunlap
2021-06-30 9:35 ` John Paul Adrian Glaubitz
2021-06-27 22:05 ` [PATCH 3/3 v2] sh: fix READ/WRITE redefinition warnings Randy Dunlap
2021-06-28 8:46 ` Geert Uytterhoeven
2021-06-30 9:36 ` John Paul Adrian Glaubitz
2021-06-30 9:42 ` Geert Uytterhoeven
2021-06-30 19:33 ` Randy Dunlap [this message]
2021-06-30 19:36 ` John Paul Adrian Glaubitz
2021-07-01 8:41 ` Geert Uytterhoeven
2021-07-01 11:57 ` Arnd Bergmann
2021-07-02 9:25 ` John Paul Adrian Glaubitz
2021-06-27 22:26 ` [PATCH 0/3 v2] sh: fixes for various build and kconfig warnings John Paul Adrian Glaubitz
2021-06-27 22:30 ` Randy Dunlap
2021-06-27 22:36 ` John Paul Adrian Glaubitz
2021-06-29 21:49 ` John Paul Adrian Glaubitz
2021-09-08 20:19 ` Randy Dunlap
2021-09-09 8:25 ` John Paul Adrian Glaubitz
2021-09-09 9:08 ` Daniel Palmer
2021-09-12 1:57 ` Rich Felker
2021-09-12 10:36 ` John Paul Adrian Glaubitz
2021-09-12 17:25 ` Rob Landley
2021-09-22 2:45 ` Rich Felker
2021-09-23 14:37 ` John Paul Adrian Glaubitz
2021-10-08 18:29 ` John Paul Adrian Glaubitz
2021-09-13 11:53 ` Daniel Palmer
2021-09-09 17:44 ` Rob Landley
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=8efd6e1d-9949-9598-9e6b-41d9b2f4ea7a@infradead.org \
--to=rdunlap@infradead.org \
--cc=dalias@libc.org \
--cc=geert+renesas@glider.be \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=takasi-y@ops.dti.ne.jp \
--cc=ysato@users.sourceforge.jp \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).