From: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
To: Mathieu Malaterre <malat@debian.org>
Cc: Christophe Lombard <clombard@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org,
Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Subject: Re: [PATCH] cxl: remove a dead branch
Date: Tue, 27 Mar 2018 18:53:48 +0200 [thread overview]
Message-ID: <e41ef8c7-2813-17ed-fce7-06d53fd4157a@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180322210528.22017-1-malat@debian.org>
Le 22/03/2018 à 22:05, Mathieu Malaterre a écrit :
> In commit 14baf4d9c739 ("cxl: Add guest-specific code") the following code
> was added:
>
> if (afu->crs_len < 0) {
> dev_err(&afu->dev, "Unexpected configuration record size value\n");
> return -EINVAL;
> }
>
> However the variable `crs_len` is of type u64 and cannot be compared < 0.
> Remove the dead code section. Fix the following warning treated as error
> with W=1:
Thanks for reporting it. The test, as is, is indeed useless.
However, instead of just dropping it, we are discussing on improving it.
Fred
> ../drivers/misc/cxl/guest.c:919:19: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> ---
> drivers/misc/cxl/guest.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c
> index f58b4b6c79f2..48103fcff0b5 100644
> --- a/drivers/misc/cxl/guest.c
> +++ b/drivers/misc/cxl/guest.c
> @@ -916,11 +916,6 @@ static int afu_properties_look_ok(struct cxl_afu *afu)
> return -EINVAL;
> }
>
> - if (afu->crs_len < 0) {
> - dev_err(&afu->dev, "Unexpected configuration record size value\n");
> - return -EINVAL;
> - }
> -
> return 0;
> }
>
next prev parent reply other threads:[~2018-03-27 16:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-22 21:05 [PATCH] cxl: remove a dead branch Mathieu Malaterre
2018-03-27 16:53 ` Frederic Barrat [this message]
2018-08-13 11:22 ` Michael Ellerman
2018-08-13 11:25 ` Mathieu Malaterre
2018-08-14 4:13 ` Michael Ellerman
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=e41ef8c7-2813-17ed-fce7-06d53fd4157a@linux.vnet.ibm.com \
--to=fbarrat@linux.vnet.ibm.com \
--cc=andrew.donnellan@au1.ibm.com \
--cc=clombard@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=malat@debian.org \
/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;
as well as URLs for NNTP newsgroup(s).