lkml.org 
[lkml]   [2020]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] IB/hfi1: Fix logical condition in msix_request_irq
On Thu, Jan 16, 2020 at 2:27 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> Clang warns:
>
> drivers/infiniband/hw/hfi1/msix.c:136:22: warning: overlapping
> comparisons always evaluate to false [-Wtautological-overlap-compare]
> if (type < IRQ_SDMA && type >= IRQ_OTHER)
> ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
> 1 warning generated.
>
> It is impossible for something to be less than 0 (IRQ_SDMA) and greater
> than or equal to 3 (IRQ_OTHER) at the same time. A logical OR should
> have been used to keep the same logic as before.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/841
> Fixes: 13d2a8384bd9 ("IB/hfi1: Decouple IRQ name from type")
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Thanks for the patch. LGTM.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
> drivers/infiniband/hw/hfi1/msix.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/hfi1/msix.c b/drivers/infiniband/hw/hfi1/msix.c
> index 4a620cf80588..db82db497b2c 100644
> --- a/drivers/infiniband/hw/hfi1/msix.c
> +++ b/drivers/infiniband/hw/hfi1/msix.c
> @@ -133,7 +133,7 @@ static int msix_request_irq(struct hfi1_devdata *dd, void *arg,
> if (nr == dd->msix_info.max_requested)
> return -ENOSPC;
>
> - if (type < IRQ_SDMA && type >= IRQ_OTHER)
> + if (type < IRQ_SDMA || type >= IRQ_OTHER)

--
Thanks,
~Nick Desaulniers

\
 
 \ /
  Last update: 2020-01-16 23:44    [W:0.062 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site