1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 14:11:15 +02:00

Add str extension to extract_programmer_param function name

This patch changes the function name of extract_programmer_param() to
extract_programmer_param_str() as this function name will clearly
specify that it returns the value of the given parameter as a string.

Signed-off-by: Chinmay Lonkar <chinmay20220@gmail.com>
Change-Id: Id7b9fff4d3e1de22abd31b8123a1d237cd0f5c97
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65521
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Thomas Heijligen <src@posteo.de>
This commit is contained in:
Chinmay Lonkar
2022-06-28 21:44:04 +05:30
committed by Thomas Heijligen
parent f0fae1a9a5
commit 1bb5ddde60
31 changed files with 81 additions and 81 deletions

View File

@ -946,7 +946,7 @@ static int init_data(struct emu_data *data, enum chipbustype *dummy_buses_suppor
char *status = NULL;
int size = -1; /* size for VARIABLE_SIZE chip device */
bustext = extract_programmer_param("bus");
bustext = extract_programmer_param_str("bus");
msg_pdbg("Requested buses are: %s\n", bustext ? bustext : "default");
if (!bustext)
bustext = strdup("parallel+lpc+fwh+spi+prog");
@ -978,7 +978,7 @@ static int init_data(struct emu_data *data, enum chipbustype *dummy_buses_suppor
msg_pdbg("Support for all flash bus types disabled.\n");
free(bustext);
tmp = extract_programmer_param("spi_write_256_chunksize");
tmp = extract_programmer_param_str("spi_write_256_chunksize");
if (tmp) {
data->spi_write_256_chunksize = strtoul(tmp, &endptr, 0);
if (*endptr != '\0' || data->spi_write_256_chunksize < 1) {
@ -989,7 +989,7 @@ static int init_data(struct emu_data *data, enum chipbustype *dummy_buses_suppor
}
free(tmp);
tmp = extract_programmer_param("spi_blacklist");
tmp = extract_programmer_param_str("spi_blacklist");
if (tmp) {
i = strlen(tmp);
if (!strncmp(tmp, "0x", 2)) {
@ -1025,7 +1025,7 @@ static int init_data(struct emu_data *data, enum chipbustype *dummy_buses_suppor
}
free(tmp);
tmp = extract_programmer_param("spi_ignorelist");
tmp = extract_programmer_param_str("spi_ignorelist");
if (tmp) {
i = strlen(tmp);
if (!strncmp(tmp, "0x", 2)) {
@ -1062,7 +1062,7 @@ static int init_data(struct emu_data *data, enum chipbustype *dummy_buses_suppor
free(tmp);
/* frequency to emulate in Hz (default), KHz, or MHz */
tmp = extract_programmer_param("freq");
tmp = extract_programmer_param_str("freq");
if (tmp) {
unsigned long int freq;
char *units = tmp;
@ -1112,7 +1112,7 @@ static int init_data(struct emu_data *data, enum chipbustype *dummy_buses_suppor
}
free(tmp);
tmp = extract_programmer_param("size");
tmp = extract_programmer_param_str("size");
if (tmp) {
size = strtol(tmp, NULL, 10);
if (size <= 0 || (size % 1024 != 0)) {
@ -1124,7 +1124,7 @@ static int init_data(struct emu_data *data, enum chipbustype *dummy_buses_suppor
free(tmp);
}
tmp = extract_programmer_param("hwwp");
tmp = extract_programmer_param_str("hwwp");
if (tmp) {
if (!strcmp(tmp, "yes")) {
msg_pdbg("Emulated chip will have hardware WP enabled\n");
@ -1139,7 +1139,7 @@ static int init_data(struct emu_data *data, enum chipbustype *dummy_buses_suppor
free(tmp);
}
tmp = extract_programmer_param("emulate");
tmp = extract_programmer_param_str("emulate");
if (!tmp) {
if (size != -1) {
msg_perr("%s: size parameter is only valid for VARIABLE_SIZE chip.\n", __func__);
@ -1271,7 +1271,7 @@ static int init_data(struct emu_data *data, enum chipbustype *dummy_buses_suppor
free(tmp);
/* Should emulated flash erase to zero (yes/no)? */
tmp = extract_programmer_param("erase_to_zero");
tmp = extract_programmer_param_str("erase_to_zero");
if (tmp) {
if (data->emu_chip != EMULATE_VARIABLE_SIZE) {
msg_perr("%s: erase_to_zero parameter is not valid for real chip.\n", __func__);
@ -1291,7 +1291,7 @@ static int init_data(struct emu_data *data, enum chipbustype *dummy_buses_suppor
}
free(tmp);
status = extract_programmer_param("spi_status");
status = extract_programmer_param_str("spi_status");
if (status) {
unsigned int emu_status;
@ -1367,7 +1367,7 @@ static int dummy_init(void)
memset(data->flashchip_contents, data->erase_to_zero ? 0x00 : 0xff, data->emu_chip_size);
/* Will be freed by shutdown function if necessary. */
data->emu_persistent_image = extract_programmer_param("image");
data->emu_persistent_image = extract_programmer_param_str("image");
if (!data->emu_persistent_image) {
/* Nothing else to do. */
goto dummy_init_out;