aboutsummaryrefslogtreecommitdiffstats
path: root/dummyflasher.c
diff options
context:
space:
mode:
authorChinmay Lonkar <chinmay20220@gmail.com>2022-06-28 21:44:04 +0530
committerThomas Heijligen <src@posteo.de>2022-07-02 14:34:19 +0000
commit1bb5ddde6048b9819d18082f71640c007c911f2a (patch)
treed5a74b4fa4f2cdcf22af5b8c8d442231eaf14df4 /dummyflasher.c
parentf0fae1a9a56349f055c441d1822234590679d95c (diff)
downloadflashrom-1bb5ddde6048b9819d18082f71640c007c911f2a.tar.gz
flashrom-1bb5ddde6048b9819d18082f71640c007c911f2a.tar.bz2
flashrom-1bb5ddde6048b9819d18082f71640c007c911f2a.zip
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>
Diffstat (limited to 'dummyflasher.c')
-rw-r--r--dummyflasher.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/dummyflasher.c b/dummyflasher.c
index faccb5f7..acf6e8d1 100644
--- a/dummyflasher.c
+++ b/dummyflasher.c
@@ -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;