Thread (4 messages) flat view 4 messages, 4 authors, 2020-11-25

Re: [PATCH] powerpc/powernv/sriov: fix unsigned int win compared to less than zero

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2020-11-17 03:07:57
Also in: lkml

Andrew Donnellan [off-list ref] writes:
On 10/11/20 10:19 pm, xiakaixu1987@gmail.com wrote:
quoted
From: Kaixu Xia <redacted>

Fix coccicheck warning:

./arch/powerpc/platforms/powernv/pci-sriov.c:443:7-10: WARNING: Unsigned expression compared with zero: win < 0
./arch/powerpc/platforms/powernv/pci-sriov.c:462:7-10: WARNING: Unsigned expression compared with zero: win < 0

Reported-by: Tosk Robot <redacted>
Signed-off-by: Kaixu Xia <redacted>
This seems like the right fix, the value assigned to win can indeed be 
-1 so it should be signed. Thanks for sending the patch.

Reviewed-by: Andrew Donnellan <redacted>
I'll add:

  Fixes: 39efc03e3ee8 ("powerpc/powernv/sriov: Move M64 BAR allocation into a helper")

Which I think is the culprit as it changed:

  if (win >= phb->ioda.m64_bar_idx + 1)

to:

  if (win < 0)


cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help