Nico Huber submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Edward O'Callaghan: Looks good to me, approved
buspirate_spi.c: Drop bp_ prefix for spi data struct members

The name of the struct type already contains bp_ prefix, so
prefix doesn't need to be repeated in members name.

BUG=b:185191942
TEST=builds

Change-Id: Ia463e3f58497e4b10be072bdd29244f4868098e7
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/54886
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
---
M buspirate_spi.c
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/buspirate_spi.c b/buspirate_spi.c
index 8c84261..04b8fde 100644
--- a/buspirate_spi.c
+++ b/buspirate_spi.c
@@ -51,8 +51,8 @@
#endif

struct bp_spi_data {
- unsigned char *bp_commbuf;
- int bp_commbufsize;
+ unsigned char *commbuf;
+ int commbufsize;
};

static int buspirate_commbuf_grow(int bufsize, unsigned char **bp_commbuf, int *bp_commbufsize)
@@ -165,7 +165,7 @@
static int buspirate_spi_shutdown(void *data)
{
struct bp_spi_data *bp_data = data;
- unsigned char *const bp_commbuf = bp_data->bp_commbuf;
+ unsigned char *const bp_commbuf = bp_data->commbuf;
int ret = 0, ret2 = 0;
/* No need to allocate a buffer here, we know that bp_commbuf is at least DEFAULT_BUFSIZE big. */

@@ -215,10 +215,10 @@
return SPI_INVALID_LENGTH;

/* 3 bytes extra for CS#, len, CS#. */
- if (buspirate_commbuf_grow(writecnt + readcnt + 3, &bp_data->bp_commbuf, &bp_data->bp_commbufsize))
+ if (buspirate_commbuf_grow(writecnt + readcnt + 3, &bp_data->commbuf, &bp_data->commbufsize))
return ERROR_OOM;

- unsigned char *const bp_commbuf = bp_data->bp_commbuf;
+ unsigned char *const bp_commbuf = bp_data->commbuf;

/* Assert CS# */
bp_commbuf[i++] = 0x02;
@@ -272,10 +272,10 @@
/* 5 bytes extra for command, writelen, readlen.
* 1 byte extra for Ack/Nack.
*/
- if (buspirate_commbuf_grow(max(writecnt + 5, readcnt + 1), &bp_data->bp_commbuf, &bp_data->bp_commbufsize))
+ if (buspirate_commbuf_grow(max(writecnt + 5, readcnt + 1), &bp_data->commbuf, &bp_data->commbufsize))
return ERROR_OOM;

- unsigned char *const bp_commbuf = bp_data->bp_commbuf;
+ unsigned char *const bp_commbuf = bp_data->commbuf;

/* Combined SPI write/read. */
bp_commbuf[i++] = 0x04;
@@ -401,8 +401,8 @@
free(bp_commbuf);
return 1;
}
- bp_data->bp_commbuf = bp_commbuf;
- bp_data->bp_commbufsize = bp_commbufsize;
+ bp_data->commbuf = bp_commbuf;
+ bp_data->commbufsize = bp_commbufsize;

/* This is the brute force version, but it should work.
* It is likely to fail if a previous flashrom run was aborted during a write with the new SPI commands
@@ -504,8 +504,8 @@
ret = ERROR_OOM;
goto init_err_cleanup_exit;
}
- bp_data->bp_commbuf = bp_commbuf;
- bp_data->bp_commbufsize = bp_commbufsize;
+ bp_data->commbuf = bp_commbuf;
+ bp_data->commbufsize = bp_commbufsize;
spi_master_buspirate.max_data_read = 2048;
spi_master_buspirate.max_data_write = 256;
spi_master_buspirate.command = buspirate_spi_send_command_v2;
@@ -518,8 +518,8 @@
ret = ERROR_OOM;
goto init_err_cleanup_exit;
}
- bp_data->bp_commbuf = bp_commbuf;
- bp_data->bp_commbufsize = bp_commbufsize;
+ bp_data->commbuf = bp_commbuf;
+ bp_data->commbufsize = bp_commbufsize;
spi_master_buspirate.max_data_read = 12;
spi_master_buspirate.max_data_write = 12;
spi_master_buspirate.command = buspirate_spi_send_command_v1;

To view, visit change 54886. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia463e3f58497e4b10be072bdd29244f4868098e7
Gerrit-Change-Number: 54886
Gerrit-PatchSet: 4
Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-MessageType: merged