Skip to contentSkip to conversation

fpga: machxo2-spi: Fix missing error code in machxo2_write_complete()

PATCH Applied Jiapeng Chong 2 participants 2 messages Aug 13, 2021 – Aug 18, 2021 FPGA manager framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fpga: machxo2-spi: Fix missing error code in machxo2_write_complete()

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'ret'.

Eliminate the follow smatch warning:

drivers/fpga/machxo2-spi.c:341 machxo2_write_complete() warn: missing error code 'ret'.

Fixes 88fb3a002330 ("fpga: lattice machxo2: Add Lattice MachXO2

support")

---
 drivers/fpga/machxo2-spi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/fpga/machxo2-spi.c +1 -0
index b4a530a..ea2ec3c 100644
@@ -338,6 +338,7 @@ static int machxo2_write_complete(struct fpga_manager *mgr,
 			break;
 		if (++refreshloop == MACHXO2_MAX_REFRESH_LOOP) {
 			machxo2_cleanup(mgr);
+			ret = -EINVAL;
 			goto fail;
 		}
 	} while (1);
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 4 lines · Jiapeng Chong

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'ret'.

Quoted 8 lines

Eliminate the follow smatch warning:

drivers/fpga/machxo2-spi.c:341 machxo2_write_complete() warn: missing error code 'ret'.

Fixes 88fb3a002330 ("fpga: lattice machxo2: Add Lattice MachXO2

support")

This shouldn't line-break.

Quoted 18 lines
---
 drivers/fpga/machxo2-spi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/fpga/machxo2-spi.c +1 -1
index b4a530a..ea2ec3c 100644
@@ -338,6 +338,7 @@ static int machxo2_write_complete(struct fpga_manager *mgr,
                        break;
                if (++refreshloop == MACHXO2_MAX_REFRESH_LOOP) {
                        machxo2_cleanup(mgr);
+                       ret = -EINVAL;
                        goto fail;
                }
        } while (1);
--
Quoted 2 lines

1.8.3.1

Applied to 'fixes' with modifications to commit message,

Moritz