lkml.org 
[lkml]   [2020]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] altera-stapl: remove the unreached switch case
Date
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)

\
 
 \ /
  Last update: 2020-11-13 12:23    [W:0.025 / U:1.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site