Felix Singer has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/67882 )
Change subject: jlink_spi.c: Rename variable `arg` to `param_str` ......................................................................
jlink_spi.c: Rename variable `arg` to `param_str`
To be consistent with other programmers, rename the variable `arg` to `param_str`.
Signed-off-by: Felix Singer felixsinger@posteo.net Change-Id: I5ca561611691a550ece79727621bc93da94cf461 --- M jlink_spi.c 1 file changed, 43 insertions(+), 30 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/82/67882/1
diff --git a/jlink_spi.c b/jlink_spi.c index 21d124f..4dd108d 100644 --- a/jlink_spi.c +++ b/jlink_spi.c @@ -195,7 +195,7 @@
static int jlink_spi_init(const struct programmer_cfg *cfg) { - char *arg; + char *param_str; unsigned long speed = 0; struct jaylink_context *jaylink_ctx = NULL; struct jaylink_device_handle *jaylink_devh = NULL; @@ -203,75 +203,75 @@ struct jlink_spi_data *jlink_data = NULL; bool enable_target_power;
- arg = extract_programmer_param_str(cfg, "spispeed"); + param_str = extract_programmer_param_str(cfg, "spispeed");
- if (arg) { + if (param_str) { char *endptr;
errno = 0; - speed = strtoul(arg, &endptr, 10); + speed = strtoul(param_str, &endptr, 10);
if (*endptr != '\0' || errno != 0) { - msg_perr("Invalid SPI speed specified: %s.\n", arg); - free(arg); + msg_perr("Invalid SPI speed specified: %s.\n", param_str); + free(param_str); return 1; }
if (speed < 1) { msg_perr("SPI speed must be at least 1 kHz.\n"); - free(arg); + free(param_str); return 1; } }
- free(arg); + free(param_str);
int ret; bool use_serial_number = false; uint32_t serial_number;
- arg = extract_programmer_param_str(cfg, "serial"); + param_str = extract_programmer_param_str(cfg, "serial");
- if (arg) { - if (!strlen(arg)) { + if (param_str) { + if (!strlen(param_str)) { msg_perr("Empty serial number specified.\n"); - free(arg); + free(param_str); return 1; }
- ret = jaylink_parse_serial_number(arg, &serial_number); + ret = jaylink_parse_serial_number(param_str, &serial_number);
if (ret == JAYLINK_ERR) { - msg_perr("Invalid serial number specified: %s.\n", arg); - free(arg); + msg_perr("Invalid serial number specified: %s.\n", param_str); + free(param_str); return 1; } if (ret != JAYLINK_OK) { msg_perr("jaylink_parse_serial_number() failed: %s.\n", jaylink_strerror(ret)); - free(arg); + free(param_str); return 1; }
use_serial_number = true; }
- free(arg); + free(param_str);
reset_cs = true; - arg = extract_programmer_param_str(cfg, "cs"); + param_str = extract_programmer_param_str(cfg, "cs");
- if (arg) { - if (!strcasecmp(arg, "reset")) { + if (param_str) { + if (!strcasecmp(param_str, "reset")) { reset_cs = true; - } else if (!strcasecmp(arg, "trst")) { + } else if (!strcasecmp(param_str, "trst")) { reset_cs = false; } else { - msg_perr("Invalid chip select pin specified: '%s'.\n", arg); - free(arg); + msg_perr("Invalid chip select pin specified: '%s'.\n", param_str); + free(param_str); return 1; } }
- free(arg); + free(param_str);
if (reset_cs) msg_pdbg("Using RESET as chip select signal.\n"); @@ -279,19 +279,19 @@ msg_pdbg("Using TRST as chip select signal.\n");
enable_target_power = false; - arg = extract_programmer_param_str(cfg, "power"); + param_str = extract_programmer_param_str(cfg, "power");
- if (arg) { - if (!strcasecmp(arg, "on")) { + if (param_str) { + if (!strcasecmp(param_str, "on")) { enable_target_power = true; } else { - msg_perr("Invalid value for 'power' argument: '%s'.\n", arg); - free(arg); + msg_perr("Invalid value for 'power' argument: '%s'.\n", param_str); + free(param_str); return 1; } }
- free(arg); + free(param_str);
ret = jaylink_init(&jaylink_ctx);