ARC: bitops: Change __fls to return unsigned long
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Fri, 27 May 2022 11:53:43 +0000 (13:53 +0200)
committerVineet Gupta <vgupta@kernel.org>
Mon, 17 Oct 2022 23:32:12 +0000 (16:32 -0700)
As per asm-generic definition and other architectures __fls should
return unsigned long.

No functional change is expected as return value should fit in unsigned
long.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
arch/arc/include/asm/bitops.h

index bdb7e19..f5a9364 100644 (file)
@@ -82,7 +82,7 @@ static inline __attribute__ ((const)) int fls(unsigned int x)
 /*
  * __fls: Similar to fls, but zero based (0-31)
  */
-static inline __attribute__ ((const)) int __fls(unsigned long x)
+static inline __attribute__ ((const)) unsigned long __fls(unsigned long x)
 {
        if (!x)
                return 0;
@@ -131,7 +131,7 @@ static inline __attribute__ ((const)) int fls(unsigned int x)
 /*
  * __fls: Similar to fls, but zero based (0-31). Also 0 if no bit set
  */
-static inline __attribute__ ((const)) int __fls(unsigned long x)
+static inline __attribute__ ((const)) unsigned long __fls(unsigned long x)
 {
        /* FLS insn has exactly same semantics as the API */
        return  __builtin_arc_fls(x);