linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fpga: machxo2-spi: Fix missing error code in machxo2_write_complete()
@ 2021-08-13  6:40 Jiapeng Chong
  2021-08-18  2:47 ` Moritz Fischer
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-08-13  6:40 UTC (permalink / raw)
  To: mdf; +Cc: trix, linux-fpga, linux-kernel, Jiapeng Chong

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'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: 88fb3a002330 ("fpga: lattice machxo2: Add Lattice MachXO2
support")
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/fpga/machxo2-spi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/fpga/machxo2-spi.c b/drivers/fpga/machxo2-spi.c
index b4a530a..ea2ec3c 100644
--- a/drivers/fpga/machxo2-spi.c
+++ b/drivers/fpga/machxo2-spi.c
@@ -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);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fpga: machxo2-spi: Fix missing error code in machxo2_write_complete()
  2021-08-13  6:40 [PATCH] fpga: machxo2-spi: Fix missing error code in machxo2_write_complete() Jiapeng Chong
@ 2021-08-18  2:47 ` Moritz Fischer
  0 siblings, 0 replies; 2+ messages in thread
From: Moritz Fischer @ 2021-08-18  2:47 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: Tom Rix, linux-fpga, Linux Kernel Mailing List

On Thu, Aug 12, 2021 at 11:41 PM Jiapeng Chong
<jiapeng.chong@linux.alibaba.com> wrote:
>
> 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'.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Fixes: 88fb3a002330 ("fpga: lattice machxo2: Add Lattice MachXO2
> support")
This shouldn't line-break.
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/fpga/machxo2-spi.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/fpga/machxo2-spi.c b/drivers/fpga/machxo2-spi.c
> index b4a530a..ea2ec3c 100644
> --- a/drivers/fpga/machxo2-spi.c
> +++ b/drivers/fpga/machxo2-spi.c
> @@ -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);
> --
> 1.8.3.1
>

Applied to 'fixes' with modifications to commit message,

Moritz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-18  2:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13  6:40 [PATCH] fpga: machxo2-spi: Fix missing error code in machxo2_write_complete() Jiapeng Chong
2021-08-18  2:47 ` Moritz Fischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).