]> git.ipfire.org Git - thirdparty/linux.git/commit
x86/bitops: Remove unused __sw_hweight64() assembly implementation on x86-32
authorIngo Molnar <mingo@kernel.org>
Sat, 22 Jan 2022 12:39:15 +0000 (13:39 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 22 Sep 2023 07:34:50 +0000 (09:34 +0200)
commitad424743256b0119bd60a9248db4df5d998000a4
tree2238036c200a8320bb168d6dfee819cfffe5f677
parent7c097ca50d2ba7f7989f01175f366151256bfa10
x86/bitops: Remove unused __sw_hweight64() assembly implementation on x86-32

Header cleanups in the fast-headers tree highlighted that we have an
unused assembly implementation for __sw_hweight64():

    WARNING: modpost: EXPORT symbol "__sw_hweight64" [vmlinux] version ...

__arch_hweight64() on x86-32 is defined in the
arch/x86/include/asm/arch_hweight.h header as an inline, using
__arch_hweight32():

  #ifdef CONFIG_X86_32
  static inline unsigned long __arch_hweight64(__u64 w)
  {
          return  __arch_hweight32((u32)w) +
                  __arch_hweight32((u32)(w >> 32));
  }

*But* there's also a __sw_hweight64() assembly implementation:

  arch/x86/lib/hweight.S

  SYM_FUNC_START(__sw_hweight64)
  #ifdef CONFIG_X86_64
  ...
  #else /* CONFIG_X86_32 */
        /* We're getting an u64 arg in (%eax,%edx): unsigned long hweight64(__u64 w) */
        pushl   %ecx

        call    __sw_hweight32
        movl    %eax, %ecx                      # stash away result
        movl    %edx, %eax                      # second part of input
        call    __sw_hweight32
        addl    %ecx, %eax                      # result

        popl    %ecx
        ret
  #endif

But this __sw_hweight64 assembly implementation is unused - and it's
essentially doing the same thing that the inline wrapper does.

Remove the assembly version and add a comment about it.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
arch/x86/lib/hweight.S