]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/uverbs: Silence shiftTooManyBitsSigned warning
authorLeon Romanovsky <leonro@mellanox.com>
Mon, 20 Jul 2020 17:56:27 +0000 (20:56 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 24 Jul 2020 19:53:02 +0000 (16:53 -0300)
Fix reported by kbuild warning.

   drivers/infiniband/core/uverbs_cmd.c:1897:47: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
    BUILD_BUG_ON(IB_USER_LAST_QP_ATTR_MASK == (1 << 31));
                                                 ^
Link: https://lore.kernel.org/r/20200720175627.1273096-3-leon@kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/uverbs_cmd.c

index 119646478fa7fea33a1a360b64c0dac32543daf9..2fbc583d5bddffac2e44ec8a84eab5ed7034f3a9 100644 (file)
@@ -1897,7 +1897,7 @@ static int ib_uverbs_ex_modify_qp(struct uverbs_attr_bundle *attrs)
         * Last bit is reserved for extending the attr_mask by
         * using another field.
         */
-       BUILD_BUG_ON(IB_USER_LAST_QP_ATTR_MASK == (1 << 31));
+       BUILD_BUG_ON(IB_USER_LAST_QP_ATTR_MASK == (1ULL << 31));
 
        if (cmd.base.attr_mask &
            ~((IB_USER_LAST_QP_ATTR_MASK << 1) - 1))