Skip to contentSkip to conversation

kselftest/arm64: Fix typo in hwcap check

PATCH In review Mark Brown 2 participants 2 messages Sep 7, 2022 – Sep 22, 2022

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 kselftest/arm64: Fix typo in hwcap check

We use a local variable hwcap to refer to the element of the hwcaps array which we are currently checking. When checking for the relevant hwcap bit being set in testing we were dereferencing hwcaps rather than hwcap in fetching the AT_HWCAP to use, which is perfectly valid C but means we were always checking the bit was set in the hwcap for whichever feature is first in the array. Remove the stray s.

---
 tools/testing/selftests/arm64/abi/hwcap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/arm64/abi/hwcap.c +1 -1
index 322d9b92bbe3..75eb470eb432 100644
@@ -307,7 +307,7 @@ int main(void)
 	for (i = 0; i < ARRAY_SIZE(hwcaps); i++) {
 		hwcap = &hwcaps[i];
 
-		have_hwcap = getauxval(hwcaps->at_hwcap) & hwcap->hwcap_bit;
+		have_hwcap = getauxval(hwcap->at_hwcap) & hwcap->hwcap_bit;
 		have_cpuinfo = cpuinfo_present(hwcap->cpuinfo);
 
 		if (have_hwcap)
Signature · 1 line
2.30.2
maintainer
#1 lore raw
Quoted 8 lines · Mark Brown

We use a local variable hwcap to refer to the element of the hwcaps array which we are currently checking. When checking for the relevant hwcap bit being set in testing we were dereferencing hwcaps rather than hwcap in fetching the AT_HWCAP to use, which is perfectly valid C but means we were always checking the bit was set in the hwcap for whichever feature is first in the array. Remove the stray s.

[...]

Applied to arm64 (for-next/kselftest), thanks!

[1/1] kselftest/arm64: Fix typo in hwcap check

      https://git.kernel.org/arm64/c/33060a64901e
Signature · 1 line
Catalin