summaryrefslogtreecommitdiffstats
path: root/rayer_spi.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2022-10-08 12:14:42 +1100
committerEdward O'Callaghan <quasisec@chromium.org>2022-10-22 00:44:27 +0000
commit1837f0df2798b2fc6f953853976c622c8e26637b (patch)
tree330ea9b0aecf065544246d2754e7914c04a7a2ed /rayer_spi.c
parent68e4d5cc4ee53b0a1f23f5904589996b3d58e167 (diff)
downloadflashrom-1837f0df2798b2fc6f953853976c622c8e26637b.tar.gz
flashrom-1837f0df2798b2fc6f953853976c622c8e26637b.tar.bz2
flashrom-1837f0df2798b2fc6f953853976c622c8e26637b.zip
rayer_spi.c: Drop lpt_outbyte intermediate var
The intermediate variable in this case serves no extra assistance in readability or additional control flow branching. Just assign the result directly into the driver state tracker. Change-Id: Idedabb7b1c401d666b3b7e621e75704c7e765fd1 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/68232 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'rayer_spi.c')
-rw-r--r--rayer_spi.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/rayer_spi.c b/rayer_spi.c
index 8eee7ab82..41c536424 100644
--- a/rayer_spi.c
+++ b/rayer_spi.c
@@ -283,7 +283,6 @@ static int rayer_spi_init(const struct programmer_cfg *cfg)
const struct rayer_programmer *prog = rayer_spi_types;
struct rayer_pinout *pinout = NULL;
uint16_t lpt_iobase;
- uint8_t lpt_outbyte;
char *prog_type;
if (get_params(cfg, &lpt_iobase, &prog_type) < 0)
@@ -312,9 +311,6 @@ static int rayer_spi_init(const struct programmer_cfg *cfg)
if (rget_io_perms())
return 1;
- /* Get the initial value before writing to any line. */
- lpt_outbyte = INB(lpt_iobase);
-
struct rayer_spi_data *data = calloc(1, sizeof(*data));
if (!data) {
msg_perr("Unable to allocate space for SPI master data\n");
@@ -322,7 +318,8 @@ static int rayer_spi_init(const struct programmer_cfg *cfg)
}
data->pinout = pinout;
data->lpt_iobase = lpt_iobase;
- data->lpt_outbyte = lpt_outbyte;
+ /* Get the initial value before writing to any line. */
+ data->lpt_outbyte = INB(lpt_iobase);
if (pinout->shutdown)
register_shutdown(pinout->shutdown, data);