Skip to contentSkip to conversation

remaining x86 -Wmissing-prototype warnings

PATCH Applied Arnd Bergmann 5 participants 17 messages Jul 25, 2023 – Aug 7, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover remaining x86 -Wmissing-prototype warnings

From: Arnd Bergmann <[email protected]>

Most of the patches addressing -Wmissing-prototype warnings were already merged, including 16 of the 20 x86 patches I sent before, and all except 10 other patches that I need to resubmit to other trees.

I checked that these five are all still required and that there were no remaining comments I needed to address. Four patches are from v1 of the series, the last one was sent separately last time, and the contents are unchanged from the original submission.

These patches have passed a few thousand randconfig builds with the warning enabled.

Arnd Bergmann (5):
[RESEND] x86: apic: hide unused safe_smp_processor_id on UP [RESEND] x86: avoid unneeded __div64_32 function definition [RESEND] x86: qspinlock-paravirt: fix mising-prototype warnings [RESEND] x86: purgatory: include header for warn() declaration [RESEND] x86: alternative: add __alt_reloc_selftest prototype

 arch/x86/boot/compressed/error.c          |  2 +-
 arch/x86/boot/compressed/error.h          |  2 +-
 arch/x86/include/asm/div64.h              |  2 ++
 arch/x86/include/asm/qspinlock_paravirt.h |  2 ++
 arch/x86/kernel/alternative.c             |  1 +
 arch/x86/kernel/apic/ipi.c                |  2 ++
 arch/x86/kernel/paravirt.c                |  2 ++
 arch/x86/purgatory/purgatory.c            |  1 +
 kernel/locking/qspinlock_paravirt.h       | 20 ++++++++++----------
 9 files changed, 22 insertions(+), 12 deletions(-)
Signature · 9 lines
2.39.2

Cc: Thomas Gleixner <[email protected]> 
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]> 
Cc: [email protected]
#1 lore raw

PATCH RESEND 1/5 x86: apic: hide unused safe_smp_processor_id on UP

From: Arnd Bergmann <[email protected]>

When CONFIG_SMP is disabled, the prototype for safe_smp_processor_id() is hidden, which causes a W=1 warning:

/home/arnd/arm-soc/arch/x86/kernel/apic/ipi.c:316:5: error: no previous prototype for 'safe_smp_processor_id' [-Werror=missing-prototypes]

Since there are no callers in this configuration, just hide the definition as well.

---
 arch/x86/kernel/apic/ipi.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/apic/ipi.c +2 -0
index 2a6509e8c840d..9bfd6e3973845 100644
@@ -301,6 +301,7 @@ void default_send_IPI_mask_logical(const struct cpumask *cpumask, int vector)
 	local_irq_restore(flags);
 }
 
+#ifdef CONFIG_SMP
 /* must come after the send_IPI functions above for inlining */
 static int convert_apicid_to_cpu(int apic_id)
 {
@@ -329,3 +330,4 @@ int safe_smp_processor_id(void)
 	return cpuid >= 0 ? cpuid : 0;
 }
 #endif
+#endif
Signature · 1 line
2.39.2
#3 lore raw

PATCH RESEND 2/5 x86: avoid unneeded __div64_32 function definition

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The __div64_32() function is provided for 32-bit architectures that don't have a custom do_div() implementation. x86_32 has one, and does not use the header file that declares the function prototype, so the definition causes a W=1 warning:

lib/math/div64.c:31:32: error: no previous prototype for '__div64_32' [-Werror=missing-prototypes]

Define an empty macro to prevent the function definition from getting built, which avoids the warning and saves a little .text space.

---
 arch/x86/include/asm/div64.h | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/include/asm/div64.h +2 -0
index b8f1dc0761e4b..9826d5fc12e34 100644
@@ -71,6 +71,8 @@ static inline u64 mul_u32_u32(u32 a, u32 b)
 }
 #define mul_u32_u32 mul_u32_u32
 
+#define __div64_32 /* not needed */
+
 #else
 # include <asm-generic/div64.h>
 
Signature · 1 line
2.39.2
#10 lore raw

PATCH RESEND 3/5 x86: qspinlock-paravirt: fix mising-prototype warnings

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

__pv_queued_spin_unlock_slowpath is defined in a header file as a global function, and designed to be called from an inline asm, but there is no prototype visible in the definition:

kernel/locking/qspinlock_paravirt.h:493:1: error: no previous prototype for '__pv_queued_spin_unlock_slowpath' [-Werror=missing-prototypes]

Add this to the x86 header that contains the inline asm calling it, and ensure this gets included before the definition, rather than after it.

The native_pv_lock_init function in turn is only declared in SMP builds but can be left out in UP to avoid another warning:

arch/x86/kernel/paravirt.c:76:13: error: no previous prototype for 'native_pv_lock_init' [-Werror=missing-prototypes]

---
 arch/x86/include/asm/qspinlock_paravirt.h |  2 ++
 arch/x86/kernel/paravirt.c                |  2 ++
 kernel/locking/qspinlock_paravirt.h       | 20 ++++++++++----------
 3 files changed, 14 insertions(+), 10 deletions(-)
arch/x86/include/asm/qspinlock_paravirt.h +2 -0
index 42b17cf10b10e..85b6e3609cb92 100644
@@ -4,6 +4,8 @@
 
 #include <asm/ibt.h>
 
+void __lockfunc __pv_queued_spin_unlock_slowpath(struct qspinlock *lock, u8 locked);
+
 /*
  * For x86-64, PV_CALLEE_SAVE_REGS_THUNK() saves and restores 8 64-bit
  * registers. For i386, however, only 1 32-bit register needs to be saved
arch/x86/kernel/paravirt.c +2 -0
index 89842bb7ec9cc..64a6bba70d183 100644
@@ -73,11 +73,13 @@ DEFINE_PARAVIRT_ASM(pv_native_read_cr2, "mov %cr2, %rax", .noinstr.text);
 
 DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
 
+#ifdef CONFIG_SMP
 void __init native_pv_lock_init(void)
 {
 	if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
 		static_branch_disable(&virt_spin_lock_key);
 }
+#endif
 
 unsigned int paravirt_patch(u8 type, void *insn_buff, unsigned long addr,
 			    unsigned int len)
kernel/locking/qspinlock_paravirt.h +10 -10
index 6afc249ce697d..6a0184e9c2348 100644
@@ -485,6 +485,16 @@ pv_wait_head_or_lock(struct qspinlock *lock, struct mcs_spinlock *node)
 	return (u32)(atomic_read(&lock->val) | _Q_LOCKED_VAL);
 }
 
+/*
+ * Include the architecture specific callee-save thunk of the
+ * __pv_queued_spin_unlock(). This thunk is put together with
+ * __pv_queued_spin_unlock() to make the callee-save thunk and the real unlock
+ * function close to each other sharing consecutive instruction cachelines.
+ * Alternatively, architecture specific version of __pv_queued_spin_unlock()
+ * can be defined.
+ */
+#include <asm/qspinlock_paravirt.h>
+
 /*
  * PV versions of the unlock fastpath and slowpath functions to be used
  * instead of queued_spin_unlock().
@@ -533,16 +543,6 @@ __pv_queued_spin_unlock_slowpath(struct qspinlock *lock, u8 locked)
 	pv_kick(node->cpu);
 }
 
-/*
- * Include the architecture specific callee-save thunk of the
- * __pv_queued_spin_unlock(). This thunk is put together with
- * __pv_queued_spin_unlock() to make the callee-save thunk and the real unlock
- * function close to each other sharing consecutive instruction cachelines.
- * Alternatively, architecture specific version of __pv_queued_spin_unlock()
- * can be defined.
- */
-#include <asm/qspinlock_paravirt.h>
-
 #ifndef __pv_queued_spin_unlock
 __visible __lockfunc void __pv_queued_spin_unlock(struct qspinlock *lock)
 {
Signature · 1 line
2.39.2
#15 lore raw

PATCH RESEND 4/5 x86: purgatory: include header for warn() declaration

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The purgatory code has uses parts of the decompressor and provides its own warn() function, but has to include the corresponding header file to avoid a -Wmissing-prototypes warning.

It turns out that this the function prototype actually differs from the declaration, so change it to get a constant pointer in the declaration and the other definition as well.

---
 arch/x86/boot/compressed/error.c | 2 +-
 arch/x86/boot/compressed/error.h | 2 +-
 arch/x86/purgatory/purgatory.c   | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)
arch/x86/boot/compressed/error.c +1 -1
index 5313c5cb2b802..19a8251de506a 100644
@@ -7,7 +7,7 @@
 #include "misc.h"
 #include "error.h"
 
-void warn(char *m)
+void warn(const char *m)
 {
 	error_putstr("\n\n");
 	error_putstr(m);
arch/x86/boot/compressed/error.h +1 -1
index 86fe33b937154..31f9e080d61a8 100644
@@ -4,7 +4,7 @@
 
 #include <linux/compiler.h>
 
-void warn(char *m);
+void warn(const char *m);
 void error(char *m) __noreturn;
 void panic(const char *fmt, ...) __noreturn __cold;
 
arch/x86/purgatory/purgatory.c +1 -0
index 7558139920f8c..aea47e7939637 100644
@@ -14,6 +14,7 @@
 #include <crypto/sha2.h>
 #include <asm/purgatory.h>
 
+#include "../boot/compressed/error.h"
 #include "../boot/string.h"
 
 u8 purgatory_sha256_digest[SHA256_DIGEST_SIZE] __section(".kexec-purgatory");
Signature · 1 line
2.39.2
#16 lore raw

PATCH RESEND 5/5 x86: alternative: add __alt_reloc_selftest prototype

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The newly introduced selftest function causes a warning when -Wmissing-prototypes is enabled:

arch/x86/kernel/alternative.c:1461:32: error: no previous prototype for '__alt_reloc_selftest' [-Werror=missing-prototypes]

Since it's only used locally, add the prototype directly in front of it.

Fixes 270a69c4485d ("x86/alternative: Support relocations in alternatives")
---
 arch/x86/kernel/alternative.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/alternative.c +1 -0
index 2dcf3a06af090..934c23f24a3f8 100644
@@ -1531,6 +1531,7 @@ static noinline void __init int3_selftest(void)
 
 static __initdata int __alt_reloc_selftest_addr;
 
+extern void __init __alt_reloc_selftest(void *arg);
 __visible noinline void __init __alt_reloc_selftest(void *arg)
 {
 	WARN_ON(arg != &__alt_reloc_selftest_addr);
Signature · 1 line
2.39.2
maintainer
#4 lore raw

Re: [PATCH 2/5] [RESEND] x86: avoid unneeded __div64_32 function definition

In reply to Arnd Bergmann
Quoted 22 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The __div64_32() function is provided for 32-bit architectures that don't have a custom do_div() implementation. x86_32 has one, and does not use the header file that declares the function prototype, so the definition causes a W=1 warning:

lib/math/div64.c:31:32: error: no previous prototype for '__div64_32' [-Werror=missing-prototypes]

Define an empty macro to prevent the function definition from getting built, which avoids the warning and saves a little .text space.

---
 arch/x86/include/asm/div64.h | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/include/asm/div64.h +0 -0
index b8f1dc0761e4b..9826d5fc12e34 100644

arch/x86/include/asm/div64.h static inline u64 mul_u32_u32(u32 a, u32 b) · line 74

Quoted 4 lines
arch/x86/include/asm/div64.h +1 -0
@@ -71,6 +71,8 @@ static inline u64 mul_u32_u32(u32 a, u32 b)
 }
 #define mul_u32_u32 mul_u32_u32
 
+#define __div64_32 /* not needed */

This comment, *after* having read the commit message makes sense.

When you look at it alone, after having opened the file, makes me scratch my head and wonder what is that thing supposed to mean. Please extend it.

And put the comment ontop, not sideways.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
maintainer
#11 lore raw

Re: [PATCH 3/5] [RESEND] x86: qspinlock-paravirt: fix mising-prototype warnings

In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann
arch/x86/kernel/paravirt.c +0 -0
index 89842bb7ec9cc..64a6bba70d183 100644

arch/x86/kernel/paravirt.c DEFINE_PARAVIRT_ASM(pv_native_read_cr2, "mov %cr2, %rax", .noinstr.text); · line 82

Quoted 10 lines
arch/x86/kernel/paravirt.c +2 -0
@@ -73,11 +73,13 @@ DEFINE_PARAVIRT_ASM(pv_native_read_cr2, "mov %cr2, %rax", .noinstr.text);
 
 DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
 
+#ifdef CONFIG_SMP
 void __init native_pv_lock_init(void)
 {
 	if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
 		static_branch_disable(&virt_spin_lock_key);
 }
+#endif

Can you add an empty UP stub instead?

We all have a great aversion against ifdeffery...

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#12 lore raw

Re: [PATCH 3/5] [RESEND] x86: qspinlock-paravirt: fix mising-prototype warnings

Quoted 19 lines · Borislav Petkov
Quoted 5 lines · Arnd Bergmann
arch/x86/kernel/paravirt.c +0 -0
index 89842bb7ec9cc..64a6bba70d183 100644

arch/x86/kernel/paravirt.c DEFINE_PARAVIRT_ASM(pv_native_read_cr2, "mov %cr2, %rax", .noinstr.text); · line 82

Quoted 10 lines
arch/x86/kernel/paravirt.c +2 -0
@@ -73,11 +73,13 @@ DEFINE_PARAVIRT_ASM(pv_native_read_cr2, "mov %cr2, %rax", .noinstr.text);
 
 DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
 
+#ifdef CONFIG_SMP
 void __init native_pv_lock_init(void)
 {
 	if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
 		static_branch_disable(&virt_spin_lock_key);
 }
+#endif

Can you add an empty UP stub instead?

Quoted 1 line

We all have a great aversion against ifdeffery...

There is already a stub for !CONFIG_PARAVIRT in asm/qspinlock.h, but the problem is that this header does not get included anywhere in UP configurations.

The variant below would avoid adding more #ifdefs, by moving the declaration into asm/paravirt.h to ensure that it's declared even if there is no caller.

Does this look better to you?

Arnd

arch/x86/include/asm/paravirt.h +5 -0
index b49778664d2be..fc3a377bb9b79 100644
@@ -739,6 +739,7 @@ static __always_inline unsigned long arch_local_irq_save(void)
 	     ".popsection")
 
 extern void default_banner(void);
+void native_pv_lock_init(void) __init;
 
 #else  /* __ASSEMBLY__ */
 
@@ -776,8 +777,13 @@ extern void default_banner(void);
 #endif /* __ASSEMBLY__ */
 #else  /* CONFIG_PARAVIRT */
 # define default_banner x86_init_noop
+
+static inline void native_pv_lock_init(void)
+{
+}
 #endif /* !CONFIG_PARAVIRT */
 
 #ifndef __ASSEMBLY__
arch/x86/include/asm/qspinlock.h +1 -6
index d87451df480bd..cde8357bb226d 100644
@@ -74,8 +74,6 @@ static inline bool vcpu_is_preempted(long cpu)
  */
 DECLARE_STATIC_KEY_TRUE(virt_spin_lock_key);
 
-void native_pv_lock_init(void) __init;
-
 /*
  * Shortcut for the queued_spin_lock_slowpath() function that allows
  * virt to hijack it.
@@ -103,10 +101,7 @@ static inline bool virt_spin_lock(struct qspinlock *lock)
 
 	return true;
 }
-#else
-static inline void native_pv_lock_init(void)
-{
-}
+
 #endif /* CONFIG_PARAVIRT */
 
 #include <asm-generic/qspinlock.h>
arch/x86/kernel/paravirt.c +2 -1
index 89842bb7ec9cc..066fc19d2568e 100644
@@ -75,7 +75,8 @@ DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
 
 void __init native_pv_lock_init(void)
 {
-	if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
+	if (IS_ENABLED(CONFIG_PARAVIRT_SPINLOCKS) &&
+	    !boot_cpu_has(X86_FEATURE_HYPERVISOR))
 		static_branch_disable(&virt_spin_lock_key);
 }
 
#5 lore raw

Re: [PATCH 2/5] [RESEND] x86: avoid unneeded __div64_32 function definition

In reply to Borislav Petkov
Quoted 30 lines · Borislav Petkov
Quoted 22 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The __div64_32() function is provided for 32-bit architectures that don't have a custom do_div() implementation. x86_32 has one, and does not use the header file that declares the function prototype, so the definition causes a W=1 warning:

lib/math/div64.c:31:32: error: no previous prototype for '__div64_32' [-Werror=missing-prototypes]

Define an empty macro to prevent the function definition from getting built, which avoids the warning and saves a little .text space.

---
 arch/x86/include/asm/div64.h | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/include/asm/div64.h +0 -0
index b8f1dc0761e4b..9826d5fc12e34 100644

arch/x86/include/asm/div64.h static inline u64 mul_u32_u32(u32 a, u32 b) · line 74

Quoted 4 lines
arch/x86/include/asm/div64.h +1 -0
@@ -71,6 +71,8 @@ static inline u64 mul_u32_u32(u32 a, u32 b)
 }
 #define mul_u32_u32 mul_u32_u32
 
+#define __div64_32 /* not needed */

This comment, *after* having read the commit message makes sense.

Quoted 5 lines

When you look at it alone, after having opened the file, makes me scratch my head and wonder what is that thing supposed to mean. Please extend it.

And put the comment ontop, not sideways.

Right, makes sense. How about this version?

arch/x86/include/asm/div64.h +5 -0
@@ -71,6 +71,11 @@ static inline u64 mul_u32_u32(u32 a, u32 b)
 }
 #define mul_u32_u32 mul_u32_u32
 
+/*
+ * __div64_32() is never called on x86, so prevent the
+ * generic definition from getting built.
+ */
+#define __div64_32
 
 #else
 # include <asm-generic/div64.h>

Arnd

maintainer
#6 lore raw

Re: [PATCH 2/5] [RESEND] x86: avoid unneeded __div64_32 function definition

Quoted 6 lines · Arnd Bergmann

Right, makes sense. How about this version?

arch/x86/include/asm/div64.h +0 -0
@@ -71,6 +71,11 @@ static inline u64 mul_u32_u32(u32 a, u32 b)
 }

arch/x86/include/asm/div64.h static inline u64 mul_u32_u32(u32 a, u32 b) · line 81

Quoted 10 lines
arch/x86/include/asm/div64.h +5 -0
 #define mul_u32_u32 mul_u32_u32
 
+/*
+ * __div64_32() is never called on x86, so prevent the
+ * generic definition from getting built.
+ */
+#define __div64_32
 
 #else
 # include <asm-generic/div64.h>

Yap.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
maintainer
#13 lore raw

Re: [PATCH 3/5] [RESEND] x86: qspinlock-paravirt: fix mising-prototype warnings

In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

The variant below would avoid adding more #ifdefs, by moving the declaration into asm/paravirt.h to ensure that it's declared even if there is no caller.

Does this look better to you?

Yes, thanks. I don't mind empty stubs in the header which the compiler discards/ignores.

Now lemme look at the rest.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
maintainer
#14 lore raw

Re: [PATCH 3/5] [RESEND] x86: qspinlock-paravirt: fix mising-prototype warnings

Quoted 1 line · Borislav Petkov

Now lemme look at the rest.

Yap, they look good. I'll queue your next version.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
merge bot Applied
#2 lore raw

[tip: x86/cleanups] x86/apic: Hide unused safe_smp_processor_id() on 32-bit UP

In reply to Arnd Bergmann
The following commit has been merged into the x86/cleanups branch of tip:

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     ac1c6283c45a77431af33fbae435f1a29f23a9f4
Gitweb:        https://git.kernel.org/tip/ac1c6283c45a77431af33fbae435f1a29f23a9f4
Author:        Arnd Bergmann <[email protected]>
AuthorDate:    Tue, 25 Jul 2023 15:48:33 +02:00
Committer:     Borislav Petkov (AMD) <[email protected]>
CommitterDate: Mon, 31 Jul 2023 11:32:25 +02:00

x86/apic: Hide unused safe_smp_processor_id() on 32-bit UP

When CONFIG_SMP is disabled in a 32-bit config, the prototype for safe_smp_processor_id() is hidden, which causes a W=1 warning:

arch/x86/kernel/apic/ipi.c:316:5: error: no previous prototype for 'safe_smp_processor_id' [-Werror=missing-prototypes]

Since there are no callers in this configuration, just hide the definition as well.

[ bp: Clarify it is a 32-bit config. ]

---
 arch/x86/kernel/apic/ipi.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/apic/ipi.c +2 -0
index 2a6509e..9bfd6e3 100644
@@ -301,6 +301,7 @@ void default_send_IPI_mask_logical(const struct cpumask *cpumask, int vector)
 	local_irq_restore(flags);
 }
 
+#ifdef CONFIG_SMP
 /* must come after the send_IPI functions above for inlining */
 static int convert_apicid_to_cpu(int apic_id)
 {
@@ -329,3 +330,4 @@ int safe_smp_processor_id(void)
 	return cpuid >= 0 ? cpuid : 0;
 }
 #endif
+#endif
#7 lore raw

Re: [PATCH 2/5] [RESEND] x86: avoid unneeded __div64_32 function definition

In reply to Borislav Petkov
Quoted 12 lines · Borislav Petkov
Quoted 12 lines
arch/x86/include/asm/div64.h +5 -0
@@ -71,6 +71,11 @@ static inline u64 mul_u32_u32(u32 a, u32 b)
 }
 #define mul_u32_u32 mul_u32_u32
 
+/*
+ * __div64_32() is never called on x86, so prevent the
+ * generic definition from getting built.
+ */
+#define __div64_32
 
Quoted 4 lines

arch/x86/include/asm/div64.h static inline u64 mul_u32_u32(u32 a, u32 b) · line 81

Quoted 2 lines
arch/x86/include/asm/div64.h +0 -0
 #else
 # include <asm-generic/div64.h>

Yap.

Hmm, shouldn't this be something like:

#define __div64_32(n, base) BUILD_BUG()

instead?

Otherwise you risk __div64_32(n, base)' getting expanded to (n, base)',
if the macro does get called mistakenly for some reason, and the expansion is a valid expression which may not produce a warning even, depending on usage.

Maciej

maintainer
#8 lore raw

Re: [PATCH 2/5] [RESEND] x86: avoid unneeded __div64_32 function definition

Quoted 1 line · Maciej W. Rozycki

Otherwise you risk __div64_32(n, base)' getting expanded to (n, base)',

You mean in the very obscure case of a 32-bit kernel where they don't call do_div() but call this low level function?

I'd say if they can't be bothered to even grep the tree for the right usage, they deserve both pieces... :)

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#9 lore raw

Re: [PATCH 2/5] [RESEND] x86: avoid unneeded __div64_32 function definition

Quoted 8 lines · Borislav Petkov
Quoted 1 line · Maciej W. Rozycki

Otherwise you risk __div64_32(n, base)' getting expanded to (n, base)',

You mean in the very obscure case of a 32-bit kernel where they don't call do_div() but call this low level function?

I'd say if they can't be bothered to even grep the tree for the right usage, they deserve both pieces... :)

Well, people do make mistakes and life is tough enough already, so why
make it tougher when we can have a free sanity check? I mean there's hardly any cost from the extra characters added and it can save someone hassle with debugging, which is always tough by definition.

I've suffered from silly mistakes myself on many occasions, possibly from
being distracted in the middle of doing something, and while I figured things out eventually, it often cost me a day of effort or so wasted in chasing them.

Maciej