diff mbox series

[kvm-unit-tests,1/4] powerpc/sprs: Fix report_kfail call

Message ID 20240602122559.118345-2-npiggin@gmail.com (mailing list archive)
State New
Headers show
Series powerpc fix and misc docs/build/CI improvements | expand

Commit Message

Nicholas Piggin June 2, 2024, 12:25 p.m. UTC
Parameters to report_kfail are wrong. String to bool conversion is not
warned by gcc, and printf format did not catch it due to string variable
being passed at the format location.

Fixes: 8f6290f0e6 ("powerpc/sprs: Specify SPRs with data rather than code")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 powerpc/sprs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Huth June 3, 2024, 4:22 a.m. UTC | #1
On 02/06/2024 14.25, Nicholas Piggin wrote:
> Parameters to report_kfail are wrong. String to bool conversion is not
> warned by gcc, and printf format did not catch it due to string variable
> being passed at the format location.
> 
> Fixes: 8f6290f0e6 ("powerpc/sprs: Specify SPRs with data rather than code")
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>   powerpc/sprs.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/powerpc/sprs.c b/powerpc/sprs.c
> index de9e87a21..33872136d 100644
> --- a/powerpc/sprs.c
> +++ b/powerpc/sprs.c
> @@ -590,7 +590,7 @@ int main(int argc, char **argv)
>   
>   		if (sprs[i].width == 32 && !(before[i] >> 32) && !(after[i] >> 32)) {
>   			/* known failure KVM migration of CTRL */
> -			report_kfail(true && i == 136,
> +			report_kfail(i == 136, pass,
>   				"%-10s(%4d):\t        0x%08lx <==>         0x%08lx",
>   				sprs[i].name, i,
>   				before[i], after[i]);

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/powerpc/sprs.c b/powerpc/sprs.c
index de9e87a21..33872136d 100644
--- a/powerpc/sprs.c
+++ b/powerpc/sprs.c
@@ -590,7 +590,7 @@  int main(int argc, char **argv)
 
 		if (sprs[i].width == 32 && !(before[i] >> 32) && !(after[i] >> 32)) {
 			/* known failure KVM migration of CTRL */
-			report_kfail(true && i == 136,
+			report_kfail(i == 136, pass,
 				"%-10s(%4d):\t        0x%08lx <==>         0x%08lx",
 				sprs[i].name, i,
 				before[i], after[i]);