Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <sahil.malhotra@nxp.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Link: https://lore.kernel.org/r/20241129114648.3048941-1-sahil.malhotra@nxp.com
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

authored by

Sahil Malhotra and committed by
Jens Wiklander
1ff7d092 fac04efc

+3 -2
+3 -2
drivers/tee/optee/smc_abi.c
··· 1272 1272 &res.smccc); 1273 1273 1274 1274 if (res.result.build_id) 1275 - pr_info("revision %lu.%lu (%08lx)", res.result.major, 1276 - res.result.minor, res.result.build_id); 1275 + pr_info("revision %lu.%lu (%0*lx)", res.result.major, 1276 + res.result.minor, (int)sizeof(res.result.build_id) * 2, 1277 + res.result.build_id); 1277 1278 else 1278 1279 pr_info("revision %lu.%lu", res.result.major, res.result.minor); 1279 1280 }