Skip to contentSkip to conversation

linux-next: build warning after merge of the bitmap tree

DISCUSSION Stephen Rothwell 2 participants 3 messages Jul 10, 2025 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the bitmap tree, today's linux-next build (arm64 defconfig) produced this warning:

arch/arm64/kvm/sys_regs.c: In function 'access_mdcr':
arch/arm64/kvm/sys_regs.c:2654:17: warning: ignoring return value of 'u64_replace_bits' declared with attribute 'warn_unused_result' [-Wunused-result]

 2654 |                 u64_replace_bits(val, hpmn, MDCR_EL2_HPMN);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Introduced by commit

f66f9c3d09c1 ("bitfield: Ensure the return values of helper functions are checked")

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

Hi Stephen,

Quoted 5 lines · Stephen Rothwell

Hi all,

After merging the bitmap tree, today's linux-next build (arm64 defconfig) produced this warning:

Quoted 9 lines

arch/arm64/kvm/sys_regs.c: In function 'access_mdcr':
arch/arm64/kvm/sys_regs.c:2654:17: warning: ignoring return value of 'u64_replace_bits' declared with attribute 'warn_unused_result' [-Wunused-result]

  2654 |                 u64_replace_bits(val, hpmn, MDCR_EL2_HPMN);
       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Introduced by commit

f66f9c3d09c1 ("bitfield: Ensure the return values of helper functions are checked")

Sorry to have broken your tree. However, this is a valid warning and this misuse of u64_replace_bits() was the motivation for the commit.

The fix can be found here https://lore.kernel.org/kvmarm/[email protected]/T/#mc9e47859302654d84b4f2b3d9032d2b595d5df49

Thanks,

Ben

#2 lore raw

Hi Ben,

Quoted 12 lines · On Thu, 10 Jul 2025 09:44:09 +0100 Ben Horgan <[email protected]> wrote:
Quoted 10 lines · Stephen Rothwell

Hi all,

After merging the bitmap tree, today's linux-next build (arm64 defconfig) produced this warning:

arch/arm64/kvm/sys_regs.c: In function 'access_mdcr':
arch/arm64/kvm/sys_regs.c:2654:17: warning: ignoring return value of 'u64_replace_bits' declared with attribute 'warn_unused_result' [-Wunused-result]

  2654 |                 u64_replace_bits(val, hpmn, MDCR_EL2_HPMN);
       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 8 lines
Quoted 4 lines

Introduced by commit

f66f9c3d09c1 ("bitfield: Ensure the return values of helper functions are checked")

Sorry to have broken your tree. However, this is a valid warning and this misuse of u64_replace_bits() was the motivation for the commit.

The fix can be found here https://lore.kernel.org/kvmarm/[email protected]/T/#mc9e47859302654d84b4f2b3d9032d2b595d5df49

Well, normally that fix would have been applied (with appropriate ACKs) in the same tree and before f66f9c3d09c1 (or in a shared branch merged into this tree and some other tree).

Signature · 2 lines
Cheers,
Stephen Rothwell