altera-stapl: remove the unreached switch case
PATCH 1/1 altera-stapl: remove the unreached switch case
From: Kaixu Xia <[email protected]>
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.
--- drivers/misc/altera-stapl/altera.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/misc/altera-stapl/altera.c +0 -9
@@ -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 ; } }
Signature · 1 line
1.8.3.1
From: [email protected]
Quoted 23 lines
Sent: 13 November 2020 09:21
From: Kaixu Xia <[email protected]>The value of the variable status must be one of the 0,
-EIOand-EILSEQ, so the switch cases-ENODATAand default are unreached. Remove them.Reported-by Tosk Robot <[email protected]>Signed-off-by Kaixu Xia <[email protected]>--- drivers/misc/altera-stapl/altera.c | 9 --------- 1 file changed, 9 deletions(-)drivers/misc/altera-stapl/altera.c +0
-3@@ -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__,
drivers/misc/altera-stapl/altera.c static int altera_check_crc(u8 *p, s32 program_size) · line 2280
Quoted 10 lines
drivers/misc/altera-stapl/altera.c +0
-6- 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)