mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 15:12:36 +02:00
stlinkv3_spi: Move a declaration out of for-loop head
GCC 4.8 wants an explicit `-std=c99` or something for this to work. It seems easier to keep the common declaration style. Change-Id: Ic0819f82169df4d66cc949494229b0749c06e8f6 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/38034 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Miklós Márton <martonmiklosqdev@gmail.com>
This commit is contained in:
parent
324929c3d7
commit
370a9f3eea
@ -333,6 +333,7 @@ static int stlinkv3_spi_transmit(struct flashctx *flash,
|
|||||||
int rc = 0;
|
int rc = 0;
|
||||||
int actual_length = 0;
|
int actual_length = 0;
|
||||||
uint32_t rw_status = 0;
|
uint32_t rw_status = 0;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
if (stlinkv3_spi_set_SPI_NSS(SPI_NSS_LOW)) {
|
if (stlinkv3_spi_set_SPI_NSS(SPI_NSS_LOW)) {
|
||||||
msg_perr("Failed to set the NSS pin to low\n");
|
msg_perr("Failed to set the NSS pin to low\n");
|
||||||
@ -346,7 +347,7 @@ static int stlinkv3_spi_transmit(struct flashctx *flash,
|
|||||||
command[2] = (uint8_t)write_cnt;
|
command[2] = (uint8_t)write_cnt;
|
||||||
command[3] = (uint8_t)(write_cnt >> 8);
|
command[3] = (uint8_t)(write_cnt >> 8);
|
||||||
|
|
||||||
for (unsigned int i = 0; (i < 8) && (i < write_cnt); i++)
|
for (i = 0; (i < 8) && (i < write_cnt); i++)
|
||||||
command[4+i] = write_arr[i];
|
command[4+i] = write_arr[i];
|
||||||
|
|
||||||
rc = libusb_bulk_transfer(stlinkv3_handle, STLINK_EP_OUT,
|
rc = libusb_bulk_transfer(stlinkv3_handle, STLINK_EP_OUT,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user