]> asedeno.scripts.mit.edu Git - linux.git/commit
dmaengine: mv_xor_v2: Fix -Wshift-negative-value
authorNathan Huckleberry <nhuck@google.com>
Tue, 13 Aug 2019 17:34:48 +0000 (10:34 -0700)
committerVinod Koul <vkoul@kernel.org>
Tue, 20 Aug 2019 11:36:36 +0000 (17:06 +0530)
commit698f7a9be9b2389384c69750d87a0c68202c0621
tree5264bed9136dc67fcf9cbe52ff17e6b12517598e
parent3a1144f83c531dea36bad013b04888fd6e69aa0b
dmaengine: mv_xor_v2: Fix -Wshift-negative-value

Clang produces the following warning

drivers/dma/mv_xor_v2.c:264:40: warning: shifting a negative signed value
is undefined [-Wshift-negative-value]
        reg &= (~MV_XOR_V2_DMA_IMSG_THRD_MASK <<
MV_XOR_V2_DMA_IMSG_THRD_SHIFT);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
drivers/dma/mv_xor_v2.c:271:46: warning: shifting a negative signed value
is undefined [-Wshift-negative-value]
        reg &= (~MV_XOR_V2_DMA_IMSG_TIMER_THRD_MASK <<
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^

Upon further investigation MV_XOR_V2_DMA_IMSG_THRD_SHIFT and
MV_XOR_V2_DMA_IMSG_TIMER_THRD_SHIFT are both 0. Since shifting by 0 does
nothing, these variables can be removed.

Cc: clang-built-linux@googlegroups.com
Link: https://github.com/ClangBuiltLinux/linux/issues/521
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20190813173448.109859-1-nhuck@google.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/mv_xor_v2.c