staging/rdma/hfi1: do not use u8 to store a 32-bit integer
authorNicolas Iooss <nicolas.iooss_linux@m4x.org>
Sun, 20 Sep 2015 14:07:15 +0000 (16:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 01:42:27 +0000 (03:42 +0200)
hfi1_rc_hdrerr() stores the result of be32_to_cpu() into opcode, which
is a local variable declared as u8.  Later this variable is used in a
24-bit logical right shift, which makes clang complains (when building
an allmodconfig kernel with LLVMLinux patches):

    drivers/staging/rdma/hfi1/rc.c:2399:9: warning: shift count >= width
    of type [-Wshift-count-overflow]
        opcode >>= 24;
               ^   ~~

All of this lead to the point that opcode may have been designed to be
a 32-bit integer instead of an 8-bit one.  Therefore make this variable
u32.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rdma/hfi1/rc.c

index 632dd5ba7dfdbc36c34c8b7afdc4396477d8b169..1e9caebb02816d48374eecd4d5a137d18012de6c 100644 (file)
@@ -2383,7 +2383,7 @@ void hfi1_rc_hdrerr(
        struct hfi1_other_headers *ohdr;
        struct hfi1_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num);
        int diff;
-       u8 opcode;
+       u32 opcode;
        u32 psn;
 
        /* Check for GRH */