From: Sahil Malhotra Date: Fri, 29 Nov 2024 11:46:48 +0000 (+0100) Subject: optee: fix format string for printing optee build_id X-Git-Tag: v6.14-rc1~102^2~11^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ff7d092dce0b2273dce4b8d33fa5856679dd25b;p=thirdparty%2Fkernel%2Flinux.git optee: fix format string for printing optee build_id There has been a recent change in OP-TEE to print 8 and 16 character commit id for 32bit and 64bit architecture respectively. In case if commit id is starting with 0 like 04d1c612ec7beaede073b8c it is printing revision as below removing leading 0 "optee: revision 4.4 (4d1c612ec7beaed)" Signed-off-by: Sahil Malhotra Reviewed-by: Jerome Forissier Reviewed-by: Sumit Garg Link: https://lore.kernel.org/r/20241129114648.3048941-1-sahil.malhotra@nxp.com Signed-off-by: Jens Wiklander --- diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c index 3e33cf2af73bb..f0c3ac1103bb5 100644 --- a/drivers/tee/optee/smc_abi.c +++ b/drivers/tee/optee/smc_abi.c @@ -1272,8 +1272,9 @@ static void optee_msg_get_os_revision(optee_invoke_fn *invoke_fn) &res.smccc); if (res.result.build_id) - pr_info("revision %lu.%lu (%08lx)", res.result.major, - res.result.minor, res.result.build_id); + pr_info("revision %lu.%lu (%0*lx)", res.result.major, + res.result.minor, (int)sizeof(res.result.build_id) * 2, + res.result.build_id); else pr_info("revision %lu.%lu", res.result.major, res.result.minor); }