summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2019-03-13 16:29:44 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-03-17 17:32:43 -0700
commit519a9c967c2e883aebcf5ee00a23131e8e51c515 (patch)
treefc7a608db6b1f0a1814dc84b8ee1cbfeeda5869d /extra
parent4435080f07a8e11560bd2b39ee23a2c7d945edf5 (diff)
downloadchrome-ec-519a9c967c2e883aebcf5ee00a23131e8e51c515.tar.gz
gsctool: noop clean up
Replace C++ style comments with C style comments and alphabetize the help output. BRANCH=none BUG=none TEST=gsctool still builds, -h output is ordered. Change-Id: I1a6f10873c123d61773911e97cbf32fce7447ff7 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1525147 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
Diffstat (limited to 'extra')
-rw-r--r--extra/usb_updater/gsctool.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c
index 996ac42749..44cd39938e 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -547,12 +547,6 @@ static void usage(int errs)
" Get or set Info1 board ID fields\n"
" ID could be 32 bit hex or 4 "
"character string.\n"
- " -S,--sn_bits SN_1:SN_2:SN_3\n"
- " Set Info1 SN bits fields.\n"
- " SN_n should be 32 bit hex.\n"
- " -R,--sn_rma_inc RMA_INC\n"
- " Increment SN RMA count by RMA_INC.\n"
- " RMA_INC should be 0-7.\n"
" -k,--ccd_lock Lock CCD\n"
" -M,--machine Output in a machine-friendly way. "
"Effective with -b, -f, -i, and -O.\n"
@@ -567,9 +561,15 @@ static void usage(int errs)
" Set or clear CCD password. Use\n"
" 'clear:<cur password>' to clear it\n"
" -p,--post_reset Request post reset after transfer\n"
+ " -R,--sn_rma_inc RMA_INC\n"
+ " Increment SN RMA count by RMA_INC.\n"
+ " RMA_INC should be 0-7.\n"
" -r,--rma_auth [auth_code]\n"
" Request RMA challenge, process "
"RMA authentication code\n"
+ " -S,--sn_bits SN_1:SN_2:SN_3\n"
+ " Set Info1 SN bits fields.\n"
+ " SN_n should be 32 bit hex.\n"
" -s,--systemdev Use /dev/tpm0 (-d is ignored)\n"
" -t,--trunks_send Use `trunks_send --raw' "
"(-d is ignored)\n"
@@ -1330,24 +1330,29 @@ static void print_machine_output(const char *key, const char *format, ...)
*/
static int show_headers_versions(const void *image, bool show_machine_output)
{
- // There are 2 FW slots in an image, and each slot has 2 sections, RO
- // and RW. The 2 slots should have identical FW versions and board IDs.
+ /*
+ * There are 2 FW slots in an image, and each slot has 2 sections, RO
+ * and RW. The 2 slots should have identical FW versions and board
+ * IDs.
+ */
const struct {
const char *name;
uint32_t offset;
} sections[] = {
- // Slot A
+ /* Slot A. */
{"RO", CONFIG_RO_MEM_OFF},
{"RW", CONFIG_RW_MEM_OFF},
- // Slot B
+ /* Slot B. */
{"RO", CHIP_RO_B_MEM_OFF},
{"RW", CONFIG_RW_B_MEM_OFF}
};
const size_t kNumSlots = 2;
const size_t kNumSectionsPerSlot = 2;
- // String representation of FW version (<epoch>:<major>:<minor>), one
- // string for each FW section.
+ /*
+ * String representation of FW version (<epoch>:<major>:<minor>), one
+ * string for each FW section.
+ */
char ro_fw_ver[kNumSlots][MAX_FW_VER_LENGTH];
char rw_fw_ver[kNumSlots][MAX_FW_VER_LENGTH];
@@ -1371,13 +1376,13 @@ static int show_headers_versions(const void *image, bool show_machine_output)
size_t j;
if (sections[i].name[1] == 'O') {
- // RO
+ /* RO. */
snprintf(ro_fw_ver[slot_idx], MAX_FW_VER_LENGTH,
"%d.%d.%d", h->epoch_, h->major_, h->minor_);
- // No need to read board ID in an RO section.
+ /* No need to read board ID in an RO section. */
continue;
} else {
- // RW
+ /* RW. */
snprintf(rw_fw_ver[slot_idx], MAX_FW_VER_LENGTH,
"%d.%d.%d", h->epoch_, h->major_, h->minor_);
}
@@ -2176,10 +2181,12 @@ int main(int argc, char *argv[])
int sn_inc_rma = 0;
uint8_t sn_inc_rma_arg;
- // Explicitly sets buffering type to line buffered so that output lines
- // can be written to pipe instantly. This is needed when the
- // cr50-verify-ro.sh execution in verify_ro is moved from crosh to
- // debugd.
+ /*
+ * Explicitly sets buffering type to line buffered so that output
+ * lines can be written to pipe instantly. This is needed when the
+ * cr50-verify-ro.sh execution in verify_ro is moved from crosh to
+ * debugd.
+ */
setlinebuf(stdout);
progname = strrchr(argv[0], '/');