From 54b76dc9707a12b063bcb4a5d68bdaad2dc28514 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 17 Aug 2023 16:44:48 +0200 Subject: m68k: math-emu: Fix incorrect file reference in fp_log.c The file comment header refers to the wrong file. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/faf2244c3c80a4d70da5a18dd2a170a15b3ebd88.1692283195.git.geert@linux-m68k.org --- arch/m68k/math-emu/fp_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c index 0663067870f2..a8eac8c81757 100644 --- a/arch/m68k/math-emu/fp_log.c +++ b/arch/m68k/math-emu/fp_log.c @@ -1,6 +1,6 @@ /* - fp_trig.c: floating-point math routines for the Linux-m68k + fp_log.c: floating-point math routines for the Linux-m68k floating point emulator. Copyright (c) 1998-1999 David Huggins-Daines / Roman Zippel. -- cgit From 8893eb3de0ec14367466e29cfd8d962d1e615b75 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 17 Aug 2023 16:44:49 +0200 Subject: m68k: math-emu: Sanitize include guards Some include guards start with an underscore, others don't. Some comments do not match the actual include guard. Make them uniform, adhering to the "FP__H" format. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/8c84c8bf06c0c1e463c47f071891e2e83d5abdd2.1692283195.git.geert@linux-m68k.org --- arch/m68k/math-emu/fp_arith.h | 6 +++--- arch/m68k/math-emu/fp_trig.h | 6 +++--- arch/m68k/math-emu/multi_arith.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/m68k/math-emu/fp_arith.h b/arch/m68k/math-emu/fp_arith.h index 0fd3ed217f66..85bdd83b9dd6 100644 --- a/arch/m68k/math-emu/fp_arith.h +++ b/arch/m68k/math-emu/fp_arith.h @@ -12,8 +12,8 @@ */ -#ifndef FP_ARITH_H -#define FP_ARITH_H +#ifndef _FP_ARITH_H +#define _FP_ARITH_H /* easy ones */ struct fp_ext * @@ -47,4 +47,4 @@ fp_fintrz(struct fp_ext *dest, struct fp_ext *src); struct fp_ext * fp_fscale(struct fp_ext *dest, struct fp_ext *src); -#endif /* FP_ARITH__H */ +#endif /* _FP_ARITH_H */ diff --git a/arch/m68k/math-emu/fp_trig.h b/arch/m68k/math-emu/fp_trig.h index af8b247e9c98..52f0cc31cfe4 100644 --- a/arch/m68k/math-emu/fp_trig.h +++ b/arch/m68k/math-emu/fp_trig.h @@ -15,8 +15,8 @@ */ -#ifndef FP_TRIG_H -#define FP_TRIG_H +#ifndef _FP_TRIG_H +#define _FP_TRIG_H #include "fp_emu.h" @@ -29,4 +29,4 @@ they return a status code, which should end up in %d0, if all goes well. */ -#endif /* FP_TRIG__H */ +#endif /* _FP_TRIG_H */ diff --git a/arch/m68k/math-emu/multi_arith.h b/arch/m68k/math-emu/multi_arith.h index 232f58fe3483..ed2434fcfb1e 100644 --- a/arch/m68k/math-emu/multi_arith.h +++ b/arch/m68k/math-emu/multi_arith.h @@ -15,8 +15,8 @@ implement the subset of integer arithmetic that we need in order to multiply, divide, and normalize 128-bit unsigned mantissae. */ -#ifndef MULTI_ARITH_H -#define MULTI_ARITH_H +#ifndef _MULTI_ARITH_H +#define _MULTI_ARITH_H static inline void fp_denormalize(struct fp_ext *reg, unsigned int cnt) { @@ -285,4 +285,4 @@ static inline void fp_putmant128(struct fp_ext *dest, union fp_mant128 *src, } } -#endif /* MULTI_ARITH_H */ +#endif /* _MULTI_ARITH_H */ -- cgit From 7e67c75d405b5a3b66ce0af267320ed60e319dd0 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 17 Aug 2023 16:44:50 +0200 Subject: m68k: math-emu: Make multi_arith.h self-contained Add the missing #include "fp_emu.h". Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/2efd6610e97dd1621e7d28bf87cb79173285545d.1692283195.git.geert@linux-m68k.org --- arch/m68k/math-emu/multi_arith.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/m68k/math-emu/multi_arith.h b/arch/m68k/math-emu/multi_arith.h index ed2434fcfb1e..f7d9e49fe259 100644 --- a/arch/m68k/math-emu/multi_arith.h +++ b/arch/m68k/math-emu/multi_arith.h @@ -18,6 +18,8 @@ #ifndef _MULTI_ARITH_H #define _MULTI_ARITH_H +#include "fp_emu.h" + static inline void fp_denormalize(struct fp_ext *reg, unsigned int cnt) { reg->exp += cnt; -- cgit From 11dd57cc15fd4f42b797357017a1119a49449f97 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 17 Aug 2023 16:44:51 +0200 Subject: m68k: math-emu: Replace external declarations by header inclusion Replace the (incorrect) external declarations by an inclusion of the appropriate header file. Semantically, the "src" parameters of the various fp_*() functions are constant. However, they cannot actually be const as most of these functions perform a normalization step first. As the fp_one constant passed to fp_add() is already normalized, it is safe to cast away its constness when making the function call. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/163bc2f64b5a3dd7b96a12aaca6733b408ddc880.1692283195.git.geert@linux-m68k.org --- arch/m68k/math-emu/fp_log.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c index a8eac8c81757..2426634c4ba7 100644 --- a/arch/m68k/math-emu/fp_log.c +++ b/arch/m68k/math-emu/fp_log.c @@ -15,6 +15,7 @@ */ +#include "fp_arith.h" #include "fp_emu.h" static const struct fp_ext fp_one = @@ -22,9 +23,6 @@ static const struct fp_ext fp_one = .exp = 0x3fff, }; -extern struct fp_ext *fp_fadd(struct fp_ext *dest, const struct fp_ext *src); -extern struct fp_ext *fp_fdiv(struct fp_ext *dest, const struct fp_ext *src); - struct fp_ext * fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) { @@ -70,7 +68,8 @@ fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) * sqrt(x) = 1 + 1/2*(x-1) * = 1/2*(1+x) */ - fp_fadd(dest, &fp_one); + /* It is safe to cast away the constness, as fp_one is normalized */ + fp_fadd(dest, (struct fp_ext *)&fp_one); dest->exp--; /* * 1/2 */ /* -- cgit From 648c37ec0299fca3a0062f7b2f374cc5d1e2f109 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 17 Aug 2023 16:44:52 +0200 Subject: m68k: math-emu: Reformat function and variable headers Make the code shorter and easier to read. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/11506b9225e281f2453a83a02ac4793d0e58b609.1692283195.git.geert@linux-m68k.org --- arch/m68k/math-emu/fp_arith.c | 49 ++++++++++++++------------------------- arch/m68k/math-emu/fp_arith.h | 39 +++++++++++-------------------- arch/m68k/math-emu/fp_log.c | 36 ++++++++++------------------- arch/m68k/math-emu/fp_trig.c | 54 +++++++++++++++---------------------------- 4 files changed, 60 insertions(+), 118 deletions(-) diff --git a/arch/m68k/math-emu/fp_arith.c b/arch/m68k/math-emu/fp_arith.c index f4a06492cd7a..799c450fe322 100644 --- a/arch/m68k/math-emu/fp_arith.c +++ b/arch/m68k/math-emu/fp_arith.c @@ -28,8 +28,7 @@ const struct fp_ext fp_Inf = /* let's start with the easy ones */ -struct fp_ext * -fp_fabs(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fabs(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fabs\n"); @@ -40,8 +39,7 @@ fp_fabs(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fneg(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fneg(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fneg\n"); @@ -57,8 +55,7 @@ fp_fneg(struct fp_ext *dest, struct fp_ext *src) /* fp_fadd: Implements the kernel of the FADD, FSADD, FDADD, FSUB, FDSUB, and FCMP instructions. */ -struct fp_ext * -fp_fadd(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fadd(struct fp_ext *dest, struct fp_ext *src) { int diff; @@ -117,8 +114,7 @@ fp_fadd(struct fp_ext *dest, struct fp_ext *src) Remember that the arguments are in assembler-syntax order! */ -struct fp_ext * -fp_fsub(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsub(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fsub "); @@ -127,8 +123,7 @@ fp_fsub(struct fp_ext *dest, struct fp_ext *src) } -struct fp_ext * -fp_fcmp(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fcmp(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fcmp "); @@ -137,8 +132,7 @@ fp_fcmp(struct fp_ext *dest, struct fp_ext *src) return fp_fadd(&FPDATA->temp[1], src); } -struct fp_ext * -fp_ftst(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftst(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "ftst\n"); @@ -147,8 +141,7 @@ fp_ftst(struct fp_ext *dest, struct fp_ext *src) return src; } -struct fp_ext * -fp_fmul(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fmul(struct fp_ext *dest, struct fp_ext *src) { union fp_mant128 temp; int exp; @@ -225,8 +218,7 @@ fp_fmul(struct fp_ext *dest, struct fp_ext *src) Note that the order of the operands is counter-intuitive: instead of src / dest, the result is actually dest / src. */ -struct fp_ext * -fp_fdiv(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fdiv(struct fp_ext *dest, struct fp_ext *src) { union fp_mant128 temp; int exp; @@ -306,8 +298,7 @@ fp_fdiv(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fsglmul(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsglmul(struct fp_ext *dest, struct fp_ext *src) { int exp; @@ -363,8 +354,7 @@ fp_fsglmul(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fsgldiv(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsgldiv(struct fp_ext *dest, struct fp_ext *src) { int exp; unsigned long quot, rem; @@ -573,8 +563,8 @@ static void fp_roundint(struct fp_ext *dest, int mode) (which are exactly the same, except for the rounding used on the intermediate value) */ -static struct fp_ext * -modrem_kernel(struct fp_ext *dest, struct fp_ext *src, int mode) +static struct fp_ext *modrem_kernel(struct fp_ext *dest, struct fp_ext *src, + int mode) { struct fp_ext tmp; @@ -607,8 +597,7 @@ modrem_kernel(struct fp_ext *dest, struct fp_ext *src, int mode) fmod(src,dest) = (dest - (src * floor(dest / src))) */ -struct fp_ext * -fp_fmod(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fmod(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fmod\n"); return modrem_kernel(dest, src, FPCR_ROUND_RZ); @@ -619,15 +608,13 @@ fp_fmod(struct fp_ext *dest, struct fp_ext *src) frem(src,dest) = (dest - (src * round(dest / src))) */ -struct fp_ext * -fp_frem(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_frem(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "frem\n"); return modrem_kernel(dest, src, FPCR_ROUND_RN); } -struct fp_ext * -fp_fint(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fint(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fint\n"); @@ -638,8 +625,7 @@ fp_fint(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fintrz(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fintrz(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fintrz\n"); @@ -650,8 +636,7 @@ fp_fintrz(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fscale(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fscale(struct fp_ext *dest, struct fp_ext *src) { int scale, oldround; diff --git a/arch/m68k/math-emu/fp_arith.h b/arch/m68k/math-emu/fp_arith.h index 85bdd83b9dd6..65b11e3f452d 100644 --- a/arch/m68k/math-emu/fp_arith.h +++ b/arch/m68k/math-emu/fp_arith.h @@ -16,35 +16,22 @@ #define _FP_ARITH_H /* easy ones */ -struct fp_ext * -fp_fabs(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fneg(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fabs(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fneg(struct fp_ext *dest, struct fp_ext *src); /* straightforward arithmetic */ -struct fp_ext * -fp_fadd(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fsub(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fcmp(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_ftst(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fmul(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fdiv(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fadd(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsub(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fcmp(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftst(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fmul(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fdiv(struct fp_ext *dest, struct fp_ext *src); /* ones that do rounding and integer conversions */ -struct fp_ext * -fp_fmod(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_frem(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fint(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fintrz(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fscale(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fmod(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_frem(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fint(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fintrz(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fscale(struct fp_ext *dest, struct fp_ext *src); #endif /* _FP_ARITH_H */ diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c index 2426634c4ba7..9f93efd5ef49 100644 --- a/arch/m68k/math-emu/fp_log.c +++ b/arch/m68k/math-emu/fp_log.c @@ -18,13 +18,11 @@ #include "fp_arith.h" #include "fp_emu.h" -static const struct fp_ext fp_one = -{ +static const struct fp_ext fp_one = { .exp = 0x3fff, }; -struct fp_ext * -fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) { struct fp_ext tmp, src2; int i, exp; @@ -97,8 +95,7 @@ fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fetoxm1(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fetoxm1(struct fp_ext *dest, struct fp_ext *src) { uprint("fetoxm1\n"); @@ -107,8 +104,7 @@ fp_fetoxm1(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fetox(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fetox(struct fp_ext *dest, struct fp_ext *src) { uprint("fetox\n"); @@ -117,8 +113,7 @@ fp_fetox(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_ftwotox(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftwotox(struct fp_ext *dest, struct fp_ext *src) { uprint("ftwotox\n"); @@ -127,8 +122,7 @@ fp_ftwotox(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_ftentox(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftentox(struct fp_ext *dest, struct fp_ext *src) { uprint("ftentox\n"); @@ -137,8 +131,7 @@ fp_ftentox(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_flogn(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_flogn(struct fp_ext *dest, struct fp_ext *src) { uprint("flogn\n"); @@ -147,8 +140,7 @@ fp_flogn(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_flognp1(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_flognp1(struct fp_ext *dest, struct fp_ext *src) { uprint("flognp1\n"); @@ -157,8 +149,7 @@ fp_flognp1(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_flog10(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_flog10(struct fp_ext *dest, struct fp_ext *src) { uprint("flog10\n"); @@ -167,8 +158,7 @@ fp_flog10(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_flog2(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_flog2(struct fp_ext *dest, struct fp_ext *src) { uprint("flog2\n"); @@ -177,8 +167,7 @@ fp_flog2(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fgetexp(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fgetexp(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fgetexp\n"); @@ -198,8 +187,7 @@ fp_fgetexp(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fgetman(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fgetman(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fgetman\n"); diff --git a/arch/m68k/math-emu/fp_trig.c b/arch/m68k/math-emu/fp_trig.c index 6361d0784df2..5f49de373753 100644 --- a/arch/m68k/math-emu/fp_trig.c +++ b/arch/m68k/math-emu/fp_trig.c @@ -18,8 +18,7 @@ #include "fp_emu.h" #include "fp_trig.h" -struct fp_ext * -fp_fsin(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsin(struct fp_ext *dest, struct fp_ext *src) { uprint("fsin\n"); @@ -28,8 +27,7 @@ fp_fsin(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fcos(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fcos(struct fp_ext *dest, struct fp_ext *src) { uprint("fcos\n"); @@ -38,8 +36,7 @@ fp_fcos(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_ftan(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftan(struct fp_ext *dest, struct fp_ext *src) { uprint("ftan\n"); @@ -48,8 +45,7 @@ fp_ftan(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fasin(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fasin(struct fp_ext *dest, struct fp_ext *src) { uprint("fasin\n"); @@ -58,8 +54,7 @@ fp_fasin(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_facos(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_facos(struct fp_ext *dest, struct fp_ext *src) { uprint("facos\n"); @@ -68,8 +63,7 @@ fp_facos(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fatan(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fatan(struct fp_ext *dest, struct fp_ext *src) { uprint("fatan\n"); @@ -78,8 +72,7 @@ fp_fatan(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fsinh(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsinh(struct fp_ext *dest, struct fp_ext *src) { uprint("fsinh\n"); @@ -88,8 +81,7 @@ fp_fsinh(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fcosh(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fcosh(struct fp_ext *dest, struct fp_ext *src) { uprint("fcosh\n"); @@ -98,8 +90,7 @@ fp_fcosh(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_ftanh(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftanh(struct fp_ext *dest, struct fp_ext *src) { uprint("ftanh\n"); @@ -108,8 +99,7 @@ fp_ftanh(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fatanh(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fatanh(struct fp_ext *dest, struct fp_ext *src) { uprint("fatanh\n"); @@ -118,64 +108,56 @@ fp_fatanh(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fsincos0(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos0(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos0\n"); return dest; } -struct fp_ext * -fp_fsincos1(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos1(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos1\n"); return dest; } -struct fp_ext * -fp_fsincos2(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos2(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos2\n"); return dest; } -struct fp_ext * -fp_fsincos3(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos3(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos3\n"); return dest; } -struct fp_ext * -fp_fsincos4(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos4(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos4\n"); return dest; } -struct fp_ext * -fp_fsincos5(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos5(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos5\n"); return dest; } -struct fp_ext * -fp_fsincos6(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos6(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos6\n"); return dest; } -struct fp_ext * -fp_fsincos7(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos7(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos7\n"); -- cgit From 1fee121f8f2ade1ef2937f1b7d7b08775086fba9 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 17 Aug 2023 16:44:53 +0200 Subject: m68k: math-emu: Add missing prototypes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/math-emu/fp_arith.c:301:16: warning: no previous prototype for ‘fp_fsglmul’ [-Wmissing-prototypes] 301 | struct fp_ext *fp_fsglmul(struct fp_ext *dest, struct fp_ext *src) | ^~~~~~~~~~ arch/m68k/math-emu/fp_arith.c:357:16: warning: no previous prototype for ‘fp_fsgldiv’ [-Wmissing-prototypes] 357 | struct fp_ext *fp_fsgldiv(struct fp_ext *dest, struct fp_ext *src) | ^~~~~~~~~~ CC arch/m68k/math-emu/fp_log.o ... Fix this by adding the missing prototypes to header files. Reported-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230810141947.1236730-17-arnd@kernel.org/ Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/96c039640d76973ea762d79018de0bc75bbdc1dc.1692283195.git.geert@linux-m68k.org --- arch/m68k/math-emu/fp_arith.h | 2 ++ arch/m68k/math-emu/fp_log.c | 1 + arch/m68k/math-emu/fp_log.h | 44 +++++++++++++++++++++++++++++++++++++++++++ arch/m68k/math-emu/fp_trig.h | 19 +++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 arch/m68k/math-emu/fp_log.h diff --git a/arch/m68k/math-emu/fp_arith.h b/arch/m68k/math-emu/fp_arith.h index 65b11e3f452d..3f9c58b6d504 100644 --- a/arch/m68k/math-emu/fp_arith.h +++ b/arch/m68k/math-emu/fp_arith.h @@ -26,6 +26,8 @@ struct fp_ext *fp_fcmp(struct fp_ext *dest, struct fp_ext *src); struct fp_ext *fp_ftst(struct fp_ext *dest, struct fp_ext *src); struct fp_ext *fp_fmul(struct fp_ext *dest, struct fp_ext *src); struct fp_ext *fp_fdiv(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsglmul(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsgldiv(struct fp_ext *dest, struct fp_ext *src); /* ones that do rounding and integer conversions */ struct fp_ext *fp_fmod(struct fp_ext *dest, struct fp_ext *src); diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c index 9f93efd5ef49..71a8fc25575a 100644 --- a/arch/m68k/math-emu/fp_log.c +++ b/arch/m68k/math-emu/fp_log.c @@ -17,6 +17,7 @@ #include "fp_arith.h" #include "fp_emu.h" +#include "fp_log.h" static const struct fp_ext fp_one = { .exp = 0x3fff, diff --git a/arch/m68k/math-emu/fp_log.h b/arch/m68k/math-emu/fp_log.h new file mode 100644 index 000000000000..c2bcfff11994 --- /dev/null +++ b/arch/m68k/math-emu/fp_log.h @@ -0,0 +1,44 @@ +/* + + fp_log.h: floating-point math routines for the Linux-m68k + floating point emulator. + + Copyright (c) 1998-1999 David Huggins-Daines / Roman Zippel. + + I hereby give permission, free of charge, to copy, modify, and + redistribute this software, in source or binary form, provided that + the above copyright notice and the following disclaimer are included + in all such copies. + + THIS SOFTWARE IS PROVIDED "AS IS", WITH ABSOLUTELY NO WARRANTY, REAL + OR IMPLIED. + +*/ + +#ifndef _FP_LOG_H +#define _FP_LOG_H + +#include "fp_emu.h" + +/* floating point logarithmic instructions: + + the arguments to these are in the "internal" extended format, that + is, an "exploded" version of the 96-bit extended fp format used by + the 68881. + + they return a status code, which should end up in %d0, if all goes + well. */ + +struct fp_ext *fp_fsqrt(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fetoxm1(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fetox(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftwotox(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftentox(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_flogn(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_flognp1(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_flog10(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_flog2(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fgetexp(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fgetman(struct fp_ext *dest, struct fp_ext *src); + +#endif /* _FP_LOG_H */ diff --git a/arch/m68k/math-emu/fp_trig.h b/arch/m68k/math-emu/fp_trig.h index 52f0cc31cfe4..1aae8ab1d41b 100644 --- a/arch/m68k/math-emu/fp_trig.h +++ b/arch/m68k/math-emu/fp_trig.h @@ -29,4 +29,23 @@ they return a status code, which should end up in %d0, if all goes well. */ +struct fp_ext *fp_fsin(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fcos(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftan(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fasin(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_facos(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fatan(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsinh(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fcosh(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftanh(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fatanh(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos0(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos1(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos2(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos3(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos4(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos5(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos6(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos7(struct fp_ext *dest, struct fp_ext *src); + #endif /* _FP_TRIG_H */ -- cgit From b149353da471ddfc5d6e698784cf22bc55bff68b Mon Sep 17 00:00:00 2001 From: Azeem Shaikh Date: Wed, 30 Aug 2023 18:54:28 +0000 Subject: m68k: emu: Replace strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct replacement is safe here since return value of -errno is used to check for truncation instead of sizeof(dest). [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230830185428.4109426-1-azeemshaikh38@gmail.com Signed-off-by: Geert Uytterhoeven --- arch/m68k/emu/natfeat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/m68k/emu/natfeat.c b/arch/m68k/emu/natfeat.c index b19dc00026d9..d124c62022c2 100644 --- a/arch/m68k/emu/natfeat.c +++ b/arch/m68k/emu/natfeat.c @@ -42,10 +42,10 @@ long nf_get_id(const char *feature_name) { /* feature_name may be in vmalloc()ed memory, so make a copy */ char name_copy[32]; - size_t n; + ssize_t n; - n = strlcpy(name_copy, feature_name, sizeof(name_copy)); - if (n >= sizeof(name_copy)) + n = strscpy(name_copy, feature_name, sizeof(name_copy)); + if (n < 0) return 0; return nf_get_id_phys(virt_to_phys(name_copy)); -- cgit From a0938a8e2fb3de5f7d570f3f283e79d4a23b6fe5 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Wed, 13 Sep 2023 17:13:50 +1000 Subject: m68k: Use kernel's generic libgcc functions The arch/m68k/lib versions of the libgcc functions: ashldi3, ashrdi3 and lshrdi3 were taken directly from an older version of gcc. We can use the kernel's own generic lib versions of these - they are virtually identical. Switch to those and remove the m68k local ones. Signed-off-by: Greg Ungerer Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230913071350.1939818-1-gerg@kernel.org Signed-off-by: Geert Uytterhoeven --- arch/m68k/Kconfig | 3 +++ arch/m68k/lib/Makefile | 3 +-- arch/m68k/lib/ashldi3.c | 61 ------------------------------------------------ arch/m68k/lib/ashrdi3.c | 62 ------------------------------------------------- arch/m68k/lib/lshrdi3.c | 61 ------------------------------------------------ 5 files changed, 4 insertions(+), 186 deletions(-) delete mode 100644 arch/m68k/lib/ashldi3.c delete mode 100644 arch/m68k/lib/ashrdi3.c delete mode 100644 arch/m68k/lib/lshrdi3.c diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 3e318bf9504c..3e96486d9528 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -19,6 +19,9 @@ config M68K select GENERIC_CPU_DEVICES select GENERIC_IOMAP select GENERIC_IRQ_SHOW + select GENERIC_LIB_ASHLDI3 + select GENERIC_LIB_ASHRDI3 + select GENERIC_LIB_LSHRDI3 select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA select HAVE_ARCH_SECCOMP select HAVE_ARCH_SECCOMP_FILTER diff --git a/arch/m68k/lib/Makefile b/arch/m68k/lib/Makefile index eca17f14b4d5..9158688e6cc6 100644 --- a/arch/m68k/lib/Makefile +++ b/arch/m68k/lib/Makefile @@ -4,8 +4,7 @@ # Makefile for m68k-specific library files.. # -lib-y := ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ - memcpy.o memset.o memmove.o +lib-y := muldi3.o memcpy.o memset.o memmove.o lib-$(CONFIG_MMU) += uaccess.o lib-$(CONFIG_CPU_HAS_NO_MULDIV64) += mulsi3.o divsi3.o udivsi3.o diff --git a/arch/m68k/lib/ashldi3.c b/arch/m68k/lib/ashldi3.c deleted file mode 100644 index ac08f8141390..000000000000 --- a/arch/m68k/lib/ashldi3.c +++ /dev/null @@ -1,61 +0,0 @@ -/* ashrdi3.c extracted from gcc-2.95.2/libgcc2.c which is: */ -/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. */ - -#include -#include - -#define BITS_PER_UNIT 8 - -typedef int SItype __mode(SI); -typedef unsigned int USItype __mode(SI); -typedef int DItype __mode(DI); -typedef int word_type __mode(__word__); - -struct DIstruct {SItype high, low;}; - -typedef union -{ - struct DIstruct s; - DItype ll; -} DIunion; - -DItype -__ashldi3 (DItype u, word_type b) -{ - DIunion w; - word_type bm; - DIunion uu; - - if (b == 0) - return u; - - uu.ll = u; - - bm = (sizeof (SItype) * BITS_PER_UNIT) - b; - if (bm <= 0) - { - w.s.low = 0; - w.s.high = (USItype)uu.s.low << -bm; - } - else - { - USItype carries = (USItype)uu.s.low >> bm; - w.s.low = (USItype)uu.s.low << b; - w.s.high = ((USItype)uu.s.high << b) | carries; - } - - return w.ll; -} -EXPORT_SYMBOL(__ashldi3); diff --git a/arch/m68k/lib/ashrdi3.c b/arch/m68k/lib/ashrdi3.c deleted file mode 100644 index 5837b1dd3334..000000000000 --- a/arch/m68k/lib/ashrdi3.c +++ /dev/null @@ -1,62 +0,0 @@ -/* ashrdi3.c extracted from gcc-2.7.2/libgcc2.c which is: */ -/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. */ - -#include -#include - -#define BITS_PER_UNIT 8 - -typedef int SItype __mode(SI); -typedef unsigned int USItype __mode(SI); -typedef int DItype __mode(DI); -typedef int word_type __mode(__word__); - -struct DIstruct {SItype high, low;}; - -typedef union -{ - struct DIstruct s; - DItype ll; -} DIunion; - -DItype -__ashrdi3 (DItype u, word_type b) -{ - DIunion w; - word_type bm; - DIunion uu; - - if (b == 0) - return u; - - uu.ll = u; - - bm = (sizeof (SItype) * BITS_PER_UNIT) - b; - if (bm <= 0) - { - /* w.s.high = 1..1 or 0..0 */ - w.s.high = uu.s.high >> (sizeof (SItype) * BITS_PER_UNIT - 1); - w.s.low = uu.s.high >> -bm; - } - else - { - USItype carries = (USItype)uu.s.high << bm; - w.s.high = uu.s.high >> b; - w.s.low = ((USItype)uu.s.low >> b) | carries; - } - - return w.ll; -} -EXPORT_SYMBOL(__ashrdi3); diff --git a/arch/m68k/lib/lshrdi3.c b/arch/m68k/lib/lshrdi3.c deleted file mode 100644 index 7f40566be6c8..000000000000 --- a/arch/m68k/lib/lshrdi3.c +++ /dev/null @@ -1,61 +0,0 @@ -/* lshrdi3.c extracted from gcc-2.7.2/libgcc2.c which is: */ -/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. */ - -#include -#include - -#define BITS_PER_UNIT 8 - -typedef int SItype __mode(SI); -typedef unsigned int USItype __mode(SI); -typedef int DItype __mode(DI); -typedef int word_type __mode(__word__); - -struct DIstruct {SItype high, low;}; - -typedef union -{ - struct DIstruct s; - DItype ll; -} DIunion; - -DItype -__lshrdi3 (DItype u, word_type b) -{ - DIunion w; - word_type bm; - DIunion uu; - - if (b == 0) - return u; - - uu.ll = u; - - bm = (sizeof (SItype) * BITS_PER_UNIT) - b; - if (bm <= 0) - { - w.s.high = 0; - w.s.low = (USItype)uu.s.high >> -bm; - } - else - { - USItype carries = (USItype)uu.s.high << bm; - w.s.high = (USItype)uu.s.high >> b; - w.s.low = ((USItype)uu.s.low >> b) | carries; - } - - return w.ll; -} -EXPORT_SYMBOL(__lshrdi3); -- cgit From 7b9f6ca7d43665d8f05174e724e77bc183401613 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:07:51 +0200 Subject: m68k: kernel: Add missing asmlinkage to do_notify_resume() do_notify_resume() is called from assembly code, so it should be marked asmlinkage for documentation purposes. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/e24d63ec4332316e859125caa8d07c0589603cfd.1694613528.git.geert@linux-m68k.org --- arch/m68k/kernel/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index ba468b5f3f0b..459c5ff69fcf 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c @@ -1109,7 +1109,7 @@ static void do_signal(struct pt_regs *regs) restore_saved_sigmask(); } -void do_notify_resume(struct pt_regs *regs) +asmlinkage void do_notify_resume(struct pt_regs *regs) { if (test_thread_flag(TIF_NOTIFY_SIGNAL) || test_thread_flag(TIF_SIGPENDING)) -- cgit From e34b4acdf6488fbcdf890e72ecf925650c944503 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:07:52 +0200 Subject: m68k: kernel: Include for trap_init() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/kernel/vectors.c:74:13: warning: no previous prototype for ‘trap_init’ [-Wmissing-prototypes] 74 | void __init trap_init (void) | ^~~~~~~~~ Fix this by including . Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/42e7055fab50deda1f7cd648982e90b7ab28fdc3.1694613528.git.geert@linux-m68k.org --- arch/m68k/kernel/vectors.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/m68k/kernel/vectors.c b/arch/m68k/kernel/vectors.c index 322c977bb9ec..68762fc1dc97 100644 --- a/arch/m68k/kernel/vectors.c +++ b/arch/m68k/kernel/vectors.c @@ -17,6 +17,7 @@ /* * Sets up all exception vectors */ +#include #include #include #include -- cgit From e036678a4b8f2bcb362a2ca8adfd6a428321a38e Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:07:53 +0200 Subject: m68k: kernel: Make bad_super_trap() static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/kernel/traps.c:968:6: warning: no previous prototype for ‘bad_super_trap’ [-Wmissing-prototypes] 968 | void bad_super_trap (struct frame *fp) | ^~~~~~~~~~~~~~ Fix this by making bad_super_trap() static. There was never a user outside arch/m68k/kernel/traps.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/1e0b67a355d7e1bcb40811eced41d3080e8f4d20.1694613528.git.geert@linux-m68k.org --- arch/m68k/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index a700807c9b6d..b3fee39f8f51 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c @@ -965,7 +965,7 @@ void show_stack(struct task_struct *task, unsigned long *stack, * real 68k parts, but it won't hurt either. */ -void bad_super_trap (struct frame *fp) +static void bad_super_trap(struct frame *fp) { int vector = (fp->ptregs.vector >> 2) & 0xff; -- cgit From 0891c4740c22e8408bece7ff266791a523061041 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:07:54 +0200 Subject: m68k: kernel: Add and use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/kernel/sys_m68k.c:40:17: warning: no previous prototype for ‘sys_mmap2’ [-Wmissing-prototypes] 40 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ^~~~~~~~~ arch/m68k/kernel/sys_m68k.c:378:1: warning: no previous prototype for ‘sys_cacheflush’ [-Wmissing-prototypes] 378 | sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len) | ^~~~~~~~~~~~~~ arch/m68k/kernel/sys_m68k.c:463:1: warning: no previous prototype for ‘sys_atomic_cmpxchg_32’ [-Wmissing-prototypes] 463 | sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5, | ^~~~~~~~~~~~~~~~~~~~~ arch/m68k/kernel/sys_m68k.c:564:16: warning: no previous prototype for ‘sys_getpagesize’ [-Wmissing-prototypes] 564 | asmlinkage int sys_getpagesize(void) | ^~~~~~~~~~~~~~~ arch/m68k/kernel/sys_m68k.c:569:26: warning: no previous prototype for ‘sys_get_thread_area’ [-Wmissing-prototypes] 569 | asmlinkage unsigned long sys_get_thread_area(void) | ^~~~~~~~~~~~~~~~~~~ arch/m68k/kernel/sys_m68k.c:574:16: warning: no previous prototype for ‘sys_set_thread_area’ [-Wmissing-prototypes] 574 | asmlinkage int sys_set_thread_area(unsigned long tp) | ^~~~~~~~~~~~~~~~~~~ arch/m68k/kernel/sys_m68k.c:580:16: warning: no previous prototype for ‘sys_atomic_barrier’ [-Wmissing-prototypes] 580 | asmlinkage int sys_atomic_barrier(void) | ^~~~~~~~~~~~~~~~~~ Fix this by introducing a new header file for holding the prototypes for m68k-specific syscalls, and including the generic ones. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/80b721eeb499562cd5d49887b0eee10dd172c88d.1694613528.git.geert@linux-m68k.org --- arch/m68k/include/asm/syscalls.h | 19 +++++++++++++++++++ arch/m68k/kernel/sys_m68k.c | 1 + 2 files changed, 20 insertions(+) create mode 100644 arch/m68k/include/asm/syscalls.h diff --git a/arch/m68k/include/asm/syscalls.h b/arch/m68k/include/asm/syscalls.h new file mode 100644 index 000000000000..fb3639acd07b --- /dev/null +++ b/arch/m68k/include/asm/syscalls.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef _ASM_M68K_SYSCALLS_H +#define _ASM_M68K_SYSCALLS_H + +#include +#include + +asmlinkage int sys_cacheflush(unsigned long addr, int scope, int cache, + unsigned long len); +asmlinkage int sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, + int d4, int d5, unsigned long __user *mem); +asmlinkage int sys_getpagesize(void); +asmlinkage unsigned long sys_get_thread_area(void); +asmlinkage int sys_set_thread_area(unsigned long tp); +asmlinkage int sys_atomic_barrier(void); + +#include + +#endif /* _ASM_M68K_SYSCALLS_H */ diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index c586034d2a7a..14055d676161 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include -- cgit From ef69fb4dce17c1e19bef7ba1b34fa37115171fee Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:07:55 +0200 Subject: m68k: kernel: Add and use "ints.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/kernel/ints.c:165:17: warning: no previous prototype for ‘handle_badint’ [-Wmissing-prototypes] 165 | asmlinkage void handle_badint(struct pt_regs *regs) | ^~~~~~~~~~~~~ Fix this by introducing a new header file "ints.h" for holding the prototypes of functions implemented in arch/m68k/kernel/ints.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/dc65d01ca4c7de94ce814e5b5e1f726fff97566b.1694613528.git.geert@linux-m68k.org --- arch/m68k/kernel/ints.c | 2 ++ arch/m68k/kernel/ints.h | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 arch/m68k/kernel/ints.h diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c index 5b8d66fbf383..cf2b13488476 100644 --- a/arch/m68k/kernel/ints.c +++ b/arch/m68k/kernel/ints.c @@ -26,6 +26,8 @@ #include #endif +#include "ints.h" + extern u32 auto_irqhandler_fixup[]; extern u16 user_irqvec_fixup[]; diff --git a/arch/m68k/kernel/ints.h b/arch/m68k/kernel/ints.h new file mode 100644 index 000000000000..ecac6011c1a4 --- /dev/null +++ b/arch/m68k/kernel/ints.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +struct pt_regs; + +asmlinkage void handle_badint(struct pt_regs *regs); -- cgit From ab8151fc5e68f6208ee24fddbeb7daf5f6fe347d Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:07:56 +0200 Subject: m68k: kernel: Add and use "process.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/kernel/process.c:115:16: warning: no previous prototype for ‘m68k_clone’ [-Wmissing-prototypes] 115 | asmlinkage int m68k_clone(struct pt_regs *regs) | ^~~~~~~~~~ arch/m68k/kernel/process.c:136:16: warning: no previous prototype for ‘m68k_clone3’ [-Wmissing-prototypes] 136 | asmlinkage int m68k_clone3(struct pt_regs *regs) | ^~~~~~~~~~~ Fix this by introducing a new header file "process.h" for holding the prototypes of functions implemented in arch/m68k/kernel/process.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/5e50257d8fcae3eb202ce5f439dc29c09cb6c44f.1694613528.git.geert@linux-m68k.org --- arch/m68k/kernel/process.c | 1 + arch/m68k/kernel/process.h | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 arch/m68k/kernel/process.h diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index e06ce147c0b7..2584e94e2134 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c @@ -38,6 +38,7 @@ #include #include +#include "process.h" asmlinkage void ret_from_fork(void); asmlinkage void ret_from_kernel_thread(void); diff --git a/arch/m68k/kernel/process.h b/arch/m68k/kernel/process.h new file mode 100644 index 000000000000..d31745f2e64b --- /dev/null +++ b/arch/m68k/kernel/process.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#include + +struct pt_regs; + +asmlinkage int m68k_clone(struct pt_regs *regs); +asmlinkage int m68k_clone3(struct pt_regs *regs); -- cgit From 7afc185016087b5181500f0394bec1feb8bdade0 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:07:57 +0200 Subject: m68k: kernel: Add and use "ptrace.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/kernel/ptrace.c:275:16: warning: no previous prototype for ‘syscall_trace_enter’ [-Wmissing-prototypes] 275 | asmlinkage int syscall_trace_enter(void) | ^~~~~~~~~~~~~~~~~~~ arch/m68k/kernel/ptrace.c:288:17: warning: no previous prototype for ‘syscall_trace_leave’ [-Wmissing-prototypes] 288 | asmlinkage void syscall_trace_leave(void) | ^~~~~~~~~~~~~~~~~~~ Fix this by introducing a new header file "ptrace.h" for holding the prototypes of functions implemented in arch/m68k/kernel/ptrace.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/b4b3577b2149ebd65c3b3c7acccebc0e7e596f9d.1694613528.git.geert@linux-m68k.org --- arch/m68k/kernel/ptrace.c | 2 ++ arch/m68k/kernel/ptrace.h | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 arch/m68k/kernel/ptrace.h diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c index cd0172d29430..c20d590e4297 100644 --- a/arch/m68k/kernel/ptrace.c +++ b/arch/m68k/kernel/ptrace.c @@ -26,6 +26,8 @@ #include #include +#include "ptrace.h" + /* * does not yet catch signals sent when the child dies. * in exit.c or in signal.c. diff --git a/arch/m68k/kernel/ptrace.h b/arch/m68k/kernel/ptrace.h new file mode 100644 index 000000000000..77018037f10f --- /dev/null +++ b/arch/m68k/kernel/ptrace.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +asmlinkage int syscall_trace_enter(void); +asmlinkage void syscall_trace_leave(void); -- cgit From dbe93977e523ff70ff66da824513d203207e394a Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:07:58 +0200 Subject: m68k: kernel: Add and use "signal.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/kernel/signal.c:756:18: warning: no previous prototype for ‘do_sigreturn’ [-Wmissing-prototypes] 756 | asmlinkage void *do_sigreturn(struct pt_regs *regs, struct switch_stack *sw) | ^~~~~~~~~~~~ arch/m68k/kernel/signal.c:783:18: warning: no previous prototype for ‘do_rt_sigreturn’ [-Wmissing-prototypes] 783 | asmlinkage void *do_rt_sigreturn(struct pt_regs *regs, struct switch_stack *sw) | ^~~~~~~~~~~~~~~ arch/m68k/kernel/signal.c:1112:17: warning: no previous prototype for ‘do_notify_resume’ [-Wmissing-prototypes] 1112 | asmlinkage void do_notify_resume(struct pt_regs *regs) | ^~~~~~~~~~~~~~~~ Fix this by introducing a new header file "signal.h" for holding the prototypes of functions implemented in arch/m68k/kernel/signal.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/25cecda80698829cec18721a9d0f058cc69df0cc.1694613528.git.geert@linux-m68k.org --- arch/m68k/kernel/signal.c | 2 ++ arch/m68k/kernel/signal.h | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 arch/m68k/kernel/signal.h diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index 459c5ff69fcf..e628b859ef21 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c @@ -51,6 +51,8 @@ #include #include +#include "signal.h" + #ifdef CONFIG_MMU /* diff --git a/arch/m68k/kernel/signal.h b/arch/m68k/kernel/signal.h new file mode 100644 index 000000000000..498d84f82820 --- /dev/null +++ b/arch/m68k/kernel/signal.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +asmlinkage void do_notify_resume(struct pt_regs *regs); +asmlinkage void *do_sigreturn(struct pt_regs *regs, struct switch_stack *sw); +asmlinkage void *do_rt_sigreturn(struct pt_regs *regs, struct switch_stack *sw); -- cgit From 90829e82127d8d98abb1cdebeb7ef675d4e90521 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:07:59 +0200 Subject: m68k: kernel: Add and use "traps.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/kernel/traps.c:754:17: warning: no previous prototype for ‘buserr_c’ [-Wmissing-prototypes] 754 | asmlinkage void buserr_c(struct frame *fp) | ^~~~~~~~ arch/m68k/kernel/traps.c:1140:17: warning: no previous prototype for ‘set_esp0’ [-Wmissing-prototypes] 1140 | asmlinkage void set_esp0(unsigned long ssp) | ^~~~~~~~ arch/m68k/kernel/traps.c:1155:17: warning: no previous prototype for ‘fpemu_signal’ [-Wmissing-prototypes] 1155 | asmlinkage void fpemu_signal(int signal, int code, void *addr) | ^~~~~~~~~~~~ arch/m68k/kernel/traps.c:1149:17: warning: no previous prototype for ‘fpsp040_die’ [-Wmissing-prototypes] 1149 | asmlinkage void fpsp040_die(void) | ^~~~~~~~~~~ Fix this by introducing a new header file "traps.h" for holding the prototypes of functions implemented in arch/m68k/kernel/traps.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/652cbbb1c9e339980a86068ebdd0a69362324af8.1694613528.git.geert@linux-m68k.org --- arch/m68k/kernel/traps.c | 2 ++ arch/m68k/kernel/traps.h | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 arch/m68k/kernel/traps.h diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index b3fee39f8f51..d408334712f7 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c @@ -41,6 +41,8 @@ #include #include +#include "traps.h" + static const char *vec_names[] = { [VEC_RESETSP] = "RESET SP", [VEC_RESETPC] = "RESET PC", diff --git a/arch/m68k/kernel/traps.h b/arch/m68k/kernel/traps.h new file mode 100644 index 000000000000..6414b4a0e558 --- /dev/null +++ b/arch/m68k/kernel/traps.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +struct frame; + +asmlinkage void buserr_c(struct frame *fp); +asmlinkage void fpemu_signal(int signal, int code, void *addr); +asmlinkage void fpsp040_die(void); +asmlinkage void set_esp0(unsigned long ssp); -- cgit From 53cab6a2b348fceffc6c20323ca84eff3bab53d3 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:00 +0200 Subject: m68k: kernel: Add and use "vectors.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/kernel/vectors.c:52:13: warning: no previous prototype for ‘base_trap_init’ [-Wmissing-prototypes] 52 | void __init base_trap_init(void) | ^~~~~~~~~~~~~~ Fix this by introducing a new header file "vectors.h" for holding the prototypes of functions implemented in arch/m68k/kernel/vectors.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/bd0a2f65bc1681dc45e2b24951bd89f9ddbe2eef.1694613528.git.geert@linux-m68k.org --- arch/m68k/kernel/vectors.c | 2 ++ arch/m68k/kernel/vectors.h | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 arch/m68k/kernel/vectors.h diff --git a/arch/m68k/kernel/vectors.c b/arch/m68k/kernel/vectors.c index 68762fc1dc97..667e848070f4 100644 --- a/arch/m68k/kernel/vectors.c +++ b/arch/m68k/kernel/vectors.c @@ -28,6 +28,8 @@ #include #include +#include "vectors.h" + /* assembler routines */ asmlinkage void system_call(void); asmlinkage void buserr(void); diff --git a/arch/m68k/kernel/vectors.h b/arch/m68k/kernel/vectors.h new file mode 100644 index 000000000000..897330737ec5 --- /dev/null +++ b/arch/m68k/kernel/vectors.h @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +void base_trap_init(void); -- cgit From 2c0bb8cb99317a59d913dd3be5fd97bf8009be76 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:01 +0200 Subject: m68k: mm: Include for hwreg_() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/mm/hwtest.c:29:5: warning: no previous prototype for ‘hwreg_present’ [-Wmissing-prototypes] 29 | int hwreg_present(volatile void *regp) | ^~~~~~~~~~~~~ arch/m68k/mm/hwtest.c:62:5: warning: no previous prototype for ‘hwreg_write’ [-Wmissing-prototypes] 62 | int hwreg_write(volatile void *regp, unsigned short val) | ^~~~~~~~~~~ Fix this by including . Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/fbd87d8e8d1e8cbe7d56941a8a1d7d82b53010d0.1694613528.git.geert@linux-m68k.org --- arch/m68k/mm/hwtest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/m68k/mm/hwtest.c b/arch/m68k/mm/hwtest.c index fe99aa99987e..8ee7a3368688 100644 --- a/arch/m68k/mm/hwtest.c +++ b/arch/m68k/mm/hwtest.c @@ -26,6 +26,8 @@ #include +#include + int hwreg_present(volatile void *regp) { int ret = 0; -- cgit From 87d7186e61854262b2d56c7639fd8aeec6122bd2 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:02 +0200 Subject: m68k: mm: Move paging_init() to common MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/mm/motorola.c:414:13: warning: no previous prototype for ‘paging_init’ [-Wmissing-prototypes] 414 | void __init paging_init(void) | ^~~~~~~~~~~ arch/m68k/mm/sun3mmu.c:36:13: warning: no previous prototype for ‘paging_init’ [-Wmissing-prototypes] 36 | void __init paging_init(void) | ^~~~~~~~~~~ Fix this by consolidating the multiple prototypes into the common . Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/1b03fde54f205e972e19959b8e335022205d538c.1694613528.git.geert@linux-m68k.org --- arch/m68k/include/asm/pgtable.h | 9 +++++++++ arch/m68k/include/asm/pgtable_no.h | 1 - arch/m68k/kernel/setup_mm.c | 2 -- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/m68k/include/asm/pgtable.h b/arch/m68k/include/asm/pgtable.h index ad15d655a9bf..27525c6a12fd 100644 --- a/arch/m68k/include/asm/pgtable.h +++ b/arch/m68k/include/asm/pgtable.h @@ -1,6 +1,15 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __M68K_PGTABLE_H +#define __M68K_PGTABLE_H + #ifdef __uClinux__ #include #else #include #endif + +#ifndef __ASSEMBLY__ +extern void paging_init(void); +#endif + +#endif /* __M68K_PGTABLE_H */ diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/include/asm/pgtable_no.h index fc044df52b96..1a86c15b9008 100644 --- a/arch/m68k/include/asm/pgtable_no.h +++ b/arch/m68k/include/asm/pgtable_no.h @@ -28,7 +28,6 @@ #define PAGE_READONLY __pgprot(0) #define PAGE_KERNEL __pgprot(0) -extern void paging_init(void); #define swapper_pg_dir ((pgd_t *) 0) /* diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c index 6f1ae01f322c..10310b04f77d 100644 --- a/arch/m68k/kernel/setup_mm.c +++ b/arch/m68k/kernel/setup_mm.c @@ -107,8 +107,6 @@ EXPORT_SYMBOL(isa_sex); #define MASK_256K 0xfffc0000 -extern void paging_init(void); - static void __init m68k_parse_bootinfo(const struct bi_record *record) { const struct bi_record *first_record = record; -- cgit From 217614e937ce4ce7e7ee112fd11fc791beeef2a7 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:03 +0200 Subject: m68k: mm: Add and use "fault.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/mm/fault.c:22:5: warning: no previous prototype for ‘send_fault_sig’ [-Wmissing-prototypes] 22 | int send_fault_sig(struct pt_regs *regs) | ^~~~~~~~~~~~~~ arch/m68k/mm/fault.c:68:5: warning: no previous prototype for ‘do_page_fault’ [-Wmissing-prototypes] 68 | int do_page_fault(struct pt_regs *regs, unsigned long address, | ^~~~~~~~~~~~~ Fix this by introducing a new header file "fault.h" for holding the prototypes of functions implemented in arch/m68k/mm/fault.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/ef004b8cfe4aac892aa0fb7714c2ed81a02a9b89.1694613528.git.geert@linux-m68k.org --- arch/m68k/kernel/sys_m68k.c | 3 +-- arch/m68k/kernel/traps.c | 5 +---- arch/m68k/mm/fault.c | 2 ++ arch/m68k/mm/fault.h | 7 +++++++ 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 arch/m68k/mm/fault.h diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index 14055d676161..1af5e6082467 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c @@ -35,8 +35,7 @@ #include -asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, - unsigned long error_code); +#include "../mm/fault.h" asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index d408334712f7..129c89349e1a 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c @@ -42,6 +42,7 @@ #include #include "traps.h" +#include "../mm/fault.h" static const char *vec_names[] = { [VEC_RESETSP] = "RESET SP", @@ -126,10 +127,6 @@ static const char *space_names[] = { }; void die_if_kernel(char *,struct pt_regs *,int); -asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, - unsigned long error_code); -int send_fault_sig(struct pt_regs *regs); - asmlinkage void trap_c(struct frame *fp); #if defined (CONFIG_M68060) diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c index c290c5c0cfb9..fa3c5f38d989 100644 --- a/arch/m68k/mm/fault.c +++ b/arch/m68k/mm/fault.c @@ -17,6 +17,8 @@ #include #include +#include "fault.h" + extern void die_if_kernel(char *, struct pt_regs *, long); int send_fault_sig(struct pt_regs *regs) diff --git a/arch/m68k/mm/fault.h b/arch/m68k/mm/fault.h new file mode 100644 index 000000000000..dab14ef7d4a1 --- /dev/null +++ b/arch/m68k/mm/fault.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +struct pt_regs; + +int do_page_fault(struct pt_regs *regs, unsigned long address, + unsigned long error_code); +int send_fault_sig(struct pt_regs *regs); -- cgit From 6156086e554cd9837b81e77a06451b811da2216e Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:04 +0200 Subject: m68k: emu: Remove unused vsnprintf() return value in nfprint() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/emu/natfeat.c: In function ‘nfprint’: arch/m68k/emu/natfeat.c:59:13: warning: variable ‘n’ set but not used [-Wunused-but-set-variable] 59 | int n; | ^ As the return value of vsnprintf() is unused, and serves no practical purpose here, fix this by removing the variable. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/a8b6b17ff352cc560d1848a92d171bb0f44ccb27.1694613528.git.geert@linux-m68k.org --- arch/m68k/emu/natfeat.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/m68k/emu/natfeat.c b/arch/m68k/emu/natfeat.c index d124c62022c2..777c7b42a50f 100644 --- a/arch/m68k/emu/natfeat.c +++ b/arch/m68k/emu/natfeat.c @@ -56,10 +56,9 @@ void nfprint(const char *fmt, ...) { static char buf[256]; va_list ap; - int n; va_start(ap, fmt); - n = vsnprintf(buf, 256, fmt, ap); + vsnprintf(buf, 256, fmt, ap); nf_call(nf_get_id("NF_STDERR"), virt_to_phys(buf)); va_end(ap); } -- cgit From 45dacf07fb1c308df3e95154f427f6ae49b56705 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:05 +0200 Subject: m68k: emu: Mark version[] __maybe_unused MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/emu/nfeth.c:42:19: warning: ‘version’ defined but not used [-Wunused-const-variable=] 42 | static const char version[] = | ^~~~~~~ Fix this while obeying the wishes of the original copyright holders by marking version[] with __maybe_unused. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/051731639b4c8e296ec4017595051885cc551c23.1694613528.git.geert@linux-m68k.org --- arch/m68k/emu/nfeth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/emu/nfeth.c b/arch/m68k/emu/nfeth.c index 1a5d1e8eb4c8..26e68813f351 100644 --- a/arch/m68k/emu/nfeth.c +++ b/arch/m68k/emu/nfeth.c @@ -39,7 +39,7 @@ enum { #define MAX_UNIT 8 /* These identify the driver base version and may not be removed. */ -static const char version[] = +static const char version[] __maybe_unused = KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE " S.Opichal, M.Jurik, P.Stehlik\n" KERN_INFO " http://aranym.org/\n"; -- cgit From ac0b5591321330d65001f15f8672ac12b612d7a9 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:06 +0200 Subject: m68k: amiga: pcmcia: Replace set but not used variable by READ_ONCE() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/amiga/pcmcia.c: In function ‘pcmcia_reset’: arch/m68k/amiga/pcmcia.c:29:23: warning: variable ‘b’ set but not used [-Wunused-but-set-variable] 29 | unsigned char b; | ^ Fix this by using READ_ONCE(), and removing the variable. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/1436fa6b329c2212aaf020055afbb97e64b6f039.1694613528.git.geert@linux-m68k.org --- arch/m68k/amiga/pcmcia.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/m68k/amiga/pcmcia.c b/arch/m68k/amiga/pcmcia.c index 7106f0c3639b..63cce6b590df 100644 --- a/arch/m68k/amiga/pcmcia.c +++ b/arch/m68k/amiga/pcmcia.c @@ -26,11 +26,10 @@ static unsigned char cfg_byte = GAYLE_CFG_0V|GAYLE_CFG_150NS; void pcmcia_reset(void) { unsigned long reset_start_time = jiffies; - unsigned char b; gayle_reset = 0x00; while (time_before(jiffies, reset_start_time + 1*HZ/100)); - b = gayle_reset; + READ_ONCE(gayle_reset); } EXPORT_SYMBOL(pcmcia_reset); -- cgit From 090c65639adda433f896e439dfdaaf819e45353f Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:07 +0200 Subject: m68k: amiga: Add and use "amiga.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/amiga/amisound.c:48:13: warning: no previous prototype for ‘amiga_init_sound’ [-Wmissing-prototypes] 48 | void __init amiga_init_sound(void) | ^~~~~~~~~~~~~~~~ arch/m68k/amiga/amisound.c:71:6: warning: no previous prototype for ‘amiga_mksound’ [-Wmissing-prototypes] 71 | void amiga_mksound( unsigned int hz, unsigned int ticks ) | ^~~~~~~~~~~~~ Fix this by introducing a new header file "amiga.h" for holding the prototypes of functions implemented in arch/m68k/amiga/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/7e9395e1de1c9a34d16ea40a522057f05bbee400.1694613528.git.geert@linux-m68k.org --- arch/m68k/amiga/amiga.h | 5 +++++ arch/m68k/amiga/amisound.c | 2 ++ arch/m68k/amiga/config.c | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 arch/m68k/amiga/amiga.h diff --git a/arch/m68k/amiga/amiga.h b/arch/m68k/amiga/amiga.h new file mode 100644 index 000000000000..00392781442c --- /dev/null +++ b/arch/m68k/amiga/amiga.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* amisound.c */ +void amiga_init_sound(void); +void amiga_mksound(unsigned int hz, unsigned int ticks); diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c index 442bdeee6bd7..714fe8ec6afa 100644 --- a/arch/m68k/amiga/amisound.c +++ b/arch/m68k/amiga/amisound.c @@ -16,6 +16,8 @@ #include +#include "amiga.h" + static unsigned short *snd_data; static const signed char sine_data[] = { 0, 39, 75, 103, 121, 127, 121, 103, 75, 39, diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index 3137b45750df..7791673e547b 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -39,6 +39,8 @@ #include #include +#include "amiga.h" + static unsigned long amiga_model; unsigned long amiga_eclock; @@ -96,9 +98,7 @@ static char amiga_model_name[13] = "Amiga "; static void amiga_sched_init(void); static void amiga_get_model(char *model); static void amiga_get_hardware_list(struct seq_file *m); -extern void amiga_mksound(unsigned int count, unsigned int ticks); static void amiga_reset(void); -extern void amiga_init_sound(void); static void amiga_mem_console_write(struct console *co, const char *b, unsigned int count); #ifdef CONFIG_HEARTBEAT -- cgit From 4ad69503d8d261b7ccb8c01a681fe3b155db297a Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:08 +0200 Subject: m68k: atari: Document data parameter of stdma_try_lock() When building with W=1: arch/m68k/atari/stdma.c:69: warning: Function parameter or member 'data' not described in 'stdma_try_lock' Fix this by documenting the data parameter. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/a69dd3ab0a224e40ce5ce7b30981e2d7a0285a83.1694613528.git.geert@linux-m68k.org --- arch/m68k/atari/stdma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/m68k/atari/stdma.c b/arch/m68k/atari/stdma.c index ce6818eff75e..155fefff19b0 100644 --- a/arch/m68k/atari/stdma.c +++ b/arch/m68k/atari/stdma.c @@ -61,6 +61,7 @@ static irqreturn_t stdma_int (int irq, void *dummy); /** * stdma_try_lock - attempt to acquire ST DMA interrupt "lock" * @handler: interrupt handler to use after acquisition + * @data: cookie passed to the interrupt handler function * * Returns !0 if lock was acquired; otherwise 0. */ -- cgit From e9f72cff896e202fcccf79509cb2c63bb3bfbe65 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:09 +0200 Subject: m68k: atari: Make ikbd_reset() static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/atari/atakeyb.c:335:6: warning: no previous prototype for ‘ikbd_reset’ [-Wmissing-prototypes] 335 | void ikbd_reset(void) | ^~~~~~~~~~ Fix this by making ikbd_reset() static. There was never a user outside arch/m68k/atari/atakey.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/6babf691fff55f913808ad845e66f60ab00063b2.1694613528.git.geert@linux-m68k.org --- arch/m68k/atari/atakeyb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c index 5e0e682f9c61..49a9a459bdf4 100644 --- a/arch/m68k/atari/atakeyb.c +++ b/arch/m68k/atari/atakeyb.c @@ -332,7 +332,7 @@ void ikbd_write(const char *str, int len) } /* Reset (without touching the clock) */ -void ikbd_reset(void) +static void ikbd_reset(void) { static const char cmd[2] = { 0x80, 0x01 }; -- cgit From 7849b9122e97e32903a9a341c345af7f1fe9ea8e Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:10 +0200 Subject: m68k: atari: Make atari_platform_init() static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/atari/config.c:883:12: warning: no previous prototype for ‘atari_platform_init’ [-Wmissing-prototypes] 883 | int __init atari_platform_init(void) | ^~~~~~~~~~~~~~~~~~~ Fix this by making atari_platform_init() static. There was never a user outside arch/m68k/atari/config.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/417b46ec1945212c0b1fcc8b0f4074bae9a8b0b4.1694613528.git.geert@linux-m68k.org --- arch/m68k/atari/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index 38a7c0578105..b4fe4273ad91 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c @@ -880,7 +880,7 @@ static const struct resource atari_falconide_rsrc[] __initconst = { DEFINE_RES_MEM(FALCON_IDE_BASE + 0x38, 2), }; -int __init atari_platform_init(void) +static int __init atari_platform_init(void) { struct platform_device *pdev; int rv = 0; -- cgit From 839ff3451a11226e7ffaf833bb726ad24b05f86e Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:11 +0200 Subject: m68k: atari: Make atari_stram_map_pages() static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/atari/stram.c:118:12: warning: no previous prototype for ‘atari_stram_map_pages’ [-Wmissing-prototypes] 118 | int __init atari_stram_map_pages(void) | ^~~~~~~~~~~~~~~~~~~~~ Fix this by making atari_stram_map_pages() static. There was never a user outside arch/m68k/atari/stram.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/fa86b6d7e54d96ac52f574ed00f96e339f46990f.1694613528.git.geert@linux-m68k.org --- arch/m68k/atari/stram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c index ce79b322a99c..922e53bcb853 100644 --- a/arch/m68k/atari/stram.c +++ b/arch/m68k/atari/stram.c @@ -115,7 +115,7 @@ void __init atari_stram_reserve_pages(void *start_mem) * This function is called as arch initcall to reserve the pages needed for * ST-RAM management, if the kernel does not reside in ST-RAM. */ -int __init atari_stram_map_pages(void) +static int __init atari_stram_map_pages(void) { if (!kernel_in_stram) { /* -- cgit From 56422360992905e3a9b27a8c54cd16ad27954d2c Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:12 +0200 Subject: m68k: atari: Add and use "atari.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/atari/time.c:59:1: warning: no previous prototype for ‘atari_sched_init’ [-Wmissing-prototypes] 59 | atari_sched_init(void) | ^~~~~~~~~~~~~~~~ arch/m68k/atari/time.c:140:5: warning: no previous prototype for ‘atari_mste_hwclk’ [-Wmissing-prototypes] 140 | int atari_mste_hwclk( int op, struct rtc_time *t ) | ^~~~~~~~~~~~~~~~ arch/m68k/atari/time.c:199:5: warning: no previous prototype for ‘atari_tt_hwclk’ [-Wmissing-prototypes] 199 | int atari_tt_hwclk( int op, struct rtc_time *t ) | ^~~~~~~~~~~~~~ arch/m68k/atari/ataints.c:267:13: warning: no previous prototype for ‘atari_init_IRQ’ [-Wmissing-prototypes] 267 | void __init atari_init_IRQ(void) | ^~~~~~~~~~~~~~ arch/m68k/atari/atasound.c:36:6: warning: no previous prototype for ‘atari_microwire_cmd’ [-Wmissing-prototypes] 36 | void atari_microwire_cmd (int cmd) | ^~~~~~~~~~~~~~~~~~~ arch/m68k/atari/atasound.c:53:6: warning: no previous prototype for ‘atari_mksound’ [-Wmissing-prototypes] 53 | void atari_mksound (unsigned int hz, unsigned int ticks) | ^~~~~~~~~~~~~ Fix this by introducing a new header file "atari.h" for holding the prototypes of functions implemented in arch/m68k/atari/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/336e4a478ccbfd7e3e91cdbd27636947587a23a6.1694613528.git.geert@linux-m68k.org --- arch/m68k/atari/ataints.c | 3 +-- arch/m68k/atari/atari.h | 15 +++++++++++++++ arch/m68k/atari/atasound.c | 1 + arch/m68k/atari/config.c | 11 ++--------- arch/m68k/atari/time.c | 2 ++ 5 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 arch/m68k/atari/atari.h diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c index 56f02ea2c248..23256434191c 100644 --- a/arch/m68k/atari/ataints.c +++ b/arch/m68k/atari/ataints.c @@ -52,6 +52,7 @@ #include #include +#include "atari.h" /* * Atari interrupt handling scheme: @@ -81,8 +82,6 @@ __ALIGN_STR "\n\t" "orw #0x200,%sp@\n\t" /* set saved ipl to 2 */ "rte"); -extern void atari_microwire_cmd(int cmd); - static unsigned int atari_irq_startup(struct irq_data *data) { unsigned int irq = data->irq; diff --git a/arch/m68k/atari/atari.h b/arch/m68k/atari/atari.h new file mode 100644 index 000000000000..494a03ddac3d --- /dev/null +++ b/arch/m68k/atari/atari.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +struct rtc_time; + +/* ataints.c */ +void atari_init_IRQ(void); + +/* atasound.c */ +void atari_microwire_cmd(int cmd); +void atari_mksound(unsigned int hz, unsigned int ticks); + +/* time.c */ +void atari_sched_init(void); +int atari_mste_hwclk(int op, struct rtc_time *t); +int atari_tt_hwclk(int op, struct rtc_time *t); diff --git a/arch/m68k/atari/atasound.c b/arch/m68k/atari/atasound.c index a8724d998c39..c38ef0e6078e 100644 --- a/arch/m68k/atari/atasound.c +++ b/arch/m68k/atari/atasound.c @@ -28,6 +28,7 @@ #include #include +#include "atari.h" /* * stuff from the old atasound.c diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index b4fe4273ad91..b48a0606a000 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c @@ -48,6 +48,8 @@ #include #include +#include "atari.h" + u_long atari_mch_cookie; EXPORT_SYMBOL(atari_mch_cookie); @@ -69,19 +71,10 @@ int atari_rtc_year_offset; static void atari_reset(void); static void atari_get_model(char *model); static void atari_get_hardware_list(struct seq_file *m); - -/* atari specific irq functions */ -extern void atari_init_IRQ (void); -extern void atari_mksound(unsigned int count, unsigned int ticks); #ifdef CONFIG_HEARTBEAT static void atari_heartbeat(int on); #endif -/* atari specific timer functions (in time.c) */ -extern void atari_sched_init(void); -extern int atari_mste_hwclk (int, struct rtc_time *); -extern int atari_tt_hwclk (int, struct rtc_time *); - /* ++roman: This is a more elaborate test for an SCC chip, since the plain * Medusa board generates DTACK at the SCC's standard addresses, but a SCC * board in the Medusa is possible. Also, the addresses where the ST_ESCC diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c index 7e44d0e9d0f8..3453c6dc6b41 100644 --- a/arch/m68k/atari/time.c +++ b/arch/m68k/atari/time.c @@ -23,6 +23,8 @@ #include #include +#include "atari.h" + DEFINE_SPINLOCK(rtc_lock); EXPORT_SYMBOL_GPL(rtc_lock); -- cgit From 93c12e3096759e34482b8e20f17fc9a6a1caa901 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:13 +0200 Subject: m68k: apollo: Remove unused debug console functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/apollo/config.c:111:5: warning: no previous prototype for ‘dn_serial_console_wait_key’ [-Wmissing-prototypes] 111 | int dn_serial_console_wait_key(struct console *co) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/m68k/apollo/config.c:118:6: warning: no previous prototype for ‘dn_serial_console_write’ [-Wmissing-prototypes] 118 | void dn_serial_console_write (struct console *co, const char *str,unsigned int count) | ^~~~~~~~~~~~~~~~~~~~~~~ arch/m68k/apollo/config.c:238:6: warning: no previous prototype for ‘dn_dummy_waitbut’ [-Wmissing-prototypes] 240 | void dn_dummy_waitbut(void) { | ^~~~~~~~~~~~~~~~ Fix this by removing these unused functions. The last user of dn_serial_console_write() was removed in v2.3.41. The other functions never had any users. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/5da9036914a5c84c20b6af55f1801f0c734a96bb.1694613528.git.geert@linux-m68k.org --- arch/m68k/apollo/config.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index 42a8b8e2b664..fccbb40772dc 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include @@ -108,27 +107,6 @@ static void __init dn_setup_model(void) } -int dn_serial_console_wait_key(struct console *co) { - - while(!(sio01.srb_csrb & 1)) - barrier(); - return sio01.rhrb_thrb; -} - -void dn_serial_console_write (struct console *co, const char *str,unsigned int count) -{ - while(count--) { - if (*str == '\n') { - sio01.rhrb_thrb = (unsigned char)'\r'; - while (!(sio01.srb_csrb & 0x4)) - ; - } - sio01.rhrb_thrb = (unsigned char)*str++; - while (!(sio01.srb_csrb & 0x4)) - ; - } -} - void dn_serial_print (const char *str) { while (*str) { @@ -237,12 +215,6 @@ void dn_dummy_reset(void) { } -void dn_dummy_waitbut(void) { - - dn_serial_print("waitbut\n"); - -} - static void dn_get_model(char *model) { strcpy(model, "Apollo "); -- cgit From 55775fe94d7ff260a9f63b2e376bab71afebf6ec Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:14 +0200 Subject: m68k: apollo: Make local reset, serial, and irq functions static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/apollo/config.c:132:6: warning: no previous prototype for ‘dn_serial_print’ [-Wmissing-prototypes] 110 | void dn_serial_print (const char *str) | ^~~~~~~~~~~~~~~ arch/m68k/apollo/dn_ints.c:8:14: warning: no previous prototype for ‘apollo_irq_startup’ [-Wmissing-prototypes] 8 | unsigned int apollo_irq_startup(struct irq_data *data) | ^~~~~~~~~~~~~~~~~~ arch/m68k/apollo/dn_ints.c:19:6: warning: no previous prototype for ‘apollo_irq_shutdown’ [-Wmissing-prototypes] 19 | void apollo_irq_shutdown(struct irq_data *data) | ^~~~~~~~~~~~~~~~~~~ arch/m68k/apollo/dn_ints.c:29:6: warning: no previous prototype for ‘apollo_irq_eoi’ [-Wmissing-prototypes] 29 | void apollo_irq_eoi(struct irq_data *data) | ^~~~~~~~~~~~~~ Fix this by making all local functions static. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/d2b3a6785d3e80069fea85921c72cf0b7afb8493.1694613528.git.geert@linux-m68k.org --- arch/m68k/apollo/config.c | 8 ++++---- arch/m68k/apollo/dn_ints.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index fccbb40772dc..0e6801eecbaf 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c @@ -29,7 +29,7 @@ u_long apollo_model; extern void dn_sched_init(void); extern void dn_init_IRQ(void); extern int dn_dummy_hwclk(int, struct rtc_time *); -extern void dn_dummy_reset(void); +static void dn_dummy_reset(void); #ifdef CONFIG_HEARTBEAT static void dn_heartbeat(int on); #endif @@ -107,7 +107,7 @@ static void __init dn_setup_model(void) } -void dn_serial_print (const char *str) +static void dn_serial_print(const char *str) { while (*str) { if (*str == '\n') { @@ -207,8 +207,8 @@ int dn_dummy_hwclk(int op, struct rtc_time *t) { } -void dn_dummy_reset(void) { - +static void dn_dummy_reset(void) +{ dn_serial_print("The end !\n"); for(;;); diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c index 02cff7efc834..d97251fe0ab8 100644 --- a/arch/m68k/apollo/dn_ints.c +++ b/arch/m68k/apollo/dn_ints.c @@ -5,7 +5,7 @@ #include #include -unsigned int apollo_irq_startup(struct irq_data *data) +static unsigned int apollo_irq_startup(struct irq_data *data) { unsigned int irq = data->irq; @@ -16,7 +16,7 @@ unsigned int apollo_irq_startup(struct irq_data *data) return 0; } -void apollo_irq_shutdown(struct irq_data *data) +static void apollo_irq_shutdown(struct irq_data *data) { unsigned int irq = data->irq; @@ -26,7 +26,7 @@ void apollo_irq_shutdown(struct irq_data *data) *(volatile unsigned char *)(picb+1) |= (1 << (irq - 8)); } -void apollo_irq_eoi(struct irq_data *data) +static void apollo_irq_eoi(struct irq_data *data) { *(volatile unsigned char *)(pica) = 0x20; *(volatile unsigned char *)(picb) = 0x20; -- cgit From 7509c04afe930573c8f4ab6abda3743c2c184d66 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:15 +0200 Subject: m68k: apollo: Replace set but not used variable by READ_ONCE() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/apollo/config.c: In function ‘dn_timer_int’: arch/m68k/apollo/config.c:171:32: warning: variable ‘x’ set but not used [-Wunused-but-set-variable] 149 | volatile unsigned char x; | ^ Fix this by using READ_ONCE(), and removing the variable. As READ_ONCE() casts to volatile internally, remove the existing cast. Deduplicate the remaining casts by introducing an intermediary. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/d0299797d6bf747eca2da998c6c6256485a9f52e.1694613528.git.geert@linux-m68k.org --- arch/m68k/apollo/config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index 0e6801eecbaf..7afefb019150 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c @@ -146,13 +146,13 @@ void __init config_apollo(void) irqreturn_t dn_timer_int(int irq, void *dev_id) { - volatile unsigned char x; + unsigned char *at = (unsigned char *)apollo_timer; legacy_timer_tick(1); timer_heartbeat(); - x = *(volatile unsigned char *)(apollo_timer + 3); - x = *(volatile unsigned char *)(apollo_timer + 5); + READ_ONCE(*(at + 3)); + READ_ONCE(*(at + 5)); return IRQ_HANDLED; } -- cgit From 676ca3c3fd9a8e341f9749fa3fecb82e1862a666 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:16 +0200 Subject: m68k: apollo: Add and use "apollo.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/apollo/dn_ints.c:43:13: warning: no previous prototype for ‘dn_init_IRQ’ [-Wmissing-prototypes] 43 | void __init dn_init_IRQ(void) | ^~~~~~~~~~~ Fix this by introducing a new header file "apollo.h" for holding the prototypes of functions implemented in arch/m68k/apollo/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/d78eceb83b8dd1931be1789204898060664e23f6.1694613528.git.geert@linux-m68k.org --- arch/m68k/apollo/apollo.h | 4 ++++ arch/m68k/apollo/config.c | 3 ++- arch/m68k/apollo/dn_ints.c | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 arch/m68k/apollo/apollo.h diff --git a/arch/m68k/apollo/apollo.h b/arch/m68k/apollo/apollo.h new file mode 100644 index 000000000000..1fe9d856df30 --- /dev/null +++ b/arch/m68k/apollo/apollo.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +/* dn_ints.c */ +void dn_init_IRQ(void); diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index 7afefb019150..e161ecd76035 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c @@ -17,6 +17,8 @@ #include #include +#include "apollo.h" + u_long sio01_physaddr; u_long sio23_physaddr; u_long rtc_physaddr; @@ -27,7 +29,6 @@ u_long timer_physaddr; u_long apollo_model; extern void dn_sched_init(void); -extern void dn_init_IRQ(void); extern int dn_dummy_hwclk(int, struct rtc_time *); static void dn_dummy_reset(void); #ifdef CONFIG_HEARTBEAT diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c index d97251fe0ab8..ba96a92f8f18 100644 --- a/arch/m68k/apollo/dn_ints.c +++ b/arch/m68k/apollo/dn_ints.c @@ -5,6 +5,8 @@ #include #include +#include "apollo.h" + static unsigned int apollo_irq_startup(struct irq_data *data) { unsigned int irq = data->irq; -- cgit From 18fe6bf505da8acf2e7b578bb23ea2d89fe9dbf2 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:17 +0200 Subject: m68k: bvme6000: Make bvme6000_abort_int() static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/bvme6000/config.c:133:13: warning: no previous prototype for ‘bvme6000_abort_int’ [-Wmissing-prototypes] 133 | irqreturn_t bvme6000_abort_int (int irq, void *dev_id) | ^~~~~~~~~~~~~~~~~~ Fix this by making bvme6000_abort_int() static. There was never a user outside arch/m68k/bvme6000/config.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/4da40748e1d7d56b73840a1d7ab1cb9c9a59cef2.1694613528.git.geert@linux-m68k.org --- arch/m68k/bvme6000/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c index 3a1d90e399e0..e604fe660246 100644 --- a/arch/m68k/bvme6000/config.c +++ b/arch/m68k/bvme6000/config.c @@ -130,7 +130,7 @@ void __init config_bvme6000(void) } -irqreturn_t bvme6000_abort_int (int irq, void *dev_id) +static irqreturn_t bvme6000_abort_int(int irq, void *dev_id) { unsigned long *new = (unsigned long *)vectors; unsigned long *old = (unsigned long *)0xf8000000; -- cgit From 5a368e9c0294a89ed803e9820a0b4bf9df915dc6 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:18 +0200 Subject: m68k: hp300: Include "time.h" for hp300_sched_init() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/hp300/time.c:101:13: warning: no previous prototype for ‘hp300_sched_init’ [-Wmissing-prototypes] 101 | void __init hp300_sched_init(void) | ^~~~~~~~~~~~~~~~ Fix this by including "time.h". Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/630ee35241dc753a30b69adedc2ffa8fc6d551dd.1694613528.git.geert@linux-m68k.org --- arch/m68k/hp300/time.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c index 1d1b7b3b5dd4..72621fb9f3e6 100644 --- a/arch/m68k/hp300/time.c +++ b/arch/m68k/hp300/time.c @@ -20,6 +20,8 @@ #include #include +#include "time.h" + static u64 hp300_read_clk(struct clocksource *cs); static struct clocksource hp300_clk = { -- cgit From f5d1d6d25845e901a6c347ce841b73f9f257f4a9 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:19 +0200 Subject: m68k: mac: Remove unused sine_data[] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/mac/macboing.c:29:26: warning: ‘sine_data’ defined but not used [-Wunused-const-variable=] 29 | static const signed char sine_data[] = { | ^~~~~~~~~ The predefined sine table was superseded by a table calculated at run-time in v2.2.0. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/75dbc0a141490daf9febfb8cb4a43ae87fbe3352.1694613528.git.geert@linux-m68k.org --- arch/m68k/mac/macboing.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c index 4de6229c7bfd..764312413476 100644 --- a/arch/m68k/mac/macboing.c +++ b/arch/m68k/mac/macboing.c @@ -22,15 +22,6 @@ static int mac_asc_inited; */ static __u8 mac_asc_wave_tab[ 0x800 ]; -/* - * Alan's original sine table; needs interpolating to 0x800 - * (hint: interpolate or hardwire [0 -> Pi/2[, it's symmetric) - */ -static const signed char sine_data[] = { - 0, 39, 75, 103, 121, 127, 121, 103, 75, 39, - 0, -39, -75, -103, -121, -127, -121, -103, -75, -39 -}; - /* * where the ASC hides ... */ -- cgit From 4dae1950b494e5d75aaadc882a9276055d769887 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:20 +0200 Subject: m68k: mac: Remove unused yday in unmktime() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/mac/misc.c: In function ‘unmktime’: arch/m68k/mac/misc.c:557:33: warning: variable ‘yday’ set but not used [-Wunused-but-set-variable] 557 | int days, rem, y, wday, yday; | ^~~~ Fix this by removing the unused variable and assignment. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/b25c42eac8beb0862f1b2041e817cb421ec66b4e.1694613528.git.geert@linux-m68k.org --- arch/m68k/mac/misc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index c7cb29f0ff01..65107abc8848 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c @@ -554,7 +554,7 @@ static void unmktime(time64_t time, long offset, /* Leap years. */ { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } }; - int days, rem, y, wday, yday; + int days, rem, y, wday; const unsigned short int *ip; days = div_u64_rem(time, SECS_PER_DAY, &rem); @@ -592,7 +592,6 @@ static void unmktime(time64_t time, long offset, y = yg; } *yearp = y - 1900; - yday = days; /* day in the year. Not currently used. */ ip = __mon_yday[__isleap(y)]; for (y = 11; days < (long int) ip[y]; --y) continue; -- cgit From a53652fa78dd8db22aa1420899903f96b2b84f11 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:21 +0200 Subject: m68k: mac: Make mac_platform_init() static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/mac/config.c:961:12: warning: no previous prototype for ‘mac_platform_init’ [-Wmissing-prototypes] 961 | int __init mac_platform_init(void) | ^~~~~~~~~~~~~~~~~ Fix this by making mac_platform_init() static. There was never a user outside arch/m68k/mac/config.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/f5f069f94c369b7de223bb5e1a21837807fde982.1694613528.git.geert@linux-m68k.org --- arch/m68k/mac/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 382f656c29ea..d56affefd5ca 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -958,7 +958,7 @@ static const struct pata_platform_info mac_pata_data __initconst = { .ioport_shift = 2, }; -int __init mac_platform_init(void) +static int __init mac_platform_init(void) { phys_addr_t swim_base = 0; -- cgit From c43278f073c920a18af9721fb620c05f6826ff13 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:22 +0200 Subject: m68k: mac: Add and use "mac.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/mac/iop.c:235:13: warning: no previous prototype for ‘iop_init’ [-Wmissing-prototypes] 235 | void __init iop_init(void) | ^~~~~~~~ arch/m68k/mac/via.c:112:13: warning: no previous prototype for ‘via_init’ [-Wmissing-prototypes] 111 | void __init via_init(void) | ^~~~~~~~ arch/m68k/mac/via.c:623:13: warning: no previous prototype for ‘via_init_clock’ [-Wmissing-prototypes] 593 | void __init via_init_clock(void) | ^~~~~~~~~~~~~~ arch/m68k/mac/oss.c:37:13: warning: no previous prototype for ‘oss_init’ [-Wmissing-prototypes] 37 | void __init oss_init(void) | ^~~~~~~~ arch/m68k/mac/psc.c:76:13: warning: no previous prototype for ‘psc_init’ [-Wmissing-prototypes] 76 | void __init psc_init(void) | ^~~~~~~~ arch/m68k/mac/baboon.c:25:13: warning: no previous prototype for ‘baboon_init’ [-Wmissing-prototypes] 25 | void __init baboon_init(void) | ^~~~~~~~~~~ arch/m68k/mac/macboing.c:155:6: warning: no previous prototype for ‘mac_mksound’ [-Wmissing-prototypes] 155 | void mac_mksound( unsigned int freq, unsigned int length ) | ^~~~~~~~~~~ arch/m68k/mac/misc.c:608:5: warning: no previous prototype for ‘mac_hwclk’ [-Wmissing-prototypes] 608 | int mac_hwclk(int op, struct rtc_time *t) | ^~~~~~~~~ Fix this by introducing a new header file "mac.h" for holding the prototypes of functions implemented in arch/m68k/mac/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/d1fe0014a9e472a305333de4fa17f335c93d73af.1694613528.git.geert@linux-m68k.org --- arch/m68k/mac/baboon.c | 2 ++ arch/m68k/mac/config.c | 12 ++---------- arch/m68k/mac/iop.c | 2 ++ arch/m68k/mac/mac.h | 25 +++++++++++++++++++++++++ arch/m68k/mac/macboing.c | 2 ++ arch/m68k/mac/misc.c | 2 ++ arch/m68k/mac/oss.c | 2 ++ arch/m68k/mac/psc.c | 2 ++ arch/m68k/mac/via.c | 2 ++ 9 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 arch/m68k/mac/mac.h diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index a7d280220662..5c97a7058bcd 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c @@ -15,6 +15,8 @@ #include #include +#include "mac.h" + int baboon_present; static volatile struct baboon *baboon; diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index d56affefd5ca..e324410ef239 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -50,22 +50,14 @@ #include #include +#include "mac.h" + /* Mac bootinfo struct */ struct mac_booter_data mac_bi_data; /* The phys. video addr. - might be bogus on some machines */ static unsigned long mac_orig_videoaddr; -extern int mac_hwclk(int, struct rtc_time *); -extern void iop_init(void); -extern void via_init(void); -extern void via_init_clock(void); -extern void oss_init(void); -extern void psc_init(void); -extern void baboon_init(void); - -extern void mac_mksound(unsigned int, unsigned int); - static void mac_get_model(char *str); static void mac_identify(void); static void mac_report_hardware(void); diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index 010b3b5ae8e8..a92740d530ac 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c @@ -119,6 +119,8 @@ #include #include +#include "mac.h" + #ifdef DEBUG #define iop_pr_debug(fmt, ...) \ printk(KERN_DEBUG "%s: " fmt, __func__, ##__VA_ARGS__) diff --git a/arch/m68k/mac/mac.h b/arch/m68k/mac/mac.h new file mode 100644 index 000000000000..d3d142cea3b4 --- /dev/null +++ b/arch/m68k/mac/mac.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +struct rtc_time; + +/* baboon.c */ +void baboon_init(void); + +/* iop.c */ +void iop_init(void); + +/* misc.c */ +int mac_hwclk(int op, struct rtc_time *t); + +/* macboing.c */ +void mac_mksound(unsigned int freq, unsigned int length); + +/* oss.c */ +void oss_init(void); + +/* psc.c */ +void psc_init(void); + +/* via.c */ +void via_init(void); +void via_init_clock(void); diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c index 764312413476..faea2265a540 100644 --- a/arch/m68k/mac/macboing.c +++ b/arch/m68k/mac/macboing.c @@ -16,6 +16,8 @@ #include #include +#include "mac.h" + static int mac_asc_inited; /* * dumb triangular wave table diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index 65107abc8848..4c8f8cbfa05f 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c @@ -25,6 +25,8 @@ #include +#include "mac.h" + /* * Offset between Unix time (1970-based) and Mac time (1904-based). Cuda and PMU * times wrap in 2040. If we need to handle later times, the read_time functions diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index 921e6c092f2c..1641607f300d 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c @@ -27,6 +27,8 @@ #include #include +#include "mac.h" + int oss_present; volatile struct mac_oss *oss; diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c index 0d0965b19c09..b4183cf66efe 100644 --- a/arch/m68k/mac/psc.c +++ b/arch/m68k/mac/psc.c @@ -26,6 +26,8 @@ #include #include +#include "mac.h" + #define DEBUG_PSC volatile __u8 *psc; diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 3d11d6219cdd..01e6b0e37f8d 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -38,6 +38,8 @@ #include #include +#include "mac.h" + volatile __u8 *via1, *via2; int rbv_present; int via_alt_mapping; -- cgit From 7f5514b4ed70719a50b0a7c6ad7f4ce6d0f28efe Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:23 +0200 Subject: m68k: mvme147: Make mvme147_init_IRQ() static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/mvme147/config.c:76:13: warning: no previous prototype for ‘mvme147_init_IRQ’ [-Wmissing-prototypes] 76 | void __init mvme147_init_IRQ(void) | ^~~~~~~~~~~~~~~~ Fix this by making mvme147_init_IRQ() static. The function body was moved to arch/m68k/mvme147/config.c in v2.6.18. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/853e29ca81761032c3af132fffbd583b667234a6.1694613528.git.geert@linux-m68k.org --- arch/m68k/mvme147/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c index 4e6218115f43..7dfacd0b207a 100644 --- a/arch/m68k/mvme147/config.c +++ b/arch/m68k/mvme147/config.c @@ -73,7 +73,7 @@ static void mvme147_get_model(char *model) * the mvme147 IRQ handling routines. */ -void __init mvme147_init_IRQ(void) +static void __init mvme147_init_IRQ(void) { m68k_setup_user_interrupt(VEC_USER, 192); } -- cgit From 0c2a527e28ee8290a60a7105fc4c302922944bfe Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:24 +0200 Subject: m68k: mvme16x: Remove unused sink in mvme16x_cons_write() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/mvme16x/config.c: In function ‘mvme16x_cons_write’: arch/m68k/mvme16x/config.c:211:25: warning: variable ‘sink’ set but not used [-Wunused-but-set-variable] 211 | volatile u_char sink; | ^~~~ Fix this by removing the unused variable and assignment. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/22c4d1978f811d7f4495eeb269ce06304717627a.1694613528.git.geert@linux-m68k.org --- arch/m68k/mvme16x/config.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index f00c7aa058de..b6833862ea6b 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c @@ -208,7 +208,6 @@ static void __init mvme16x_init_IRQ (void) void mvme16x_cons_write(struct console *co, const char *str, unsigned count) { volatile unsigned char *base_addr = (u_char *)CD2401_ADDR; - volatile u_char sink; u_char ier; int port; u_char do_lf = 0; @@ -229,7 +228,7 @@ void mvme16x_cons_write(struct console *co, const char *str, unsigned count) if (in_8(PCCSCCTICR) & 0x20) { /* We have a Tx int. Acknowledge it */ - sink = in_8(PCCTPIACKR); + in_8(PCCTPIACKR); if ((base_addr[CyLICR] >> 2) == port) { if (i == count) { /* Last char of string is now output */ -- cgit From dcec33c1fc4ab63983d93ffb0d82b68fc5775b88 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:25 +0200 Subject: m68k: mvme16x: Add and use "mvme16x.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/mvme16x/config.c:208:6: warning: no previous prototype for ‘mvme16x_cons_write’ [-Wmissing-prototypes] 208 | void mvme16x_cons_write(struct console *co, const char *str, unsigned count) | ^~~~~~~~~~~~~~~~~~ Fix this by introducing a new header file "mvme16x.h" for holding the prototypes of functions implemented in arch/m68k/mvme16x/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/6200cc3b26fad215c4524748af04692e38c5ecd2.1694613528.git.geert@linux-m68k.org --- arch/m68k/kernel/early_printk.c | 4 ++-- arch/m68k/mvme16x/config.c | 2 ++ arch/m68k/mvme16x/mvme16x.h | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 arch/m68k/mvme16x/mvme16x.h diff --git a/arch/m68k/kernel/early_printk.c b/arch/m68k/kernel/early_printk.c index 7d3fe08a48eb..3cc944df04f6 100644 --- a/arch/m68k/kernel/early_printk.c +++ b/arch/m68k/kernel/early_printk.c @@ -12,8 +12,8 @@ #include #include -extern void mvme16x_cons_write(struct console *co, - const char *str, unsigned count); + +#include "../mvme16x/mvme16x.h" asmlinkage void __init debug_cons_nputs(const char *s, unsigned n); diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index b6833862ea6b..9bb9a33e43c2 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c @@ -38,6 +38,8 @@ #include #include +#include "mvme16x.h" + extern t_bdid mvme_bdid; static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; diff --git a/arch/m68k/mvme16x/mvme16x.h b/arch/m68k/mvme16x/mvme16x.h new file mode 100644 index 000000000000..159c34b70039 --- /dev/null +++ b/arch/m68k/mvme16x/mvme16x.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +struct console; + +/* config.c */ +void mvme16x_cons_write(struct console *co, const char *str, unsigned count); -- cgit From bbe6980c332eeb3de171268709539820b3b117e1 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:26 +0200 Subject: m68k: q40: Add and use "q40.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/q40/q40ints.c:84:13: warning: no previous prototype for ‘q40_init_IRQ’ [-Wmissing-prototypes] 84 | void __init q40_init_IRQ(void) | ^~~~~~~~~~~~ arch/m68k/q40/q40ints.c:112:6: warning: no previous prototype for ‘q40_mksound’ [-Wmissing-prototypes] 112 | void q40_mksound(unsigned int hz, unsigned int ticks) | ^~~~~~~~~~~ arch/m68k/q40/q40ints.c:152:6: warning: no previous prototype for ‘q40_sched_init’ [-Wmissing-prototypes] 152 | void q40_sched_init (void) | ^~~~~~~~~~~~~~ Fix this by introducing a new header file "q40.h" for holding the prototypes of functions implemented in arch/m68k/q40/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/7f983ce079b176e1e1ac2a7d0c35b36197c5fa6b.1694613528.git.geert@linux-m68k.org --- arch/m68k/q40/config.c | 6 ++---- arch/m68k/q40/q40.h | 6 ++++++ arch/m68k/q40/q40ints.c | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 arch/m68k/q40/q40.h diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index c78ee709b458..2c51c2b4a4fb 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -36,16 +36,14 @@ #include #include -extern void q40_init_IRQ(void); +#include "q40.h" + static void q40_get_model(char *model); -extern void q40_sched_init(void); static int q40_hwclk(int, struct rtc_time *); static int q40_get_rtc_pll(struct rtc_pll_info *pll); static int q40_set_rtc_pll(struct rtc_pll_info *pll); -extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/); - static void q40_mem_console_write(struct console *co, const char *b, unsigned int count); diff --git a/arch/m68k/q40/q40.h b/arch/m68k/q40/q40.h new file mode 100644 index 000000000000..3146679bde0d --- /dev/null +++ b/arch/m68k/q40/q40.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* q40ints.c */ +void q40_init_IRQ(void); +void q40_mksound(unsigned int hz, unsigned int ticks); +void q40_sched_init(void); diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c index 127d7ecdbd49..10f1f294e91f 100644 --- a/arch/m68k/q40/q40ints.c +++ b/arch/m68k/q40/q40ints.c @@ -24,6 +24,8 @@ #include #include +#include "q40.h" + /* * Q40 IRQs are defined as follows: * 3,4,5,6,7,10,11,14,15 : ISA dev IRQs -- cgit From 2926da2bea4400932bf7ec13e67b0f92c4e5215e Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:27 +0200 Subject: m68k: sun3/3x: Include for config_sun3*() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/sun3/config.c:123:13: warning: no previous prototype for ‘config_sun3’ [-Wmissing-prototypes] 126 | void __init config_sun3(void) | ^~~~~~~~~~~ arch/m68k/sun3x/config.c:42:13: warning: no previous prototype for ‘config_sun3x’ [-Wmissing-prototypes] 42 | void __init config_sun3x(void) | ^~~~~~~~~~~~ Fix this by including Fixes: 91d7b75a5888c182 ("m68k: Add asm/config.h") Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/b9178e864d6c5e06c177d53bc4cce6d689f94d78.1694613528.git.geert@linux-m68k.org --- arch/m68k/sun3/config.c | 1 + arch/m68k/sun3x/config.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index 203f428a0344..b932250c9e7f 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -32,6 +32,7 @@ #include #include #include +#include char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c index 37121a0f1253..3a10cda636fc 100644 --- a/arch/m68k/sun3x/config.c +++ b/arch/m68k/sun3x/config.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "time.h" -- cgit From 4ebe8459cd09c1cd826398e054d055254a50e106 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:28 +0200 Subject: m68k: sun3: Improve Sun3/3x DVMA abstraction in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/sun3/dvma.c:65:13: warning: no previous prototype for ‘sun3_dvma_init’ [-Wmissing-prototypes] 65 | void __init sun3_dvma_init(void) | ^~~~~~~~~~~~~~ arch/m68k/sun3x/dvma.c:178:6: warning: no previous prototype for ‘dvma_unmap_iommu’ [-Wmissing-prototypes] 179 | void dvma_unmap_iommu(unsigned long baddr, int len) | ^~~~~~~~~~~~~~~~ Fix this by moving the declarations for sun3_dvma_init() and dvma_unmap_iommu() to . Avoid #ifdefs in callers by providing dummy static inline functions. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/ec93ed1b28b75674ae9a0b42de083a9bb140f0b3.1694613528.git.geert@linux-m68k.org --- arch/m68k/include/asm/dvma.h | 8 +++++++- arch/m68k/sun3/sun3dvma.c | 15 --------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/arch/m68k/include/asm/dvma.h b/arch/m68k/include/asm/dvma.h index f609ec1de36d..d1d66d04844d 100644 --- a/arch/m68k/include/asm/dvma.h +++ b/arch/m68k/include/asm/dvma.h @@ -58,12 +58,16 @@ extern void dvma_free(void *vaddr); #define dvma_vtob(x) dvma_vtop(x) #define dvma_btov(x) dvma_ptov(x) +void sun3_dvma_init(void); + static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len) { return 0; } +static inline void dvma_unmap_iommu(unsigned long baddr, int len) { } + #else /* Sun3x */ /* sun3x dvma page support */ @@ -78,9 +82,11 @@ static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, #define dvma_vtob(x) ((unsigned long)(x) & 0x00ffffff) #define dvma_btov(x) ((unsigned long)(x) | 0xff000000) -extern int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len); +static inline void sun3_dvma_init(void) { } +int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len); +void dvma_unmap_iommu(unsigned long baddr, int len); /* everything below this line is specific to dma used for the onboard ESP scsi on sun3x */ diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c index 4b560f4d3960..f66b24132090 100644 --- a/arch/m68k/sun3/sun3dvma.c +++ b/arch/m68k/sun3/sun3dvma.c @@ -20,18 +20,6 @@ #undef DVMA_DEBUG -#ifdef CONFIG_SUN3X -extern void dvma_unmap_iommu(unsigned long baddr, int len); -#else -static inline void dvma_unmap_iommu(unsigned long a, int b) -{ -} -#endif - -#ifdef CONFIG_SUN3 -extern void sun3_dvma_init(void); -#endif - static unsigned long *iommu_use; #define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT) @@ -274,10 +262,7 @@ void __init dvma_init(void) dvma_unmap_iommu(DVMA_START, DVMA_SIZE); -#ifdef CONFIG_SUN3 sun3_dvma_init(); -#endif - } unsigned long dvma_map_align(unsigned long kaddr, int len, int align) -- cgit From 2e195ea7e95b5360f5e4d9c6a89dbcc4eaf70d36 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:29 +0200 Subject: m68k: sun3: Fix context restore in flush_tlb_range() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: In file included from arch/m68k/kernel/traps.c:42: arch/m68k/include/asm/tlbflush.h: In function ‘flush_tlb_range’: arch/m68k/include/asm/tlbflush.h:191:28: warning: variable ‘oldctx’ set but not used [-Wunused-but-set-variable] 191 | unsigned char seg, oldctx; | ^~~~~~ Indeed, the old context is saved, but never restored. Fix this by adding the missing call to sun3_put_context(). Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/ea859b7850e061e0f7fb3fca64d9f8e6d1c0d2ad.1694613528.git.geert@linux-m68k.org --- arch/m68k/include/asm/tlbflush.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/m68k/include/asm/tlbflush.h b/arch/m68k/include/asm/tlbflush.h index b882e2f4f551..3ab329a03c76 100644 --- a/arch/m68k/include/asm/tlbflush.h +++ b/arch/m68k/include/asm/tlbflush.h @@ -208,6 +208,7 @@ static inline void flush_tlb_range (struct vm_area_struct *vma, next: start += SUN3_PMEG_SIZE; } + sun3_put_context(oldctx); } static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end) -- cgit From bdc1656c08c6aaf68163a111871c07d6f4923c64 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:30 +0200 Subject: m68k: sun3: Fix signature of sun3_get_model() The mach_get_model() callback takes a "char *", not an "unsigned char *". Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/c635afb4542ab54c3dbd4fa2fbed07a2665a2f4e.1694613528.git.geert@linux-m68k.org --- arch/m68k/sun3/idprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/sun3/idprom.c b/arch/m68k/sun3/idprom.c index 1ace5353d78f..9ffd6515ad74 100644 --- a/arch/m68k/sun3/idprom.c +++ b/arch/m68k/sun3/idprom.c @@ -83,7 +83,7 @@ static void __init display_system_type(unsigned char machtype) prom_halt(); } -void sun3_get_model(unsigned char* model) +void sun3_get_model(char *model) { register int i; -- cgit From a4286641894d8f3be1110044ff5e0eab3673d8ae Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:31 +0200 Subject: m68k: sun3: Add missing asmlinkage to sun3_init() sun3_init() is called from assembly code, so it should be marked asmlinkage for documentation purposes. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/9a174020de2c55e108be9bd25fcdec3e48d655c4.1694613528.git.geert@linux-m68k.org --- arch/m68k/sun3/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index b932250c9e7f..4550cf25b6f0 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -49,7 +50,7 @@ static void sun3_get_hardware_list(struct seq_file *m) seq_printf(m, "PROM Revision:\t%s\n", romvec->pv_monid); } -void __init sun3_init(void) +asmlinkage void __init sun3_init(void) { unsigned char enable_register; int i; -- cgit From 2fde1934ae67bfbf5712a32929b40ca7716f00ae Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:32 +0200 Subject: m68k: sun3: Remove unused orig_baddr in free_baddr() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/sun3/sun3dvma.c: In function ‘free_baddr’: arch/m68k/sun3/sun3dvma.c:208:23: warning: variable ‘orig_baddr’ set but not used [-Wunused-but-set-variable] 196 | unsigned long orig_baddr; | ^~~~~~~~~~ Fix this by removing the unused variable and assignment, which were futile since their introduction in v2.4.5.2. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/c705b6186241dfe9a5bdcb71720b8697fa5c801f.1694613528.git.geert@linux-m68k.org --- arch/m68k/sun3/sun3dvma.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c index f66b24132090..6ebf52740ad7 100644 --- a/arch/m68k/sun3/sun3dvma.c +++ b/arch/m68k/sun3/sun3dvma.c @@ -193,9 +193,7 @@ static inline int free_baddr(unsigned long baddr) unsigned long len; struct hole *hole; struct list_head *cur; - unsigned long orig_baddr; - orig_baddr = baddr; len = dvma_entry_use(baddr); dvma_entry_use(baddr) = 0; baddr &= DVMA_PAGE_MASK; -- cgit From f9d49824c08eae0a77d720aeecc6dcb07dd65771 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:33 +0200 Subject: m68k: sun3: Remove unused start_page in sun3_bootmem_alloc() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/sun3/config.c: In function ‘sun3_bootmem_alloc’: arch/m68k/sun3/config.c:110:23: warning: variable ‘start_page’ set but not used [-Wunused-but-set-variable] 112 | unsigned long start_page; | ^~~~~~~~~~ Fix this by removing the variable and the assignment, now the last user is gone. Fixes: 1008a11590b966b4 ("m68k: switch to MEMBLOCK + NO_BOOTMEM") Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/361c4562350c8739f6c0da34f7c416b2678fae7c.1694613528.git.geert@linux-m68k.org --- arch/m68k/sun3/config.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index 4550cf25b6f0..6e24920e4195 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -109,13 +109,10 @@ static void sun3_halt (void) static void __init sun3_bootmem_alloc(unsigned long memory_start, unsigned long memory_end) { - unsigned long start_page; - /* align start/end to page boundaries */ memory_start = ((memory_start + (PAGE_SIZE-1)) & PAGE_MASK); memory_end = memory_end & PAGE_MASK; - start_page = __pa(memory_start) >> PAGE_SHIFT; max_pfn = num_pages = __pa(memory_end) >> PAGE_SHIFT; high_memory = (void *)memory_end; -- cgit From 66ed28ea096c91834a18ecce26eb56a27473ce57 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:34 +0200 Subject: m68k: sun3: Remove unused vsprintf() return value in prom_printf() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/sun3/prom/printf.c: In function ‘prom_printf’: arch/m68k/sun3/prom/printf.c:28:13: warning: variable ‘i’ set but not used [-Wunused-but-set-variable] 28 | int i; | ^ As the return value of vsprintf() is unused, and serves no practical purpose here, fix this by removing the variable. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/94a1e61b1651ff05f4a59655d9b8c1ac5338f60c.1694613528.git.geert@linux-m68k.org --- arch/m68k/sun3/prom/printf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/m68k/sun3/prom/printf.c b/arch/m68k/sun3/prom/printf.c index b6724cc66795..db5537ef1250 100644 --- a/arch/m68k/sun3/prom/printf.c +++ b/arch/m68k/sun3/prom/printf.c @@ -25,15 +25,14 @@ prom_printf(char *fmt, ...) { va_list args; char ch, *bptr; - int i; va_start(args, fmt); #ifdef CONFIG_KGDB ppbuf[0] = 'O'; - i = vsprintf(ppbuf + 1, fmt, args) + 1; + vsprintf(ppbuf + 1, fmt, args) + 1; #else - i = vsprintf(ppbuf, fmt, args); + vsprintf(ppbuf, fmt, args); #endif bptr = ppbuf; -- cgit From dc40c4297760be1b0be1a4a1e6bc74f269f1ab8b Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:35 +0200 Subject: m68k: sun3: Annotate prom_printf() with __printf() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/sun3/prom/printf.c: In function ‘prom_printf’: arch/m68k/sun3/prom/printf.c:35:9: warning: function ‘prom_printf’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] 35 | vsprintf(ppbuf, fmt, args); | ^~~~~~~~ Fix this by annotating prom_printf() with __printf(1, 2). Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/61017c012617e6f633ac9f9a3c2659ae38e1f2fb.1694613528.git.geert@linux-m68k.org --- arch/m68k/include/asm/oplib.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/m68k/include/asm/oplib.h b/arch/m68k/include/asm/oplib.h index 48cb4fd09f8d..6d5ea67c65d0 100644 --- a/arch/m68k/include/asm/oplib.h +++ b/arch/m68k/include/asm/oplib.h @@ -9,6 +9,8 @@ #ifndef __SPARC_OPLIB_H #define __SPARC_OPLIB_H +#include + #include /* The master romvec pointer... */ @@ -149,7 +151,7 @@ extern char prom_getchar(void); extern void prom_putchar(char character); /* Prom's internal printf routine, don't use in kernel/boot code. */ -void prom_printf(char *fmt, ...); +__printf(1, 2) void prom_printf(char *fmt, ...); /* Query for input device type */ -- cgit From dc52d2db892c4aa4469a01c43ccef2c8343c527c Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:36 +0200 Subject: m68k: sun3: Make print_pte() static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/sun3/mmu_emu.c:70:6: warning: no previous prototype for ‘print_pte’ [-Wmissing-prototypes] 70 | void print_pte (pte_t pte) | ^~~~~~~~~ Fix this by making print_pte() static. There was never a user outside arch/m68k/sun3/mmu_emu.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/a56c70e85584efb3681cb7e94aff167299dfa5e4.1694613528.git.geert@linux-m68k.org --- arch/m68k/sun3/mmu_emu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c index 7321b3b76283..7ec9bbf8a364 100644 --- a/arch/m68k/sun3/mmu_emu.c +++ b/arch/m68k/sun3/mmu_emu.c @@ -67,7 +67,7 @@ static unsigned char ctx_avail = CONTEXTS_NUM-1; unsigned long rom_pages[256]; /* Print a PTE value in symbolic form. For debugging. */ -void print_pte (pte_t pte) +static void print_pte(pte_t pte) { #if 0 /* Verbose version. */ -- cgit From 88be4a461e6488af6f2bc5a305e0427f969eb274 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:37 +0200 Subject: m68k: sun3: Make sun3_platform_init() static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/sun3/config.c:201:12: warning: no previous prototype for ‘sun3_platform_init’ [-Wmissing-prototypes] 202 | int __init sun3_platform_init(void) | ^~~~~~~~~~~~~~~~~~ Fix this by making sun3_platform_init() static. There was never a user outside arch/m68k/sun3/config.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/f35e6376d01b11f21f677cb980093e8410d2c33b.1694613528.git.geert@linux-m68k.org --- arch/m68k/sun3/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index 6e24920e4195..40796c3e8440 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -199,7 +199,7 @@ static const struct resource sun3_scsi_rsrc[] __initconst = { }, }; -int __init sun3_platform_init(void) +static int __init sun3_platform_init(void) { switch (idprom->id_machtype) { case SM_SUN3 | SM_3_160: -- cgit From 873f7a1781ab0cea8ddb4d0b8789d7c936552ccd Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:38 +0200 Subject: m68k: sun3x: Fix signature of sun3_leds() The sun3_leds() implementation for Sun3 in arch/m68k/sun3/leds.c, and the prototype in arch/m68k/sun3/sun3ints.c take an "unsigned char", not an "int". Align the dummy implementation for Sun3x with the Sun3 variant and the common caller. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/5214afb67eac58b8adae5710aea0980c2644ff24.1694613528.git.geert@linux-m68k.org --- arch/m68k/sun3x/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c index 3a10cda636fc..e2a5d84df6d2 100644 --- a/arch/m68k/sun3x/config.c +++ b/arch/m68k/sun3x/config.c @@ -27,7 +27,7 @@ volatile char *clock_va; extern void sun3_get_model(char *model); -void sun3_leds(unsigned int i) +void sun3_leds(unsigned char byte) { } -- cgit From 1dbda52ef93e49b29c965f21ca615f7280ee0b7f Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:39 +0200 Subject: m68k: sun3x: Do not mark dvma_map_iommu() inline dvma_map_iommu() is called from the common Sun3/3x DVMA management code, but never from inside arch/m68k/sun3x/dvma.c. Hence it does not make sense to mark it inline. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/0884fd1f5d6775535bf20b13cc74283df4955e49.1694613528.git.geert@linux-m68k.org --- arch/m68k/sun3x/dvma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/m68k/sun3x/dvma.c b/arch/m68k/sun3x/dvma.c index a6034ba05845..d1847bfa1367 100644 --- a/arch/m68k/sun3x/dvma.c +++ b/arch/m68k/sun3x/dvma.c @@ -143,8 +143,7 @@ inline int dvma_map_cpu(unsigned long kaddr, } -inline int dvma_map_iommu(unsigned long kaddr, unsigned long baddr, - int len) +int dvma_map_iommu(unsigned long kaddr, unsigned long baddr, int len) { unsigned long end, index; -- cgit From 6548f013fafd70e7903f737ddc705a048312de65 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:40 +0200 Subject: m68k: sun3x: Make sun3x_halt() static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/sun3x/prom.c:33:6: warning: no previous prototype for ‘sun3x_halt’ [-Wmissing-prototypes] 33 | void sun3x_halt(void) | ^~~~~~~~~~ Fix this by making sun3x_halt() static. The function body was moved to arch/m68k/sun3x/prom.c in v2.4.5.2. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/0ba2883aaff2e4fc5e570bfee87c58e483668b26.1694613528.git.geert@linux-m68k.org --- arch/m68k/sun3x/prom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/sun3x/prom.c b/arch/m68k/sun3x/prom.c index 64c23bfaa90c..8ac87d3dc607 100644 --- a/arch/m68k/sun3x/prom.c +++ b/arch/m68k/sun3x/prom.c @@ -30,7 +30,7 @@ struct linux_romvec *romvec; e_vector *sun3x_prom_vbr; /* Handle returning to the prom */ -void sun3x_halt(void) +static void sun3x_halt(void) { unsigned long flags; -- cgit From f9b34638c07e5cdb2c40151e4f9fb87c2dc62e9c Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:41 +0200 Subject: m68k: sun3x: Make dvma_print() static There was never a user of dvma_print() outside arch/m68k/sun3x/dvma.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/0a038ac68ee553b1928a975dc0ae1c16803a0ac0.1694613528.git.geert@linux-m68k.org --- arch/m68k/sun3x/dvma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/sun3x/dvma.c b/arch/m68k/sun3x/dvma.c index d1847bfa1367..5185b4818d40 100644 --- a/arch/m68k/sun3x/dvma.c +++ b/arch/m68k/sun3x/dvma.c @@ -60,7 +60,7 @@ static volatile unsigned long *iommu_pte = (unsigned long *)SUN3X_IOMMU; #ifdef DEBUG /* code to print out a dvma mapping for debugging purposes */ -void dvma_print (unsigned long dvma_addr) +static void dvma_print (unsigned long dvma_addr) { unsigned long index; -- cgit From c50b1fc110019a7b4aa08b2092a25e2e6c30f27c Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 Sep 2023 16:08:42 +0200 Subject: m68k: sun3/3x: Add and use "sun3.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/sun3/idprom.c:86:6: warning: no previous prototype for ‘sun3_get_model’ [-Wmissing-prototypes] 86 | void sun3_get_model(char *model) | ^~~~~~~~~~~~~~ arch/m68k/sun3/config.c:53:24: warning: no previous prototype for ‘sun3_init’ [-Wmissing-prototypes] 53 | asmlinkage void __init sun3_init(void) | ^~~~~~~~~ arch/m68k/sun3/mmu_emu.c:117:6: warning: no previous prototype for ‘print_pte_vaddr’ [-Wmissing-prototypes] 117 | void print_pte_vaddr (unsigned long vaddr) | ^~~~~~~~~~~~~~~ arch/m68k/sun3/mmu_emu.c:126:13: warning: no previous prototype for ‘mmu_emu_init’ [-Wmissing-prototypes] 126 | void __init mmu_emu_init(unsigned long bootmem_end) | ^~~~~~~~~~~~ arch/m68k/sun3/mmu_emu.c:353:5: warning: no previous prototype for ‘mmu_emu_handle_fault’ [-Wmissing-prototypes] 353 | int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault) | ^~~~~~~~~~~~~~~~~~~~ arch/m68k/sun3/leds.c:6:6: warning: no previous prototype for ‘sun3_leds’ [-Wmissing-prototypes] 6 | void sun3_leds(unsigned char byte) | ^~~~~~~~~ arch/m68k/sun3/intersil.c:27:5: warning: no previous prototype for ‘sun3_hwclk’ [-Wmissing-prototypes] 27 | int sun3_hwclk(int set, struct rtc_time *t) | ^~~~~~~~~~ arch/m68k/sun3x/config.c:30:6: warning: no previous prototype for ‘sun3_leds’ [-Wmissing-prototypes] 30 | void sun3_leds(unsigned char byte) | ^~~~~~~~~ Fix this by introducing a new header file "sun3.h" for holding the prototypes of functions implemented in arch/m68k/sun3/ and arch/m68k/sun3x/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/87856ef9ef8955f459fb691faca921c0a688bc80.1694613528.git.geert@linux-m68k.org --- arch/m68k/kernel/traps.c | 2 +- arch/m68k/mm/sun3kmap.c | 6 ++---- arch/m68k/mm/sun3mmu.c | 2 +- arch/m68k/sun3/config.c | 4 ++-- arch/m68k/sun3/idprom.c | 2 ++ arch/m68k/sun3/intersil.c | 1 + arch/m68k/sun3/leds.c | 2 ++ arch/m68k/sun3/mmu_emu.c | 1 + arch/m68k/sun3/sun3.h | 22 ++++++++++++++++++++++ arch/m68k/sun3/sun3ints.c | 2 +- arch/m68k/sun3x/config.c | 3 +-- 11 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 arch/m68k/sun3/sun3.h diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index 129c89349e1a..8ee773d29954 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c @@ -364,7 +364,7 @@ disable_wb: #if defined(CONFIG_SUN3) #include -extern int mmu_emu_handle_fault (unsigned long, int, int); +#include "../sun3/sun3.h" /* sun3 version of bus_error030 */ diff --git a/arch/m68k/mm/sun3kmap.c b/arch/m68k/mm/sun3kmap.c index 4f2a7ef8348b..ac091892d82f 100644 --- a/arch/m68k/mm/sun3kmap.c +++ b/arch/m68k/mm/sun3kmap.c @@ -18,11 +18,9 @@ #include #include -#undef SUN3_KMAP_DEBUG +#include "../sun3/sun3.h" -#ifdef SUN3_KMAP_DEBUG -extern void print_pte_vaddr(unsigned long vaddr); -#endif +#undef SUN3_KMAP_DEBUG extern void mmu_emu_map_pmeg (int context, int vaddr); diff --git a/arch/m68k/mm/sun3mmu.c b/arch/m68k/mm/sun3mmu.c index c5e6a23e0262..494739c1783e 100644 --- a/arch/m68k/mm/sun3mmu.c +++ b/arch/m68k/mm/sun3mmu.c @@ -24,7 +24,7 @@ #include #include -extern void mmu_emu_init (unsigned long bootmem_end); +#include "../sun3/sun3.h" const char bad_pmd_string[] = "Bad pmd in pte_alloc: %08lx\n"; diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index 40796c3e8440..cd8af809e0ca 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -35,11 +35,11 @@ #include #include +#include "sun3.h" + char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; static void sun3_sched_init(void); -extern void sun3_get_model (char* model); -extern int sun3_hwclk(int set, struct rtc_time *t); volatile char* clock_va; extern unsigned long availmem; diff --git a/arch/m68k/sun3/idprom.c b/arch/m68k/sun3/idprom.c index 9ffd6515ad74..ca633a5f5eb1 100644 --- a/arch/m68k/sun3/idprom.c +++ b/arch/m68k/sun3/idprom.c @@ -17,6 +17,8 @@ #include #include /* Fun with Sun released architectures. */ +#include "sun3.h" + struct idprom *idprom; EXPORT_SYMBOL(idprom); diff --git a/arch/m68k/sun3/intersil.c b/arch/m68k/sun3/intersil.c index 8fc74864de81..29674cfa9bb3 100644 --- a/arch/m68k/sun3/intersil.c +++ b/arch/m68k/sun3/intersil.c @@ -17,6 +17,7 @@ #include #include +#include "sun3.h" /* bits to set for start/run of the intersil */ #define STOP_VAL (INTERSIL_STOP | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE) diff --git a/arch/m68k/sun3/leds.c b/arch/m68k/sun3/leds.c index 7c67b58ebf13..4bb95318fd54 100644 --- a/arch/m68k/sun3/leds.c +++ b/arch/m68k/sun3/leds.c @@ -3,6 +3,8 @@ #include #include +#include "sun3.h" + void sun3_leds(unsigned char byte) { unsigned char dfc; diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c index 7ec9bbf8a364..e5a92da43d19 100644 --- a/arch/m68k/sun3/mmu_emu.c +++ b/arch/m68k/sun3/mmu_emu.c @@ -27,6 +27,7 @@ #include #include +#include "sun3.h" #undef DEBUG_MMU_EMU #define DEBUG_PROM_MAPS diff --git a/arch/m68k/sun3/sun3.h b/arch/m68k/sun3/sun3.h new file mode 100644 index 000000000000..8d98c0aaedc0 --- /dev/null +++ b/arch/m68k/sun3/sun3.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#include + +struct rtc_time; + +/* config.c */ +asmlinkage void sun3_init(void); + +/* idprom.c */ +void sun3_get_model(char *model); + +/* intersil.c */ +int sun3_hwclk(int set, struct rtc_time *t); + +/* leds.c */ +void sun3_leds(unsigned char byte); + +/* mmu_emu.c */ +void mmu_emu_init(unsigned long bootmem_end); +int mmu_emu_handle_fault(unsigned long vaddr, int read_flag, int kernel_fault); +void print_pte_vaddr(unsigned long vaddr); diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c index 36cc280a4505..781e7c0a6f52 100644 --- a/arch/m68k/sun3/sun3ints.c +++ b/arch/m68k/sun3/sun3ints.c @@ -17,7 +17,7 @@ #include #include -extern void sun3_leds (unsigned char); +#include "sun3.h" void sun3_disable_interrupts(void) { diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c index e2a5d84df6d2..798ea72a0ea3 100644 --- a/arch/m68k/sun3x/config.c +++ b/arch/m68k/sun3x/config.c @@ -22,11 +22,10 @@ #include #include "time.h" +#include "../sun3/sun3.h" volatile char *clock_va; -extern void sun3_get_model(char *model); - void sun3_leds(unsigned char byte) { -- cgit From ec177486cb278cddb6f03553e0a60d31df3932b6 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Sun, 17 Sep 2023 11:18:20 +0200 Subject: m68k: Add missing types to asm/irq.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As reported in commit f8b648bf6628 ("net: sunhme: move asm includes to below linux includes") when including this header before the needed headers the compilation will fail because of missing types: arch/m68k/include/asm/irq.h:66:20: warning: ‘struct pt_regs’ declared inside parameter list will not be visible outside of this definition or declaration 66 | struct pt_regs *)); | ^~~~~~~ arch/m68k/include/asm/irq.h:78:11: error: expected ‘;’ before ‘void’ 78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs); | ^~~~~ | ; arch/m68k/include/asm/irq.h:78:40: warning: ‘struct pt_regs’ declared inside parameter list will not be visible outside of this definition or declaration 78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs); | ^~~~~~~ arch/m68k/include/asm/irq.h:79:8: error: unknown type name ‘atomic_t’ 79 | extern atomic_t irq_err_count; | ^~~~~~~~ Signed-off-by: Rolf Eike Beer Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/5971770.lOV4Wx5bFT@eto.sf-tec.de Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/irq.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h index 7829e955ca04..14992fde7340 100644 --- a/arch/m68k/include/asm/irq.h +++ b/arch/m68k/include/asm/irq.h @@ -2,6 +2,9 @@ #ifndef _M68K_IRQ_H_ #define _M68K_IRQ_H_ +#include +#include + /* * This should be the same as the max(NUM_X_SOURCES) for all the * different m68k hosts compiled into the kernel. @@ -59,6 +62,8 @@ struct irq_data; struct irq_chip; struct irq_desc; +struct pt_regs; + extern unsigned int m68k_irq_startup(struct irq_data *data); extern unsigned int m68k_irq_startup_irq(unsigned int irq); extern void m68k_irq_shutdown(struct irq_data *data); -- cgit From 72e70a0e7ac7c422843eb8bbf192e820e9ccd24d Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 18 Sep 2023 12:07:25 +0200 Subject: m68k: sun3: Change led_pattern[] to unsigned char The values stored in led_pattern[] are only used for passing to sun3_leds(), which takes an "unsigned char". Change the type of led_pattern[] accordingly, to reduce kernel size. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/794c5d543dbdae8336a13ef2459adafaaadb7d86.1695031620.git.geert@linux-m68k.org --- arch/m68k/sun3/sun3ints.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c index 781e7c0a6f52..32eaf55f87be 100644 --- a/arch/m68k/sun3/sun3ints.c +++ b/arch/m68k/sun3/sun3ints.c @@ -29,11 +29,11 @@ void sun3_enable_interrupts(void) sun3_enable_irq(0); } -static int led_pattern[8] = { - ~(0x80), ~(0x01), - ~(0x40), ~(0x02), - ~(0x20), ~(0x04), - ~(0x10), ~(0x08) +static unsigned char led_pattern[8] = { + (u8)~(0x80), (u8)~(0x01), + (u8)~(0x40), (u8)~(0x02), + (u8)~(0x20), (u8)~(0x04), + (u8)~(0x10), (u8)~(0x08) }; volatile unsigned char* sun3_intreg; -- cgit From b038c6abf96843b6c45f2ebf69ad0bb1055d5d39 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 18 Sep 2023 12:14:43 +0200 Subject: m68k: Replace GPL 2.0+ README.legal boilerplate with SPDX Upstream Linux never had a "README.legal" file, but it was present in early source releases of Linux/m68k. It contained a simple copyright notice and a link to a version of the "COPYING" file that predated the addition of the "only valid GPL version is v2" clause. Get rid of the references to non-existent files by replacing the boilerplate with SPDX license identifiers. Signed-off-by: Geert Uytterhoeven Acked-by: Greg Ungerer Link: https://lore.kernel.org/r/23430c233728ab02ec0af8e714994398d383137a.1695031668.git.geert@linux-m68k.org --- arch/m68k/68000/entry.S | 7 ++----- arch/m68k/bvme6000/config.c | 5 +---- arch/m68k/coldfire/entry.S | 7 ++----- arch/m68k/ifpsp060/Makefile | 6 ++---- arch/m68k/kernel/entry.S | 7 ++----- arch/m68k/kernel/head.S | 8 ++------ arch/m68k/mvme147/config.c | 5 +---- arch/m68k/mvme16x/config.c | 5 +---- arch/m68k/q40/config.c | 5 +---- 9 files changed, 14 insertions(+), 41 deletions(-) diff --git a/arch/m68k/68000/entry.S b/arch/m68k/68000/entry.S index 7d63e2f1555a..72e95663b62f 100644 --- a/arch/m68k/68000/entry.S +++ b/arch/m68k/68000/entry.S @@ -1,12 +1,9 @@ -/* +/* SPDX-License-Identifier: GPL-2.0-or-later + * * entry.S -- non-mmu 68000 interrupt and exception entry points * * Copyright (C) 1991, 1992 Linus Torvalds * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. - * * Linux/m68k support by Hamish Macdonald */ diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c index e604fe660246..8a2ee69a09f6 100644 --- a/arch/m68k/bvme6000/config.c +++ b/arch/m68k/bvme6000/config.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * arch/m68k/bvme6000/config.c * @@ -8,10 +9,6 @@ * linux/amiga/config.c * * Copyright (C) 1993 Hamish Macdonald - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. */ #include diff --git a/arch/m68k/coldfire/entry.S b/arch/m68k/coldfire/entry.S index 35104c5417ff..4ea08336e2fb 100644 --- a/arch/m68k/coldfire/entry.S +++ b/arch/m68k/coldfire/entry.S @@ -1,4 +1,5 @@ -/* +/* SPDX-License-Identifier: GPL-2.0-or-later + * * entry.S -- interrupt and exception processing for ColdFire * * Copyright (C) 1999-2007, Greg Ungerer (gerg@snapgear.com) @@ -13,10 +14,6 @@ * * Copyright (C) 1991, 1992 Linus Torvalds * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. - * * Linux/m68k support by Hamish Macdonald * * 68060 fixes by Jesper Skov diff --git a/arch/m68k/ifpsp060/Makefile b/arch/m68k/ifpsp060/Makefile index 56b530a96c2f..00d0621f547c 100644 --- a/arch/m68k/ifpsp060/Makefile +++ b/arch/m68k/ifpsp060/Makefile @@ -1,7 +1,5 @@ -# Makefile for 680x0 Linux 68060 integer/floating point support package +# SPDX-License-Identifier: GPL-2.0-or-later # -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "README.legal" in the main directory of this archive -# for more details. +# Makefile for 680x0 Linux 68060 integer/floating point support package obj-y := fskeleton.o iskeleton.o os.o diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index 4dd2fd7acba9..3bcdd32a6b36 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S @@ -1,13 +1,10 @@ -/* -*- mode: asm -*- +/* SPDX-License-Identifier: GPL-2.0-or-later + * -*- mode: asm -*- * * linux/arch/m68k/kernel/entry.S * * Copyright (C) 1991, 1992 Linus Torvalds * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. - * * Linux/m68k support by Hamish Macdonald * * 68060 fixes by Jesper Skov diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index 9e812d8606be..852255cf60de 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S @@ -1,4 +1,5 @@ -/* -*- mode: asm -*- +/* SPDX-License-Identifier: GPL-2.0-or-later +** -*- mode: asm -*- ** ** head.S -- This file contains the initial boot code for the ** Linux/68k kernel. @@ -25,11 +26,6 @@ ** for linux-2.1.115 ** 1999/02/11 Richard Zidlicky: added Q40 support (initial version 99/01/01) ** 2004/05/13 Kars de Jong: Finalised HP300 support -** -** This file is subject to the terms and conditions of the GNU General Public -** License. See the file README.legal in the main directory of this archive -** for more details. -** */ /* diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c index 7dfacd0b207a..8b5dc07f0811 100644 --- a/arch/m68k/mvme147/config.c +++ b/arch/m68k/mvme147/config.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * arch/m68k/mvme147/config.c * @@ -7,10 +8,6 @@ * Based on: * * Copyright (C) 1993 Hamish Macdonald - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. */ #include diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index 9bb9a33e43c2..d1fbd1704d65 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * arch/m68k/mvme16x/config.c * @@ -8,10 +9,6 @@ * linux/amiga/config.c * * Copyright (C) 1993 Hamish Macdonald - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. */ #include diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index 2c51c2b4a4fb..de7870ad2a30 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * arch/m68k/q40/config.c * @@ -6,10 +7,6 @@ * originally based on: * * linux/bvme/config.c - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. */ #include -- cgit From c7db3832ff19a9a1116c1b3d435c9db165a2f2f8 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 25 Sep 2023 17:53:20 +0200 Subject: m68k: io: Mark mmio read addresses as const Passing constant __iomem tokens into the readl() family of helpers or any of the others causes a warning on m68k: include/asm-generic/io.h: In function 'ioread8_rep': arch/m68k/include/asm/io_mm.h:375:44: warning: passing argument 1 of 'raw_insb' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 375 | #define readsb(port, buf, nr) raw_insb((port), (u8 Add a 'const' modifier to the pointers to shut up the warnings here. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309251926.bPl23AhG-lkp@intel.com/ Signed-off-by: Arnd Bergmann Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230925155328.443664-1-arnd@kernel.org [geert: Fix missed rom_in_{8,be16,le16}()] Signed-off-by: Geert Uytterhoeven --- arch/m68k/include/asm/raw_io.h | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/arch/m68k/include/asm/raw_io.h b/arch/m68k/include/asm/raw_io.h index 3ba40bc1dfaa..95a6ff694a68 100644 --- a/arch/m68k/include/asm/raw_io.h +++ b/arch/m68k/include/asm/raw_io.h @@ -17,15 +17,15 @@ * two accesses to memory, which may be undesirable for some devices. */ #define in_8(addr) \ - ({ u8 __v = (*(__force volatile u8 *) (unsigned long)(addr)); __v; }) + ({ u8 __v = (*(__force const volatile u8 *) (unsigned long)(addr)); __v; }) #define in_be16(addr) \ - ({ u16 __v = (*(__force volatile u16 *) (unsigned long)(addr)); __v; }) + ({ u16 __v = (*(__force const volatile u16 *) (unsigned long)(addr)); __v; }) #define in_be32(addr) \ - ({ u32 __v = (*(__force volatile u32 *) (unsigned long)(addr)); __v; }) + ({ u32 __v = (*(__force const volatile u32 *) (unsigned long)(addr)); __v; }) #define in_le16(addr) \ - ({ u16 __v = le16_to_cpu(*(__force volatile __le16 *) (unsigned long)(addr)); __v; }) + ({ u16 __v = le16_to_cpu(*(__force const volatile __le16 *) (unsigned long)(addr)); __v; }) #define in_le32(addr) \ - ({ u32 __v = le32_to_cpu(*(__force volatile __le32 *) (unsigned long)(addr)); __v; }) + ({ u32 __v = le32_to_cpu(*(__force const volatile __le32 *) (unsigned long)(addr)); __v; }) #define out_8(addr,b) (void)((*(__force volatile u8 *) (unsigned long)(addr)) = (b)) #define out_be16(addr,w) (void)((*(__force volatile u16 *) (unsigned long)(addr)) = (w)) @@ -73,11 +73,11 @@ #if defined(CONFIG_ATARI_ROM_ISA) #define rom_in_8(addr) \ - ({ u16 __v = (*(__force volatile u16 *) (addr)); __v >>= 8; __v; }) + ({ u16 __v = (*(__force const volatile u16 *) (addr)); __v >>= 8; __v; }) #define rom_in_be16(addr) \ - ({ u16 __v = (*(__force volatile u16 *) (addr)); __v; }) + ({ u16 __v = (*(__force const volatile u16 *) (addr)); __v; }) #define rom_in_le16(addr) \ - ({ u16 __v = le16_to_cpu(*(__force volatile u16 *) (addr)); __v; }) + ({ u16 __v = le16_to_cpu(*(__force const volatile u16 *) (addr)); __v; }) #define rom_out_8(addr, b) \ (void)({u8 __maybe_unused __w, __v = (b); u32 _addr = ((u32) (addr)); \ @@ -98,7 +98,8 @@ #define raw_rom_outw(val, port) rom_out_be16((port), (val)) #endif /* CONFIG_ATARI_ROM_ISA */ -static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) +static inline void raw_insb(const volatile u8 __iomem *port, u8 *buf, + unsigned int len) { unsigned int i; @@ -146,7 +147,7 @@ static inline void raw_outsb(volatile u8 __iomem *port, const u8 *buf, } } -static inline void raw_insw(volatile u16 __iomem *port, u16 *buf, unsigned int nr) +static inline void raw_insw(volatile const u16 __iomem *port, u16 *buf, unsigned int nr) { unsigned int tmp; @@ -225,7 +226,7 @@ static inline void raw_outsw(volatile u16 __iomem *port, const u16 *buf, } } -static inline void raw_insl(volatile u32 __iomem *port, u32 *buf, unsigned int nr) +static inline void raw_insl(const volatile u32 __iomem *port, u32 *buf, unsigned int nr) { unsigned int tmp; @@ -305,7 +306,7 @@ static inline void raw_outsl(volatile u32 __iomem *port, const u32 *buf, } -static inline void raw_insw_swapw(volatile u16 __iomem *port, u16 *buf, +static inline void raw_insw_swapw(const volatile u16 __iomem *port, u16 *buf, unsigned int nr) { if ((nr) % 8) @@ -413,7 +414,8 @@ static inline void raw_outsw_swapw(volatile u16 __iomem *port, const u16 *buf, #if defined(CONFIG_ATARI_ROM_ISA) -static inline void raw_rom_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) +static inline void raw_rom_insb(const volatile u8 __iomem *port, u8 *buf, + unsigned int len) { unsigned int i; @@ -430,7 +432,7 @@ static inline void raw_rom_outsb(volatile u8 __iomem *port, const u8 *buf, rom_out_8(port, *buf++); } -static inline void raw_rom_insw(volatile u16 __iomem *port, u16 *buf, +static inline void raw_rom_insw(const volatile u16 __iomem *port, u16 *buf, unsigned int nr) { unsigned int i; @@ -448,7 +450,7 @@ static inline void raw_rom_outsw(volatile u16 __iomem *port, const u16 *buf, rom_out_be16(port, *buf++); } -static inline void raw_rom_insw_swapw(volatile u16 __iomem *port, u16 *buf, +static inline void raw_rom_insw_swapw(const volatile u16 __iomem *port, u16 *buf, unsigned int nr) { unsigned int i; -- cgit From 7e02d701b90eb6b83e8fbcf232711ee67b0cb216 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 11 Sep 2023 16:30:19 +0200 Subject: m68k: defconfig: Update defconfigs for v6.6-rc1 - Enable modular build of the new device model tests, - Enable modular build of the glob self-test on configs that didn't have it yet (visible since commit b67abaad4d25b5d9 ("kunit: Allow kunit test modules to use test filtering")), - Replace CONFIG_FB=y by CONFIG_FRAMEBUFFER_CONSOLE=y on the virt platform (the former is no longer needed since commit 55bffc8170bb5813 ("fbdev: Split frame buffer support in FB and FB_CORE symbols")), the latter is no longer auto-enabled since commit a5ae331edb02b664 ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION")). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/43ef623c9053862d93fbc746689d4897b35597ef.1694442486.git.geert@linux-m68k.org --- arch/m68k/configs/amiga_defconfig | 1 + arch/m68k/configs/apollo_defconfig | 2 ++ arch/m68k/configs/atari_defconfig | 1 + arch/m68k/configs/bvme6000_defconfig | 2 ++ arch/m68k/configs/hp300_defconfig | 2 ++ arch/m68k/configs/mac_defconfig | 1 + arch/m68k/configs/multi_defconfig | 1 + arch/m68k/configs/mvme147_defconfig | 2 ++ arch/m68k/configs/mvme16x_defconfig | 2 ++ arch/m68k/configs/q40_defconfig | 1 + arch/m68k/configs/sun3_defconfig | 2 ++ arch/m68k/configs/sun3x_defconfig | 2 ++ arch/m68k/configs/virt_defconfig | 2 +- 13 files changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig index 6deb8faa564b..7e6b74b6eecd 100644 --- a/arch/m68k/configs/amiga_defconfig +++ b/arch/m68k/configs/amiga_defconfig @@ -299,6 +299,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_PARPORT=m CONFIG_PARPORT_AMIGA=m diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig index 802c161827f4..0b403e2efcd5 100644 --- a/arch/m68k/configs/apollo_defconfig +++ b/arch/m68k/configs/apollo_defconfig @@ -295,6 +295,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -568,6 +569,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig index 2cb3d755873b..57aac3f4b001 100644 --- a/arch/m68k/configs/atari_defconfig +++ b/arch/m68k/configs/atari_defconfig @@ -302,6 +302,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_PARPORT=m CONFIG_PARPORT_ATARI=m diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig index b13552caa6b3..3c160636a2e9 100644 --- a/arch/m68k/configs/bvme6000_defconfig +++ b/arch/m68k/configs/bvme6000_defconfig @@ -292,6 +292,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -560,6 +561,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig index f88356c45440..23cf07c49d14 100644 --- a/arch/m68k/configs/hp300_defconfig +++ b/arch/m68k/configs/hp300_defconfig @@ -294,6 +294,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -570,6 +571,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig index 7c2ebb616fba..619a0d93ce5b 100644 --- a/arch/m68k/configs/mac_defconfig +++ b/arch/m68k/configs/mac_defconfig @@ -296,6 +296,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_BLK_DEV_SWIM=m CONFIG_ZRAM=m diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig index d3b272910b38..d9430bc2b2de 100644 --- a/arch/m68k/configs/multi_defconfig +++ b/arch/m68k/configs/multi_defconfig @@ -316,6 +316,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_PARPORT=m CONFIG_PARPORT_PC=m diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig index 4529bc4b843c..eb6132f29bf5 100644 --- a/arch/m68k/configs/mvme147_defconfig +++ b/arch/m68k/configs/mvme147_defconfig @@ -291,6 +291,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -559,6 +560,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig index 30824032e4d5..d0bad674cbb7 100644 --- a/arch/m68k/configs/mvme16x_defconfig +++ b/arch/m68k/configs/mvme16x_defconfig @@ -292,6 +292,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -560,6 +561,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig index 3911211410ed..dad6bcfcaeed 100644 --- a/arch/m68k/configs/q40_defconfig +++ b/arch/m68k/configs/q40_defconfig @@ -293,6 +293,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_PARPORT=m CONFIG_PARPORT_PC=m diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig index 991730c50957..eb1b489b3139 100644 --- a/arch/m68k/configs/sun3_defconfig +++ b/arch/m68k/configs/sun3_defconfig @@ -288,6 +288,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -558,6 +559,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig index e80d7509ab1d..939589826546 100644 --- a/arch/m68k/configs/sun3x_defconfig +++ b/arch/m68k/configs/sun3x_defconfig @@ -289,6 +289,7 @@ CONFIG_NET_IFE=m CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_TEST_ASYNC_DRIVER_PROBE=m +CONFIG_DM_KUNIT_TEST=m CONFIG_CONNECTOR=m CONFIG_ZRAM=m CONFIG_BLK_DEV_LOOP=y @@ -558,6 +559,7 @@ CONFIG_CRYPTO_USER_API_AEAD=m CONFIG_PRIME_NUMBERS=m CONFIG_CRC32_SELFTEST=m CONFIG_XZ_DEC_TEST=m +CONFIG_GLOB_SELFTEST=m # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_MAGIC_SYSRQ=y CONFIG_TEST_LOCKUP=m diff --git a/arch/m68k/configs/virt_defconfig b/arch/m68k/configs/virt_defconfig index 311b57e73316..97b4c41c3184 100644 --- a/arch/m68k/configs/virt_defconfig +++ b/arch/m68k/configs/virt_defconfig @@ -46,7 +46,7 @@ CONFIG_VIRTIO_CONSOLE=y CONFIG_HW_RANDOM_VIRTIO=y CONFIG_DRM=y CONFIG_DRM_VIRTIO_GPU=y -CONFIG_FB=y +CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_SOUND=y CONFIG_SND=y CONFIG_SND_VIRTIO=y -- cgit From 48ceb35e72683dce009f2b47f6579b0a1f9d9768 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 29 Sep 2023 11:01:34 +0200 Subject: m68k: defconfig: Update virt_defconfig for v6.6-rc3 - Enable CONFIG_DRM_FBDEV_EMULATION and CONFIG_FB_DEVICE (no longer auto-enabled since commit bb6c4507fe825f1b ("drm: fix up fbdev Kconfig defaults")), - Drop CONFIG_FRAMEBUFFER_CONSOLE=y (auto-enabled since commit bb6c4507fe825f1b ("drm: fix up fbdev Kconfig defaults")). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/6f30b86b83b972e9902b62295f397a20512d5507.1695977960.git.geert@linux-m68k.org --- arch/m68k/configs/virt_defconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/m68k/configs/virt_defconfig b/arch/m68k/configs/virt_defconfig index 97b4c41c3184..ce725d39e488 100644 --- a/arch/m68k/configs/virt_defconfig +++ b/arch/m68k/configs/virt_defconfig @@ -45,8 +45,9 @@ CONFIG_INPUT_EVDEV=y CONFIG_VIRTIO_CONSOLE=y CONFIG_HW_RANDOM_VIRTIO=y CONFIG_DRM=y +CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_VIRTIO_GPU=y -CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FB_DEVICE=y CONFIG_SOUND=y CONFIG_SND=y CONFIG_SND_VIRTIO=y -- cgit From 88514531230010f0f4802bc133ef8c6f98488ed4 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 6 Oct 2023 16:41:10 +0200 Subject: m68k: Fix indentation by 7 spaces in Indentation should use TABs, not spaces. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/41ca6ab21459164a52f5f468c32ef09aee7ba3d3.1696602993.git.geert@linux-m68k.org --- arch/m68k/include/asm/io_mm.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/m68k/include/asm/io_mm.h b/arch/m68k/include/asm/io_mm.h index 6a0abd4846c6..47525f2a57e1 100644 --- a/arch/m68k/include/asm/io_mm.h +++ b/arch/m68k/include/asm/io_mm.h @@ -272,20 +272,20 @@ static inline void isa_delay(void) #define isa_outsb(port, buf, nr) raw_outsb(isa_itb(port), (u8 *)(buf), (nr)) #define isa_insw(port, buf, nr) \ - (ISA_SEX ? raw_insw(isa_itw(port), (u16 *)(buf), (nr)) : \ - raw_insw_swapw(isa_itw(port), (u16 *)(buf), (nr))) + (ISA_SEX ? raw_insw(isa_itw(port), (u16 *)(buf), (nr)) : \ + raw_insw_swapw(isa_itw(port), (u16 *)(buf), (nr))) #define isa_outsw(port, buf, nr) \ - (ISA_SEX ? raw_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \ - raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr))) + (ISA_SEX ? raw_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \ + raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr))) #define isa_insl(port, buf, nr) \ - (ISA_SEX ? raw_insl(isa_itl(port), (u32 *)(buf), (nr)) : \ - raw_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) + (ISA_SEX ? raw_insl(isa_itl(port), (u32 *)(buf), (nr)) : \ + raw_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) #define isa_outsl(port, buf, nr) \ - (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) : \ - raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) + (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) : \ + raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) #ifdef CONFIG_ATARI_ROM_ISA @@ -297,14 +297,14 @@ static inline void isa_delay(void) #define isa_rom_insb(port, buf, nr) raw_rom_insb(isa_itb(port), (u8 *)(buf), (nr)) #define isa_rom_insw(port, buf, nr) \ - (ISA_SEX ? raw_rom_insw(isa_itw(port), (u16 *)(buf), (nr)) : \ - raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr))) + (ISA_SEX ? raw_rom_insw(isa_itw(port), (u16 *)(buf), (nr)) : \ + raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr))) #define isa_rom_outsb(port, buf, nr) raw_rom_outsb(isa_itb(port), (u8 *)(buf), (nr)) #define isa_rom_outsw(port, buf, nr) \ - (ISA_SEX ? raw_rom_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \ - raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr))) + (ISA_SEX ? raw_rom_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \ + raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr))) #endif /* CONFIG_ATARI_ROM_ISA */ #endif /* CONFIG_ISA || CONFIG_ATARI_ROM_ISA */ -- cgit From 50802d84cb030e94f85082166ab9dead4d8b5258 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 6 Oct 2023 16:41:11 +0200 Subject: m68k: sun3: Fix indentation by 5 or 7 spaces Indentation should use TABs, not spaces. Fix whitespace in reindented code while at it. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/167216dfe9795056b7a69415695772887aca6d80.1696602993.git.geert@linux-m68k.org --- arch/m68k/include/asm/sun3_pgalloc.h | 10 ++--- arch/m68k/include/asm/tlbflush.h | 72 ++++++++++++++++++------------------ arch/m68k/sun3/mmu_emu.c | 40 ++++++++++---------- 3 files changed, 60 insertions(+), 62 deletions(-) diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h index ff48573db2c0..4a137eecb6fe 100644 --- a/arch/m68k/include/asm/sun3_pgalloc.h +++ b/arch/m68k/include/asm/sun3_pgalloc.h @@ -41,12 +41,12 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t page static inline pgd_t * pgd_alloc(struct mm_struct *mm) { - pgd_t *new_pgd; + pgd_t *new_pgd; - new_pgd = (pgd_t *)get_zeroed_page(GFP_KERNEL); - memcpy(new_pgd, swapper_pg_dir, PAGE_SIZE); - memset(new_pgd, 0, (PAGE_OFFSET >> PGDIR_SHIFT)); - return new_pgd; + new_pgd = (pgd_t *)get_zeroed_page(GFP_KERNEL); + memcpy(new_pgd, swapper_pg_dir, PAGE_SIZE); + memset(new_pgd, 0, (PAGE_OFFSET >> PGDIR_SHIFT)); + return new_pgd; } #endif /* SUN3_PGALLOC_H */ diff --git a/arch/m68k/include/asm/tlbflush.h b/arch/m68k/include/asm/tlbflush.h index 3ab329a03c76..6d42e2906887 100644 --- a/arch/m68k/include/asm/tlbflush.h +++ b/arch/m68k/include/asm/tlbflush.h @@ -112,53 +112,51 @@ extern unsigned char pmeg_ctx[SUN3_PMEGS_NUM]; sun?) */ static inline void flush_tlb_all(void) { - unsigned long addr; - unsigned char ctx, oldctx; - - oldctx = sun3_get_context(); - for(addr = 0x00000000; addr < TASK_SIZE; addr += SUN3_PMEG_SIZE) { - for(ctx = 0; ctx < 8; ctx++) { - sun3_put_context(ctx); - sun3_put_segmap(addr, SUN3_INVALID_PMEG); - } - } - - sun3_put_context(oldctx); - /* erase all of the userspace pmeg maps, we've clobbered them - all anyway */ - for(addr = 0; addr < SUN3_INVALID_PMEG; addr++) { - if(pmeg_alloc[addr] == 1) { - pmeg_alloc[addr] = 0; - pmeg_ctx[addr] = 0; - pmeg_vaddr[addr] = 0; - } - } + unsigned long addr; + unsigned char ctx, oldctx; + oldctx = sun3_get_context(); + for (addr = 0x00000000; addr < TASK_SIZE; addr += SUN3_PMEG_SIZE) { + for (ctx = 0; ctx < 8; ctx++) { + sun3_put_context(ctx); + sun3_put_segmap(addr, SUN3_INVALID_PMEG); + } + } + + sun3_put_context(oldctx); + /* erase all of the userspace pmeg maps, we've clobbered them + all anyway */ + for (addr = 0; addr < SUN3_INVALID_PMEG; addr++) { + if (pmeg_alloc[addr] == 1) { + pmeg_alloc[addr] = 0; + pmeg_ctx[addr] = 0; + pmeg_vaddr[addr] = 0; + } + } } /* Clear user TLB entries within the context named in mm */ static inline void flush_tlb_mm (struct mm_struct *mm) { - unsigned char oldctx; - unsigned char seg; - unsigned long i; - - oldctx = sun3_get_context(); - sun3_put_context(mm->context); + unsigned char oldctx; + unsigned char seg; + unsigned long i; - for(i = 0; i < TASK_SIZE; i += SUN3_PMEG_SIZE) { - seg = sun3_get_segmap(i); - if(seg == SUN3_INVALID_PMEG) - continue; + oldctx = sun3_get_context(); + sun3_put_context(mm->context); - sun3_put_segmap(i, SUN3_INVALID_PMEG); - pmeg_alloc[seg] = 0; - pmeg_ctx[seg] = 0; - pmeg_vaddr[seg] = 0; - } + for (i = 0; i < TASK_SIZE; i += SUN3_PMEG_SIZE) { + seg = sun3_get_segmap(i); + if (seg == SUN3_INVALID_PMEG) + continue; - sun3_put_context(oldctx); + sun3_put_segmap(i, SUN3_INVALID_PMEG); + pmeg_alloc[seg] = 0; + pmeg_ctx[seg] = 0; + pmeg_vaddr[seg] = 0; + } + sun3_put_context(oldctx); } /* Flush a single TLB page. In this case, we're limited to flushing a diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c index e5a92da43d19..119bd32efcfb 100644 --- a/arch/m68k/sun3/mmu_emu.c +++ b/arch/m68k/sun3/mmu_emu.c @@ -207,32 +207,32 @@ void __init mmu_emu_init(unsigned long bootmem_end) context for when they're cleared */ void clear_context(unsigned long context) { - unsigned char oldctx; - unsigned long i; + unsigned char oldctx; + unsigned long i; - if(context) { - if(!ctx_alloc[context]) - panic("%s: context not allocated\n", __func__); + if (context) { + if (!ctx_alloc[context]) + panic("%s: context not allocated\n", __func__); - ctx_alloc[context]->context = SUN3_INVALID_CONTEXT; - ctx_alloc[context] = (struct mm_struct *)0; - ctx_avail++; - } + ctx_alloc[context]->context = SUN3_INVALID_CONTEXT; + ctx_alloc[context] = (struct mm_struct *)0; + ctx_avail++; + } - oldctx = sun3_get_context(); + oldctx = sun3_get_context(); - sun3_put_context(context); + sun3_put_context(context); - for(i = 0; i < SUN3_INVALID_PMEG; i++) { - if((pmeg_ctx[i] == context) && (pmeg_alloc[i] == 1)) { - sun3_put_segmap(pmeg_vaddr[i], SUN3_INVALID_PMEG); - pmeg_ctx[i] = 0; - pmeg_alloc[i] = 0; - pmeg_vaddr[i] = 0; - } - } + for (i = 0; i < SUN3_INVALID_PMEG; i++) { + if ((pmeg_ctx[i] == context) && (pmeg_alloc[i] == 1)) { + sun3_put_segmap(pmeg_vaddr[i], SUN3_INVALID_PMEG); + pmeg_ctx[i] = 0; + pmeg_alloc[i] = 0; + pmeg_vaddr[i] = 0; + } + } - sun3_put_context(oldctx); + sun3_put_context(oldctx); } /* gets an empty context. if full, kills the next context listed to -- cgit From ab579eaec22757b6cd83379964451ac77a89c256 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 6 Oct 2023 16:41:12 +0200 Subject: m68k: kernel: Fix indentation by 7 spaces in traps.c Indentation should use TABs, not spaces. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/d1b38c9d389c1135f7856cf5f90852c2f1584c50.1696602993.git.geert@linux-m68k.org --- arch/m68k/kernel/traps.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index 8ee773d29954..53d0cf343d90 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c @@ -486,10 +486,10 @@ static inline void bus_error030 (struct frame *fp) if (buserr_type & SUN3_BUSERR_INVALID) { if (!mmu_emu_handle_fault(addr, 1, 0)) do_page_fault (&fp->ptregs, addr, 0); - } else { + } else { pr_debug("protection fault on insn access (segv).\n"); force_sig (SIGSEGV); - } + } } #else #if defined(CPU_M68020_OR_M68030) @@ -850,9 +850,9 @@ void show_registers(struct pt_regs *regs) pr_info("PC: [<%08lx>] %pS\n", regs->pc, (void *)regs->pc); pr_info("SR: %04x SP: %p a2: %08lx\n", regs->sr, regs, regs->a2); pr_info("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n", - regs->d0, regs->d1, regs->d2, regs->d3); + regs->d0, regs->d1, regs->d2, regs->d3); pr_info("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n", - regs->d4, regs->d5, regs->a0, regs->a1); + regs->d4, regs->d5, regs->a0, regs->a1); pr_info("Process %s (pid: %d, task=%p)\n", current->comm, task_pid_nr(current), current); -- cgit From 0a29dfea0e9769fc996c85a259c1b14e7c2e19b4 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 6 Oct 2023 16:41:13 +0200 Subject: m68k: Fix indentation by 2 or 5 spaces in Indentation should use TABs, not spaces. Fix whitespace in reindented code while at it. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/2819709eee2be69c93497d4e97413bd0e05a9268.1696602993.git.geert@linux-m68k.org --- arch/m68k/include/asm/page_mm.h | 45 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h index 363aa0f9ba8a..e0ae4d5fc985 100644 --- a/arch/m68k/include/asm/page_mm.h +++ b/arch/m68k/include/asm/page_mm.h @@ -13,17 +13,16 @@ #ifdef CPU_M68040_OR_M68060_ONLY static inline void copy_page(void *to, void *from) { - unsigned long tmp; - - __asm__ __volatile__("1:\t" - ".chip 68040\n\t" - "move16 %1@+,%0@+\n\t" - "move16 %1@+,%0@+\n\t" - ".chip 68k\n\t" - "dbra %2,1b\n\t" - : "=a" (to), "=a" (from), "=d" (tmp) - : "0" (to), "1" (from) , "2" (PAGE_SIZE / 32 - 1) - ); + unsigned long tmp; + + __asm__ __volatile__("1:\t" + ".chip 68040\n\t" + "move16 %1@+,%0@+\n\t" + "move16 %1@+,%0@+\n\t" + ".chip 68k\n\t" + "dbra %2,1b\n\t" + : "=a" (to), "=a" (from), "=d" (tmp) + : "0" (to), "1" (from), "2" (PAGE_SIZE / 32 - 1)); } static inline void clear_page(void *page) @@ -95,23 +94,23 @@ static inline void *__va(unsigned long paddr) #define __pa(x) ___pa((unsigned long)(x)) static inline unsigned long ___pa(unsigned long x) { - if(x == 0) - return 0; - if(x >= PAGE_OFFSET) - return (x-PAGE_OFFSET); - else - return (x+0x2000000); + if (x == 0) + return 0; + if (x >= PAGE_OFFSET) + return (x - PAGE_OFFSET); + else + return (x + 0x2000000); } static inline void *__va(unsigned long x) { - if(x == 0) - return (void *)0; + if (x == 0) + return (void *)0; - if(x < 0x2000000) - return (void *)(x+PAGE_OFFSET); - else - return (void *)(x-0x2000000); + if (x < 0x2000000) + return (void *)(x + PAGE_OFFSET); + else + return (void *)(x - 0x2000000); } #endif /* CONFIG_SUN3 */ -- cgit From 9faf1f1a55ee9363e3b7c5d9bba546c8d2c7fccc Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 6 Oct 2023 16:41:14 +0200 Subject: m68k: fpsp040: Fix indentation by 5 spaces Indentation should use TABs, not spaces. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/5ab108be356a5d2a6e6d72bc418ccf1c1938e8fe.1696602993.git.geert@linux-m68k.org --- arch/m68k/fpsp040/slogn.S | 88 +++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/arch/m68k/fpsp040/slogn.S b/arch/m68k/fpsp040/slogn.S index d98eaf641ec4..5f3da4aa7e45 100644 --- a/arch/m68k/fpsp040/slogn.S +++ b/arch/m68k/fpsp040/slogn.S @@ -261,56 +261,56 @@ slognd: |----the value TWOTO100 is no longer needed. |----Note that this code assumes the denormalized input is NON-ZERO. - moveml %d2-%d7,-(%a7) | ...save some registers - movel #0x00000000,%d3 | ...D3 is exponent of smallest norm. # - movel 4(%a0),%d4 - movel 8(%a0),%d5 | ...(D4,D5) is (Hi_X,Lo_X) - clrl %d2 | ...D2 used for holding K + moveml %d2-%d7,-(%a7) | ...save some registers + movel #0x00000000,%d3 | ...D3 is exponent of smallest norm. # + movel 4(%a0),%d4 + movel 8(%a0),%d5 | ...(D4,D5) is (Hi_X,Lo_X) + clrl %d2 | ...D2 used for holding K - tstl %d4 - bnes HiX_not0 + tstl %d4 + bnes HiX_not0 HiX_0: - movel %d5,%d4 - clrl %d5 - movel #32,%d2 - clrl %d6 - bfffo %d4{#0:#32},%d6 - lsll %d6,%d4 - addl %d6,%d2 | ...(D3,D4,D5) is normalized - - movel %d3,X(%a6) - movel %d4,XFRAC(%a6) - movel %d5,XFRAC+4(%a6) - negl %d2 - movel %d2,ADJK(%a6) - fmovex X(%a6),%fp0 - moveml (%a7)+,%d2-%d7 | ...restore registers - lea X(%a6),%a0 - bras LOGBGN | ...begin regular log(X) + movel %d5,%d4 + clrl %d5 + movel #32,%d2 + clrl %d6 + bfffo %d4{#0:#32},%d6 + lsll %d6,%d4 + addl %d6,%d2 | ...(D3,D4,D5) is normalized + + movel %d3,X(%a6) + movel %d4,XFRAC(%a6) + movel %d5,XFRAC+4(%a6) + negl %d2 + movel %d2,ADJK(%a6) + fmovex X(%a6),%fp0 + moveml (%a7)+,%d2-%d7 | ...restore registers + lea X(%a6),%a0 + bras LOGBGN | ...begin regular log(X) HiX_not0: - clrl %d6 - bfffo %d4{#0:#32},%d6 | ...find first 1 - movel %d6,%d2 | ...get k - lsll %d6,%d4 - movel %d5,%d7 | ...a copy of D5 - lsll %d6,%d5 - negl %d6 - addil #32,%d6 - lsrl %d6,%d7 - orl %d7,%d4 | ...(D3,D4,D5) normalized - - movel %d3,X(%a6) - movel %d4,XFRAC(%a6) - movel %d5,XFRAC+4(%a6) - negl %d2 - movel %d2,ADJK(%a6) - fmovex X(%a6),%fp0 - moveml (%a7)+,%d2-%d7 | ...restore registers - lea X(%a6),%a0 - bras LOGBGN | ...begin regular log(X) + clrl %d6 + bfffo %d4{#0:#32},%d6 | ...find first 1 + movel %d6,%d2 | ...get k + lsll %d6,%d4 + movel %d5,%d7 | ...a copy of D5 + lsll %d6,%d5 + negl %d6 + addil #32,%d6 + lsrl %d6,%d7 + orl %d7,%d4 | ...(D3,D4,D5) normalized + + movel %d3,X(%a6) + movel %d4,XFRAC(%a6) + movel %d5,XFRAC+4(%a6) + negl %d2 + movel %d2,ADJK(%a6) + fmovex X(%a6),%fp0 + moveml (%a7)+,%d2-%d7 | ...restore registers + lea X(%a6),%a0 + bras LOGBGN | ...begin regular log(X) .global slogn -- cgit From 03191fb3db3d2585725bcffe0356d12fcfd27c4c Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 11 Oct 2023 09:16:33 +0200 Subject: m68k: lib: Include for __muldi3() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with W=1: arch/m68k/lib/muldi3.c:82:1: warning: no previous prototype for ‘__muldi3’ [-Wmissing-prototypes] 82 | __muldi3 (DItype u, DItype v) | ^~~~~~~~ Fix this by including . Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/160c1fd14b4798f576d9649334b1d2c77db5cb07.1697008341.git.geert@linux-m68k.org --- arch/m68k/lib/muldi3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/m68k/lib/muldi3.c b/arch/m68k/lib/muldi3.c index eb7d9d86ff66..5012a9b218c7 100644 --- a/arch/m68k/lib/muldi3.c +++ b/arch/m68k/lib/muldi3.c @@ -16,6 +16,7 @@ GNU General Public License for more details. */ #include #include +#include #ifdef CONFIG_CPU_HAS_NO_MULDIV64 -- cgit