From: David Laight <David.Laight@ACULAB.COM>
To: "'xiakaixu1987@gmail.com'" <xiakaixu1987@gmail.com>,
"arnd@arndb.de" <arnd@arndb.de>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Kaixu Xia <kaixuxia@tencent.com>
Subject: RE: [PATCH] altera-stapl: remove the unreached switch case
Date: Fri, 13 Nov 2020 11:20:56 +0000 [thread overview]
Message-ID: <0d7336acc20d4a7687bbf2a8c6de3454@AcuMS.aculab.com> (raw)
In-Reply-To: <1605259265-14129-1-git-send-email-kaixuxia@tencent.com>
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)
prev parent reply other threads:[~2020-11-13 11:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 9:21 xiakaixu1987
2020-11-13 11:20 ` David Laight [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0d7336acc20d4a7687bbf2a8c6de3454@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=kaixuxia@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xiakaixu1987@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®