In spi_rx_tx there comes a test for execution of a code block that
allows execution if rxp is not NULL or stopping is true. However all the
code in this block relies on rxp being valid so allowing entry just if
stopping is true does not make sense. So remove this from the test
expression leaving just a NULL check for rxp.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
uint out_bytes, in_bytes;
int toread;
unsigned start = get_timer(0);
- int stopping;
int step;
out_bytes = in_bytes = todo;
- stopping = priv->skip_preamble && (flags & SPI_XFER_END) &&
- !(priv->mode & SPI_SLAVE);
-
/*
* Try to transfer words if we can. This helps read performance at
* SPI clock speeds above about 20MHz.
while (rx_lvl >= step) {
temp = readl(®s->rx_data);
if (priv->skip_preamble) {
- if (temp == SPI_PREAMBLE_END_BYTE) {
+ if (temp == SPI_PREAMBLE_END_BYTE)
priv->skip_preamble = 0;
- stopping = 0;
- }
} else {
- if (rxp || stopping) {
+ if (rxp) {
if (step == 4)
*(uint32_t *)rxp = temp;
else