cheri_perms_t is a regular enum and therefore an int, not a long. GCC rightly complains that we are using %lx to print it; amend the format string accordingly.
Fixes: ("linux/cheri.h: Introduce CHERI helpers") Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com --- lib/cheri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/cheri.c b/lib/cheri.c index 3438718aa5db..c308a2c75559 100644 --- a/lib/cheri.c +++ b/lib/cheri.c @@ -25,7 +25,7 @@ build_user_cap(ptraddr_t addr, size_t len, cheri_perms_t perms, bool exact_bound ret = cheri_bounds_set(ret, len);
WARN(perms & ~root_perms, - "Permission mask %#lx discarded while creating user capability %#lp\n", + "Permission mask %#x discarded while creating user capability %#lp\n", perms & ~root_perms, ret); WARN(cheri_is_invalid(ret), "Invalid user capability created: %#lp (%s bounds requested)\n",
On 21-03-2023 09:49, Kevin Brodsky wrote:
cheri_perms_t is a regular enum and therefore an int, not a long. GCC rightly complains that we are using %lx to print it; amend the format string accordingly.
Fixes: ("linux/cheri.h: Introduce CHERI helpers") Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com
LGTM!
Tudor
lib/cheri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/cheri.c b/lib/cheri.c index 3438718aa5db..c308a2c75559 100644 --- a/lib/cheri.c +++ b/lib/cheri.c @@ -25,7 +25,7 @@ build_user_cap(ptraddr_t addr, size_t len, cheri_perms_t perms, bool exact_bound ret = cheri_bounds_set(ret, len); WARN(perms & ~root_perms,
"Permission mask %#lx discarded while creating user capability %#lp\n",
WARN(cheri_is_invalid(ret), "Invalid user capability created: %#lp (%s bounds requested)\n","Permission mask %#x discarded while creating user capability %#lp\n", perms & ~root_perms, ret);
On 21/03/2023 12:11, Tudor Cretu wrote:
On 21-03-2023 09:49, Kevin Brodsky wrote:
cheri_perms_t is a regular enum and therefore an int, not a long. GCC rightly complains that we are using %lx to print it; amend the format string accordingly.
Fixes: ("linux/cheri.h: Introduce CHERI helpers") Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com
LGTM!
Tudor
Thanks for the review! Now in next.
Kevin
lib/cheri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/cheri.c b/lib/cheri.c index 3438718aa5db..c308a2c75559 100644 --- a/lib/cheri.c +++ b/lib/cheri.c @@ -25,7 +25,7 @@ build_user_cap(ptraddr_t addr, size_t len, cheri_perms_t perms, bool exact_bound ret = cheri_bounds_set(ret, len); WARN(perms & ~root_perms, - "Permission mask %#lx discarded while creating user capability %#lp\n", + "Permission mask %#x discarded while creating user capability %#lp\n", perms & ~root_perms, ret); WARN(cheri_is_invalid(ret), "Invalid user capability created: %#lp (%s bounds requested)\n",
linux-morello@op-lists.linaro.org