tests/binder: add missing parentheses in print_trans_data()
Ondrej Mosnáček
reviewerPATCH 1/1 tests/binder: add missing parentheses in print_trans_data()
The newly added casts were meant to convert the result of the '&' operation, not just the left operand. Add parentheses to fix that.
--- tests/binder/binder_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/binder/binder_common.c +2 -2
@@ -127,12 +127,12 @@ void print_trans_data(const struct binder_transaction_data *txn_in) }#if HAVE_BINDERFS printf ("\tflags: priority: 0x%lx accept FDS: %s request security CTX: %s\n" , - (long unsigned )obj->flags &FLAT_BINDER_FLAG_PRIORITY_MASK , + (long unsigned )(obj->flags &FLAT_BINDER_FLAG_PRIORITY_MASK ), obj->flags &FLAT_BINDER_FLAG_ACCEPTS_FDS ?"YES" :"NO" , obj->flags &FLAT_BINDER_FLAG_TXN_SECURITY_CTX ?"YES" :"NO" );#else printf ("\tflags: priority: 0x%lx accept FDS: %s\n" , - (long unsigned )obj->flags &FLAT_BINDER_FLAG_PRIORITY_MASK , + (long unsigned )(obj->flags &FLAT_BINDER_FLAG_PRIORITY_MASK ), obj->flags &FLAT_BINDER_FLAG_ACCEPTS_FDS ?"YES" :"NO" );#endif printf ("\tcookie: %llx\n" , (long long unsigned )obj->cookie);
Signature · 1 line
2.54.0
Quoted 6 lines · Ondrej Mosnáček
The newly added casts were meant to convert the result of the '&' operation, not just the left operand. Add parentheses to fix that.
Fixes 705ddfdc5ae5 ("tests/binder: fix compiler warnings on ppc64le")Signed-off-by Ondrej Mosnáček <[email protected]>
Not new to this but I did wonder - why "long unsigned" rather than " unsigned long"? No real difference, just used to seeing it the other way around.
Ondrej Mosnáček
reviewerQuoted 6 lines · Stephen Smalley
Quoted 4 lines · Ondrej Mosnáček
The newly added casts were meant to convert the result of the '&' operation, not just the left operand. Add parentheses to fix that.
Quoted 8 lines
Quoted 2 lines
Fixes 705ddfdc5ae5 ("tests/binder: fix compiler warnings on ppc64le")Signed-off-by Ondrej Mosnáček <[email protected]>Acked-by Stephen Smalley <[email protected]>Not new to this but I did wonder - why "long unsigned" rather than " unsigned long"? No real difference, just used to seeing it the other way around.
Just to make it match the order in the format string (%llu -> long long unsigned). I admit it looks a bit weird, but at least it emphasizes that the cast corresponds to what is in the format string (and makes it a bit easier to visually verify that they match).
Ondrej Mosnáček
reviewerQuoted 10 lines · Stephen Smalley
Quoted 6 lines · Ondrej Mosnáček
The newly added casts were meant to convert the result of the '&' operation, not just the left operand. Add parentheses to fix that.
Fixes 705ddfdc5ae5 ("tests/binder: fix compiler warnings on ppc64le")Signed-off-by Ondrej Mosnáček <[email protected]>Acked-by Stephen Smalley <[email protected]>
Applied: https://github.com/SELinuxProject/selinux-testsuite/commit/3d95be0e967bb088aae6989fa283ecd07bc833e1