From cfbdf9608614cafe561cbc2342b297cba2cd34e3 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Fri, 25 Nov 2016 12:22:32 -0800 Subject: [PATCH] usb_updater: use same endian conversion functions This is just a clean up patch, unifying all cases where endian conversions are used in the usb updater source code. BRANCH=none BUG=none TEST=usb update of cr50 is still possible on gru (which uses the code being changed). Change-Id: I362e9762493854b4fdbb9ec15c2cb363003f258a Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/414443 Reviewed-by: Mary Ruthven --- extra/usb_updater/usb_updater.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/usb_updater/usb_updater.c b/extra/usb_updater/usb_updater.c index 574ca9f890..03591cfe47 100644 --- a/extra/usb_updater/usb_updater.c +++ b/extra/usb_updater/usb_updater.c @@ -227,12 +227,12 @@ static int tpm_send_pkt(int fd, unsigned int digest, unsigned int addr, len = size + sizeof(struct upgrade_pkt); - out->tag = __cpu_to_be16(0x8001); - out->length = __cpu_to_be32(len); - out->ordinal = __cpu_to_be32(EXT_CMD); - out->subcmd = __cpu_to_be16(subcmd); + out->tag = htobe16(0x8001); + out->length = htobe32(len); + out->ordinal = htobe32(EXT_CMD); + out->subcmd = htobe16(subcmd); out->digest = digest; - out->address = __cpu_to_be32(addr); + out->address = htobe32(addr); memcpy(out->data, data, size); #ifdef DEBUG {