gsctool: fix Board ID retrieval function

The function used to read or write Board ID value, when invoked for
reading, reports the value on the console, but does not save the read
value in the passed in structure.

Let's always save it in the structure so that the caller of this
function has access to the retrieved value.

BRANCH=none
BUG=chromium:812880
TEST=verified that 'gsctool -i' still operates as expected.

Change-Id: I9bc713386758ca6701e6b853e042652e2f392871
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/925692
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Vadim Bendebury
2018-02-19 13:12:40 -08:00
committed by chrome-bot
parent 77fe675d75
commit cd76cde217

View File

@@ -1719,19 +1719,17 @@ static void process_bid(struct transfer_descriptor *td,
size_t response_size;
if (bid_action == bid_get) {
struct board_id bid;
response_size = sizeof(bid);
response_size = sizeof(*bid);
send_vendor_command(td, VENDOR_CC_GET_BOARD_ID,
&bid, sizeof(bid),
&bid, &response_size);
bid, sizeof(*bid),
bid, &response_size);
if (response_size == sizeof(bid)) {
if (response_size == sizeof(*bid)) {
printf("Board ID space: %08x:%08x:%08x\n",
be32toh(bid.type), be32toh(bid.type_inv),
be32toh(bid.flags));
be32toh(bid->type), be32toh(bid->type_inv),
be32toh(bid->flags));
return;
}
fprintf(stderr, "Error reading board ID: response size %zd,"
" first byte %#02x\n", response_size,