Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/68232 )
Change subject: rayer_spi.c: Drop lpt_outbyte intermediate var ......................................................................
rayer_spi.c: Drop lpt_outbyte intermediate var
The itermediate 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 --- M rayer_spi.c 1 file changed, 17 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/32/68232/1
diff --git a/rayer_spi.c b/rayer_spi.c index a64496d..14eb0ea 100644 --- a/rayer_spi.c +++ b/rayer_spi.c @@ -283,7 +283,6 @@ 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 (rget_io_perms()) @@ -312,9 +311,6 @@ msg_pinfo("Using %s pinout.\n", prog->description); pinout = (struct rayer_pinout *)prog->dev_data;
- /* 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 @@ } 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);