Anastasia Klimchuk has uploaded this change for review.

View Change

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>
---
M buspirate_spi.c
1 file changed, 15 insertions(+), 15 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/86/54886/1
diff --git a/buspirate_spi.c b/buspirate_spi.c
index c201d38..440d12d 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;
@@ -693,8 +693,8 @@
}

/* Storing the latest values into data, commbuf migth have grown during init. */
- bp_data->bp_commbuf = bp_commbuf;
- bp_data->bp_commbufsize = bp_commbufsize;
+ bp_data->commbuf = bp_commbuf;
+ bp_data->commbufsize = bp_commbufsize;
if (register_shutdown(buspirate_spi_shutdown, bp_data) != 0) {
ret = 1;
goto init_err_cleanup_exit;

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: 1
Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-MessageType: newchange