Skip to content

Commit 475c3f5

Browse files
rddunlapRich Felker
authored andcommitted
sh: fix READ/WRITE redefinition warnings
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: 4b56568 ("sh: math-emu support") Signed-off-by: Randy Dunlap <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: Takashi YOSHII <[email protected]> Cc: John Paul Adrian Glaubitz <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Rich Felker <[email protected]>
1 parent b929926 commit 475c3f5

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

arch/sh/math-emu/math.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
#define Rn (regs->regs[n])
5252
#define Rm (regs->regs[m])
5353

54-
#define WRITE(d,a) ({if(put_user(d, (typeof (d) __user *)a)) return -EFAULT;})
55-
#define READ(d,a) ({if(get_user(d, (typeof (d) __user *)a)) return -EFAULT;})
54+
#define MWRITE(d,a) ({if(put_user(d, (typeof (d) __user *)a)) return -EFAULT;})
55+
#define MREAD(d,a) ({if(get_user(d, (typeof (d) __user *)a)) return -EFAULT;})
5656

5757
#define PACK_S(r,f) FP_PACK_SP(&r,f)
5858
#define UNPACK_S(f,r) FP_UNPACK_SP(f,&r)
@@ -157,11 +157,11 @@ fmov_idx_reg(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m,
157157
{
158158
if (FPSCR_SZ) {
159159
FMOV_EXT(n);
160-
READ(FRn, Rm + R0 + 4);
160+
MREAD(FRn, Rm + R0 + 4);
161161
n++;
162-
READ(FRn, Rm + R0);
162+
MREAD(FRn, Rm + R0);
163163
} else {
164-
READ(FRn, Rm + R0);
164+
MREAD(FRn, Rm + R0);
165165
}
166166

167167
return 0;
@@ -173,11 +173,11 @@ fmov_mem_reg(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m,
173173
{
174174
if (FPSCR_SZ) {
175175
FMOV_EXT(n);
176-
READ(FRn, Rm + 4);
176+
MREAD(FRn, Rm + 4);
177177
n++;
178-
READ(FRn, Rm);
178+
MREAD(FRn, Rm);
179179
} else {
180-
READ(FRn, Rm);
180+
MREAD(FRn, Rm);
181181
}
182182

183183
return 0;
@@ -189,12 +189,12 @@ fmov_inc_reg(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m,
189189
{
190190
if (FPSCR_SZ) {
191191
FMOV_EXT(n);
192-
READ(FRn, Rm + 4);
192+
MREAD(FRn, Rm + 4);
193193
n++;
194-
READ(FRn, Rm);
194+
MREAD(FRn, Rm);
195195
Rm += 8;
196196
} else {
197-
READ(FRn, Rm);
197+
MREAD(FRn, Rm);
198198
Rm += 4;
199199
}
200200

@@ -207,11 +207,11 @@ fmov_reg_idx(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m,
207207
{
208208
if (FPSCR_SZ) {
209209
FMOV_EXT(m);
210-
WRITE(FRm, Rn + R0 + 4);
210+
MWRITE(FRm, Rn + R0 + 4);
211211
m++;
212-
WRITE(FRm, Rn + R0);
212+
MWRITE(FRm, Rn + R0);
213213
} else {
214-
WRITE(FRm, Rn + R0);
214+
MWRITE(FRm, Rn + R0);
215215
}
216216

217217
return 0;
@@ -223,11 +223,11 @@ fmov_reg_mem(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m,
223223
{
224224
if (FPSCR_SZ) {
225225
FMOV_EXT(m);
226-
WRITE(FRm, Rn + 4);
226+
MWRITE(FRm, Rn + 4);
227227
m++;
228-
WRITE(FRm, Rn);
228+
MWRITE(FRm, Rn);
229229
} else {
230-
WRITE(FRm, Rn);
230+
MWRITE(FRm, Rn);
231231
}
232232

233233
return 0;
@@ -240,12 +240,12 @@ fmov_reg_dec(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m,
240240
if (FPSCR_SZ) {
241241
FMOV_EXT(m);
242242
Rn -= 8;
243-
WRITE(FRm, Rn + 4);
243+
MWRITE(FRm, Rn + 4);
244244
m++;
245-
WRITE(FRm, Rn);
245+
MWRITE(FRm, Rn);
246246
} else {
247247
Rn -= 4;
248-
WRITE(FRm, Rn);
248+
MWRITE(FRm, Rn);
249249
}
250250

251251
return 0;
@@ -445,11 +445,11 @@ id_sys(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, u16 code)
445445
case 0x4052:
446446
case 0x4062:
447447
Rn -= 4;
448-
WRITE(*reg, Rn);
448+
MWRITE(*reg, Rn);
449449
break;
450450
case 0x4056:
451451
case 0x4066:
452-
READ(*reg, Rn);
452+
MREAD(*reg, Rn);
453453
Rn += 4;
454454
break;
455455
default:

0 commit comments

Comments
 (0)