[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241009081346.7774-1-zhujun2@cmss.chinamobile.com>
Date: Wed, 9 Oct 2024 01:13:46 -0700
From: Zhu Jun <zhujun2@...s.chinamobile.com>
To: alcioa@...zon.com
Cc: linux-kernel@...r.kernel.org,
zhujun2@...s.chinamobile.com
Subject: [PATCH] nitro_enclaves: Fix the wrong format specifier
The format specifier of "unsigned int" in printf() should be "%u", not
"%d".
Signed-off-by: Zhu Jun <zhujun2@...s.chinamobile.com>
---
samples/nitro_enclaves/ne_ioctl_sample.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/samples/nitro_enclaves/ne_ioctl_sample.c b/samples/nitro_enclaves/ne_ioctl_sample.c
index 765b131c7319..5ccb45b225e2 100644
--- a/samples/nitro_enclaves/ne_ioctl_sample.c
+++ b/samples/nitro_enclaves/ne_ioctl_sample.c
@@ -818,7 +818,7 @@ int main(int argc, char *argv[])
rc = ne_alloc_user_mem_region(&ne_user_mem_regions[i]);
if (rc < 0) {
- printf("Error in alloc userspace memory region, iter %d\n", i);
+ printf("Error in alloc userspace memory region, iter %u\n", i);
goto release_enclave_fd;
}
@@ -831,7 +831,7 @@ int main(int argc, char *argv[])
for (i = 0; i < NE_DEFAULT_NR_MEM_REGIONS; i++) {
rc = ne_set_user_mem_region(enclave_fd, ne_user_mem_regions[i]);
if (rc < 0) {
- printf("Error in set memory region, iter %d\n", i);
+ printf("Error in set memory region, iter %u\n", i);
goto release_enclave_fd;
}
@@ -847,12 +847,12 @@ int main(int argc, char *argv[])
ne_vcpus[i] = 0;
rc = ne_add_vcpu(enclave_fd, &ne_vcpus[i]);
if (rc < 0) {
- printf("Error in add vcpu, iter %d\n", i);
+ printf("Error in add vcpu, iter %u\n", i);
goto release_enclave_fd;
}
- printf("Added vCPU %d to the enclave\n", ne_vcpus[i]);
+ printf("Added vCPU %u to the enclave\n", ne_vcpus[i]);
}
printf("Enclave vCPUs were added\n");
--
2.17.1
Powered by blists - more mailing lists