mirror of
				https://review.coreboot.org/flashrom.git
				synced 2025-11-04 07:00:39 +01:00 
			
		
		
		
	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>
This commit is contained in:
		
				
					committed by
					
						
						Nico Huber
					
				
			
			
				
	
			
			
			
						parent
						
							048bbe0323
						
					
				
				
					commit
					5af677a81d
				
			@@ -51,8 +51,8 @@ static int buspirate_serialport_setup(char *dev)
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct bp_spi_data {
 | 
					struct bp_spi_data {
 | 
				
			||||||
	unsigned char *bp_commbuf;
 | 
						unsigned char *commbuf;
 | 
				
			||||||
	int bp_commbufsize;
 | 
						int commbufsize;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int buspirate_commbuf_grow(int bufsize, unsigned char **bp_commbuf, int *bp_commbufsize)
 | 
					static int buspirate_commbuf_grow(int bufsize, unsigned char **bp_commbuf, int *bp_commbufsize)
 | 
				
			||||||
@@ -165,7 +165,7 @@ static const struct buspirate_speeds serialspeeds[] = {
 | 
				
			|||||||
static int buspirate_spi_shutdown(void *data)
 | 
					static int buspirate_spi_shutdown(void *data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct bp_spi_data *bp_data = 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;
 | 
						int ret = 0, ret2 = 0;
 | 
				
			||||||
	/* No need to allocate a buffer here, we know that bp_commbuf is at least DEFAULT_BUFSIZE big. */
 | 
						/* No need to allocate a buffer here, we know that bp_commbuf is at least DEFAULT_BUFSIZE big. */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -215,10 +215,10 @@ static int buspirate_spi_send_command_v1(const struct flashctx *flash, unsigned
 | 
				
			|||||||
		return SPI_INVALID_LENGTH;
 | 
							return SPI_INVALID_LENGTH;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* 3 bytes extra for CS#, len, CS#. */
 | 
						/* 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;
 | 
							return ERROR_OOM;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	unsigned char *const bp_commbuf = bp_data->bp_commbuf;
 | 
						unsigned char *const bp_commbuf = bp_data->commbuf;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Assert CS# */
 | 
						/* Assert CS# */
 | 
				
			||||||
	bp_commbuf[i++] = 0x02;
 | 
						bp_commbuf[i++] = 0x02;
 | 
				
			||||||
@@ -272,10 +272,10 @@ static int buspirate_spi_send_command_v2(const struct flashctx *flash, unsigned
 | 
				
			|||||||
	/* 5 bytes extra for command, writelen, readlen.
 | 
						/* 5 bytes extra for command, writelen, readlen.
 | 
				
			||||||
	 * 1 byte extra for Ack/Nack.
 | 
						 * 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;
 | 
							return ERROR_OOM;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	unsigned char *const bp_commbuf = bp_data->bp_commbuf;
 | 
						unsigned char *const bp_commbuf = bp_data->commbuf;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Combined SPI write/read. */
 | 
						/* Combined SPI write/read. */
 | 
				
			||||||
	bp_commbuf[i++] = 0x04;
 | 
						bp_commbuf[i++] = 0x04;
 | 
				
			||||||
@@ -401,8 +401,8 @@ static int buspirate_spi_init(void)
 | 
				
			|||||||
		free(bp_commbuf);
 | 
							free(bp_commbuf);
 | 
				
			||||||
		return 1;
 | 
							return 1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	bp_data->bp_commbuf = bp_commbuf;
 | 
						bp_data->commbuf = bp_commbuf;
 | 
				
			||||||
	bp_data->bp_commbufsize = bp_commbufsize;
 | 
						bp_data->commbufsize = bp_commbufsize;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* This is the brute force version, but it should work.
 | 
						/* 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
 | 
						 * It is likely to fail if a previous flashrom run was aborted during a write with the new SPI commands
 | 
				
			||||||
@@ -504,8 +504,8 @@ static int buspirate_spi_init(void)
 | 
				
			|||||||
			ret = ERROR_OOM;
 | 
								ret = ERROR_OOM;
 | 
				
			||||||
			goto init_err_cleanup_exit;
 | 
								goto init_err_cleanup_exit;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		bp_data->bp_commbuf = bp_commbuf;
 | 
							bp_data->commbuf = bp_commbuf;
 | 
				
			||||||
		bp_data->bp_commbufsize = bp_commbufsize;
 | 
							bp_data->commbufsize = bp_commbufsize;
 | 
				
			||||||
		spi_master_buspirate.max_data_read = 2048;
 | 
							spi_master_buspirate.max_data_read = 2048;
 | 
				
			||||||
		spi_master_buspirate.max_data_write = 256;
 | 
							spi_master_buspirate.max_data_write = 256;
 | 
				
			||||||
		spi_master_buspirate.command = buspirate_spi_send_command_v2;
 | 
							spi_master_buspirate.command = buspirate_spi_send_command_v2;
 | 
				
			||||||
@@ -518,8 +518,8 @@ static int buspirate_spi_init(void)
 | 
				
			|||||||
			ret = ERROR_OOM;
 | 
								ret = ERROR_OOM;
 | 
				
			||||||
			goto init_err_cleanup_exit;
 | 
								goto init_err_cleanup_exit;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		bp_data->bp_commbuf = bp_commbuf;
 | 
							bp_data->commbuf = bp_commbuf;
 | 
				
			||||||
		bp_data->bp_commbufsize = bp_commbufsize;
 | 
							bp_data->commbufsize = bp_commbufsize;
 | 
				
			||||||
		spi_master_buspirate.max_data_read = 12;
 | 
							spi_master_buspirate.max_data_read = 12;
 | 
				
			||||||
		spi_master_buspirate.max_data_write = 12;
 | 
							spi_master_buspirate.max_data_write = 12;
 | 
				
			||||||
		spi_master_buspirate.command = buspirate_spi_send_command_v1;
 | 
							spi_master_buspirate.command = buspirate_spi_send_command_v1;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user