x86/boot: Remove superfluous type casting from arch/x86/boot/bitops.h
authorLi kunyu <kunyu@nfschina.com>
Mon, 25 Jul 2022 04:23:58 +0000 (12:23 +0800)
committerBorislav Petkov <bp@suse.de>
Mon, 15 Aug 2022 17:17:43 +0000 (19:17 +0200)
'const void *' will auto-type-convert to just about any other const
pointer type, no need to force it.

  [ mingo: Rewrote the changelog. ]

Signed-off-by: Li kunyu <kunyu@nfschina.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20220725042358.3377-1-kunyu@nfschina.com
arch/x86/boot/bitops.h

index 02e1dea11d94bd397a8cc152b77783f7ece06017..8518ae214c9b335917e00c3d976369d6d71edaff 100644 (file)
 
 static inline bool constant_test_bit(int nr, const void *addr)
 {
-       const u32 *p = (const u32 *)addr;
+       const u32 *p = addr;
        return ((1UL << (nr & 31)) & (p[nr >> 5])) != 0;
 }
 static inline bool variable_test_bit(int nr, const void *addr)
 {
        bool v;
-       const u32 *p = (const u32 *)addr;
+       const u32 *p = addr;
 
        asm("btl %2,%1" CC_SET(c) : CC_OUT(c) (v) : "m" (*p), "Ir" (nr));
        return v;