* [PATCH] m68k: bitops: Fix find_*_bit() signatures
@ 2025-09-10 15:16 Geert Uytterhoeven
2025-09-10 15:39 ` Yury Norov
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2025-09-10 15:16 UTC (permalink / raw)
To: Yury Norov, Rasmus Villemoes
Cc: Mary Strodl, linux-m68k, linux-kernel, Geert Uytterhoeven,
kernel test robot
The function signatures of the m68k-optimized implementations of the
find_{first,next}_{,zero_}bit() helpers do not match the generic
variants.
Fix this by changing all non-pointer inputs and outputs to "unsigned
long", and updating a few local variables.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509092305.ncd9mzaZ-lkp@intel.com/
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
To be queued in the m68k tree for v6.18.
arch/m68k/include/asm/bitops.h | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/arch/m68k/include/asm/bitops.h b/arch/m68k/include/asm/bitops.h
index 139ec9289ff2d324..e9639e48c6c3c1da 100644
--- a/arch/m68k/include/asm/bitops.h
+++ b/arch/m68k/include/asm/bitops.h
@@ -350,12 +350,12 @@ static inline bool xor_unlock_is_negative_byte(unsigned long mask,
#include <asm-generic/bitops/ffz.h>
#else
-static inline int find_first_zero_bit(const unsigned long *vaddr,
- unsigned size)
+static inline unsigned long find_first_zero_bit(const unsigned long *vaddr,
+ unsigned long size)
{
const unsigned long *p = vaddr;
- int res = 32;
- unsigned int words;
+ unsigned long res = 32;
+ unsigned long words;
unsigned long num;
if (!size)
@@ -376,8 +376,9 @@ static inline int find_first_zero_bit(const unsigned long *vaddr,
}
#define find_first_zero_bit find_first_zero_bit
-static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
- int offset)
+static inline unsigned long find_next_zero_bit(const unsigned long *vaddr,
+ unsigned long size,
+ unsigned long offset)
{
const unsigned long *p = vaddr + (offset >> 5);
int bit = offset & 31UL, res;
@@ -406,11 +407,12 @@ static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
}
#define find_next_zero_bit find_next_zero_bit
-static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
+static inline unsigned long find_first_bit(const unsigned long *vaddr,
+ unsigned long size)
{
const unsigned long *p = vaddr;
- int res = 32;
- unsigned int words;
+ unsigned long res = 32;
+ unsigned long words;
unsigned long num;
if (!size)
@@ -431,8 +433,9 @@ static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
}
#define find_first_bit find_first_bit
-static inline int find_next_bit(const unsigned long *vaddr, int size,
- int offset)
+static inline unsigned long find_next_bit(const unsigned long *vaddr,
+ unsigned long size,
+ unsigned long offset)
{
const unsigned long *p = vaddr + (offset >> 5);
int bit = offset & 31UL, res;
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] m68k: bitops: Fix find_*_bit() signatures
2025-09-10 15:16 [PATCH] m68k: bitops: Fix find_*_bit() signatures Geert Uytterhoeven
@ 2025-09-10 15:39 ` Yury Norov
0 siblings, 0 replies; 2+ messages in thread
From: Yury Norov @ 2025-09-10 15:39 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Rasmus Villemoes, Mary Strodl, linux-m68k, linux-kernel,
kernel test robot
On Wed, Sep 10, 2025 at 05:16:13PM +0200, Geert Uytterhoeven wrote:
> The function signatures of the m68k-optimized implementations of the
> find_{first,next}_{,zero_}bit() helpers do not match the generic
> variants.
>
> Fix this by changing all non-pointer inputs and outputs to "unsigned
> long", and updating a few local variables.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202509092305.ncd9mzaZ-lkp@intel.com/
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
> ---
> To be queued in the m68k tree for v6.18.
>
> arch/m68k/include/asm/bitops.h | 25 ++++++++++++++-----------
> 1 file changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/arch/m68k/include/asm/bitops.h b/arch/m68k/include/asm/bitops.h
> index 139ec9289ff2d324..e9639e48c6c3c1da 100644
> --- a/arch/m68k/include/asm/bitops.h
> +++ b/arch/m68k/include/asm/bitops.h
> @@ -350,12 +350,12 @@ static inline bool xor_unlock_is_negative_byte(unsigned long mask,
> #include <asm-generic/bitops/ffz.h>
> #else
>
> -static inline int find_first_zero_bit(const unsigned long *vaddr,
> - unsigned size)
> +static inline unsigned long find_first_zero_bit(const unsigned long *vaddr,
> + unsigned long size)
> {
> const unsigned long *p = vaddr;
> - int res = 32;
> - unsigned int words;
> + unsigned long res = 32;
> + unsigned long words;
> unsigned long num;
>
> if (!size)
> @@ -376,8 +376,9 @@ static inline int find_first_zero_bit(const unsigned long *vaddr,
> }
> #define find_first_zero_bit find_first_zero_bit
>
> -static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
> - int offset)
> +static inline unsigned long find_next_zero_bit(const unsigned long *vaddr,
> + unsigned long size,
> + unsigned long offset)
> {
> const unsigned long *p = vaddr + (offset >> 5);
> int bit = offset & 31UL, res;
> @@ -406,11 +407,12 @@ static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
> }
> #define find_next_zero_bit find_next_zero_bit
>
> -static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
> +static inline unsigned long find_first_bit(const unsigned long *vaddr,
> + unsigned long size)
> {
> const unsigned long *p = vaddr;
> - int res = 32;
> - unsigned int words;
> + unsigned long res = 32;
> + unsigned long words;
> unsigned long num;
>
> if (!size)
> @@ -431,8 +433,9 @@ static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
> }
> #define find_first_bit find_first_bit
>
> -static inline int find_next_bit(const unsigned long *vaddr, int size,
> - int offset)
> +static inline unsigned long find_next_bit(const unsigned long *vaddr,
> + unsigned long size,
> + unsigned long offset)
> {
> const unsigned long *p = vaddr + (offset >> 5);
> int bit = offset & 31UL, res;
> --
> 2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-10 15:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-10 15:16 [PATCH] m68k: bitops: Fix find_*_bit() signatures Geert Uytterhoeven
2025-09-10 15:39 ` Yury Norov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox