* [PATCH] cxl: remove a dead branch
@ 2018-03-22 21:05 Mathieu Malaterre
2018-03-27 16:53 ` Frederic Barrat
2018-08-13 11:22 ` Michael Ellerman
0 siblings, 2 replies; 5+ messages in thread
From: Mathieu Malaterre @ 2018-03-22 21:05 UTC (permalink / raw)
To: Frederic Barrat
Cc: Christophe Lombard, linuxppc-dev, Andrew Donnellan, Mathieu Malaterre
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:
../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;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] cxl: remove a dead branch
2018-03-22 21:05 [PATCH] cxl: remove a dead branch Mathieu Malaterre
@ 2018-03-27 16:53 ` Frederic Barrat
2018-08-13 11:22 ` Michael Ellerman
1 sibling, 0 replies; 5+ messages in thread
From: Frederic Barrat @ 2018-03-27 16:53 UTC (permalink / raw)
To: Mathieu Malaterre; +Cc: Christophe Lombard, linuxppc-dev, Andrew Donnellan
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;
> }
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cxl: remove a dead branch
2018-03-22 21:05 [PATCH] cxl: remove a dead branch Mathieu Malaterre
2018-03-27 16:53 ` Frederic Barrat
@ 2018-08-13 11:22 ` Michael Ellerman
2018-08-13 11:25 ` Mathieu Malaterre
1 sibling, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2018-08-13 11:22 UTC (permalink / raw)
To: Mathieu Malaterre, Frederic Barrat
Cc: Mathieu Malaterre, linuxppc-dev, Christophe Lombard, Andrew Donnellan
On Thu, 2018-03-22 at 21:05:28 UTC, Mathieu Malaterre wrote:
> 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:
>
> ../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>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/e4ecafb14fd9cd77d8f4320af1922e
cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cxl: remove a dead branch
2018-08-13 11:22 ` Michael Ellerman
@ 2018-08-13 11:25 ` Mathieu Malaterre
2018-08-14 4:13 ` Michael Ellerman
0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Malaterre @ 2018-08-13 11:25 UTC (permalink / raw)
To: Frederic Barrat
Cc: linuxppc-dev, Christophe Lombard, Andrew Donnellan, Michael Ellerman
Frederic,
Could you double check with Michael what is now best to do.
Thanks
On Mon, Aug 13, 2018 at 1:23 PM Michael Ellerman
<patch-notifications@ellerman.id.au> wrote:
>
> On Thu, 2018-03-22 at 21:05:28 UTC, Mathieu Malaterre wrote:
> > 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:
> >
> > ../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>
>
> Applied to powerpc next, thanks.
>
> https://git.kernel.org/powerpc/c/e4ecafb14fd9cd77d8f4320af1922e
>
> cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cxl: remove a dead branch
2018-08-13 11:25 ` Mathieu Malaterre
@ 2018-08-14 4:13 ` Michael Ellerman
0 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2018-08-14 4:13 UTC (permalink / raw)
To: Mathieu Malaterre, Frederic Barrat
Cc: linuxppc-dev, Christophe Lombard, Andrew Donnellan
Mathieu Malaterre <malat@debian.org> writes:
> Frederic,
>
> Could you double check with Michael what is now best to do.
I decided it had been long enough (since March), so I just merged it.
If Fred et. al. want to do something better they can send me another
patch on top of it.
cheers
> On Mon, Aug 13, 2018 at 1:23 PM Michael Ellerman
> <patch-notifications@ellerman.id.au> wrote:
>>
>> On Thu, 2018-03-22 at 21:05:28 UTC, Mathieu Malaterre wrote:
>> > 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:
>> >
>> > ../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>
>>
>> Applied to powerpc next, thanks.
>>
>> https://git.kernel.org/powerpc/c/e4ecafb14fd9cd77d8f4320af1922e
>>
>> cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-08-14 4:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22 21:05 [PATCH] cxl: remove a dead branch Mathieu Malaterre
2018-03-27 16:53 ` Frederic Barrat
2018-08-13 11:22 ` Michael Ellerman
2018-08-13 11:25 ` Mathieu Malaterre
2018-08-14 4:13 ` Michael Ellerman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.