Skip to content

Commit 3c32869

Browse files
Dan Carpenterrolandd
authored andcommitted
IB/ipath: Silence a static checker warning
I have a static checker which complains that 0x255 is too high for the "dev->opstats[opcode]" array. It turns out that the hardware has already validated the opcode at this point so it can't actually overflow. However, silencing the warning is good and this matches how the opcode is treated in qib_ib_rcv() as well. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
1 parent a937536 commit 3c32869

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/infiniband/hw/ipath/ipath_verbs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ void ipath_ib_rcv(struct ipath_ibdev *dev, void *rhdr, void *data,
620620
goto bail;
621621
}
622622

623-
opcode = be32_to_cpu(ohdr->bth[0]) >> 24;
623+
opcode = (be32_to_cpu(ohdr->bth[0]) >> 24) & 0x7f;
624624
dev->opstats[opcode].n_bytes += tlen;
625625
dev->opstats[opcode].n_packets++;
626626

0 commit comments

Comments
 (0)