* [PATCH] altera-stapl: remove the unreached switch case
@ 2020-11-13 9:21 xiakaixu1987
2020-11-13 11:20 ` David Laight
0 siblings, 1 reply; 2+ messages in thread
From: xiakaixu1987 @ 2020-11-13 9:21 UTC (permalink / raw)
To: arnd, gregkh; +Cc: linux-kernel, Kaixu Xia
From: Kaixu Xia <kaixuxia@tencent.com>
The value of the variable status must be one of the 0, -EIO and -EILSEQ, so
the switch cases -ENODATA and default are unreached. Remove them.
Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
drivers/misc/altera-stapl/altera.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/misc/altera-stapl/altera.c b/drivers/misc/altera-stapl/altera.c
index 5bdf574..8ad1e9e 100644
--- a/drivers/misc/altera-stapl/altera.c
+++ b/drivers/misc/altera-stapl/altera.c
@@ -2265,19 +2265,10 @@ static int altera_check_crc(u8 *p, s32 program_size)
"actual %04x\n", __func__, local_expected,
local_actual);
break;
- case -ENODATA:
- printk(KERN_ERR "%s: expected CRC not found, "
- "actual CRC = %04x\n", __func__,
- local_actual);
- break;
case -EIO:
printk(KERN_ERR "%s: error: format isn't "
"recognized.\n", __func__);
break;
- default:
- printk(KERN_ERR "%s: CRC function returned error "
- "code %d\n", __func__, status);
- break;
}
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH] altera-stapl: remove the unreached switch case
2020-11-13 9:21 [PATCH] altera-stapl: remove the unreached switch case xiakaixu1987
@ 2020-11-13 11:20 ` David Laight
0 siblings, 0 replies; 2+ messages in thread
From: David Laight @ 2020-11-13 11:20 UTC (permalink / raw)
To: 'xiakaixu1987@gmail.com', arnd, gregkh; +Cc: linux-kernel, Kaixu Xia
From: xiakaixu1987@gmail.com
> Sent: 13 November 2020 09:21
> From: Kaixu Xia <kaixuxia@tencent.com>
>
> The value of the variable status must be one of the 0, -EIO and -EILSEQ, so
> the switch cases -ENODATA and default are unreached. Remove them.
>
> Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
> ---
> drivers/misc/altera-stapl/altera.c | 9 ---------
> 1 file changed, 9 deletions(-)
>
> diff --git a/drivers/misc/altera-stapl/altera.c b/drivers/misc/altera-stapl/altera.c
> index 5bdf574..8ad1e9e 100644
> --- a/drivers/misc/altera-stapl/altera.c
> +++ b/drivers/misc/altera-stapl/altera.c
> @@ -2265,19 +2265,10 @@ static int altera_check_crc(u8 *p, s32 program_size)
> "actual %04x\n", __func__, local_expected,
> local_actual);
> break;
> - case -ENODATA:
> - printk(KERN_ERR "%s: expected CRC not found, "
> - "actual CRC = %04x\n", __func__,
> - local_actual);
> - break;
> case -EIO:
> printk(KERN_ERR "%s: error: format isn't "
> "recognized.\n", __func__);
> break;
> - default:
> - printk(KERN_ERR "%s: CRC function returned error "
> - "code %d\n", __func__, status);
> - break;
You ought to leave a 'default' in there.
Even if it is just the same as -EIO.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-13 11:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 9:21 [PATCH] altera-stapl: remove the unreached switch case xiakaixu1987
2020-11-13 11:20 ` David Laight
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).