From e66bb9d3121eef35c312997aacb401847249a5cb Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Mon, 6 May 2019 00:35:52 +0200 Subject: coding style: add parenthesis around the argument of sizeof The script checkpatch available in new Linux kernel offers an experimental feature for automatically fix the code in place. While still experimental, the feature works quite well for simple fixes, like parenthesis. This patch has been created automatically with the script under review for inclusion in OpenOCD, using the command: find src/ -type f -exec ./tools/scripts/checkpatch.pl \ -q --types SIZEOF_PARENTHESIS --fix-inplace -f {} \; Change-Id: I8adb325bdb0e13211f8bae8b4770ec1979c176bf Signed-off-by: Antonio Borneo Reviewed-on: http://openocd.zylin.com/5618 Reviewed-by: Andreas Fritiofson Tested-by: jenkins --- src/jtag/tcl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/jtag/tcl.c') diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index 734b9c1..f52cbd6 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -965,7 +965,7 @@ COMMAND_HANDLER(handle_scan_chain_command) while (tap) { uint32_t expected, expected_mask, ii; - snprintf(expected_id, sizeof expected_id, "0x%08x", + snprintf(expected_id, sizeof(expected_id), "0x%08x", (unsigned)((tap->expected_ids_cnt > 0) ? tap->expected_ids[0] : 0)); @@ -987,7 +987,7 @@ COMMAND_HANDLER(handle_scan_chain_command) (unsigned int)(expected_mask)); for (ii = 1; ii < tap->expected_ids_cnt; ii++) { - snprintf(expected_id, sizeof expected_id, "0x%08x", + snprintf(expected_id, sizeof(expected_id), "0x%08x", (unsigned) tap->expected_ids[ii]); if (tap->ignore_version) expected_id[2] = '*'; -- cgit v1.1