tpm: simplify: tpm_set_global_lock()
PATCH 1/1 tpm: simplify: tpm_set_global_lock()
When in pack_byte_string() memcpy() is called for size 0 the source buffer address has no relevance. So we can use NULL here.
Signed-off-by Heinrich Schuchardt <[email protected]>
--- lib/tpm-v1.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
lib/tpm-v1.c +1 -3
@@ -211,9 +211,7 @@ u32 tpm_nv_write_value(struct udevice *dev, u32 index, const void *data,uint32_t tpm_set_global_lock (struct udevice *dev) { -u32 x; - -return tpm_nv_write_value (dev,TPM_NV_INDEX_0 , (uint8_t *)&x,0 ); +return tpm_nv_write_value (dev,TPM_NV_INDEX_0 ,NULL ,0 ); } u32 tpm_extend(struct udevice *dev, u32 index, const void *in_digest,
Signature · 1 line
2.20.1
PATCH 1/1 tpm: simplify: tpm_set_global_lock()
Quoted 8 lines · Heinrich Schuchardt
When in
pack_byte_string()memcpy()is called for size 0 the source buffer address has no relevance. So we can use NULL here.Signed-off-by Heinrich Schuchardt <[email protected]>--- lib/tpm-v1.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Reviewed-by Simon Glass <[email protected]>
PATCH 1/1 tpm: simplify: tpm_set_global_lock()
In reply to Heinrich SchuchardtQuoted 5 lines · Heinrich Schuchardt
When in
pack_byte_string()memcpy()is called for size 0 the source buffer address has no relevance. So we can use NULL here.Signed-off-by Heinrich Schuchardt <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190219/6c20a27e/attachment.sig>