kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-6.15-rc2/tools/testing/selftests/kvm/lib/arm64/processor.c:107: Possible int/long mixup ?
@ 2025-04-14 18:02 David Binderman
  2025-04-14 18:28 ` Oliver Upton
  0 siblings, 1 reply; 2+ messages in thread
From: David Binderman @ 2025-04-14 18:02 UTC (permalink / raw)
  To: maz@kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com,
	suzuki.poulose@arm.com, yuzenghui@huawei.com, pbonzini@redhat.com,
	shuah@kernel.org, linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.linux.dev, kvm@vger.kernel.org,
	linux-kselftest@vger.kernel.org

Hello there,

Static analyser cppcheck says:

linux-6.15-rc2/tools/testing/selftests/kvm/lib/arm64/processor.c:107:2: style: int result is returned as long value. If the return value is long to avoid loss of information, then you have loss of information. [truncLongCastReturn]

Source code is

   return 1 << (vm->va_bits - shift);

Maybe better code:

   return 1UL << (vm->va_bits - shift);

Regards

David Binderman

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-14 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-14 18:02 linux-6.15-rc2/tools/testing/selftests/kvm/lib/arm64/processor.c:107: Possible int/long mixup ? David Binderman
2025-04-14 18:28 ` Oliver Upton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).