lkml.org 
[lkml]   [2019]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] dmaengine: mv_xor_v2: Fix -Wshift-negative-value
On Wed, Jun 12, 2019 at 3:54 PM 'Nathan Huckleberry' via Clang Built
Linux <clang-built-linux@googlegroups.com> wrote:
> 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>
> ---
> drivers/dma/mv_xor_v2.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c
> index fa5dab481203..5d2e0d1f3ec9 100644
> --- a/drivers/dma/mv_xor_v2.c
> +++ b/drivers/dma/mv_xor_v2.c
> @@ -261,16 +259,15 @@ void mv_xor_v2_enable_imsg_thrd(struct mv_xor_v2_device *xor_dev)
>
> /* Configure threshold of number of descriptors, and enable timer */
> reg = readl(xor_dev->dma_base + MV_XOR_V2_DMA_IMSG_THRD_OFF);
> - reg &= (~MV_XOR_V2_DMA_IMSG_THRD_MASK << MV_XOR_V2_DMA_IMSG_THRD_SHIFT);
> - reg |= (MV_XOR_V2_DONE_IMSG_THRD << MV_XOR_V2_DMA_IMSG_THRD_SHIFT);
> + reg &= (~MV_XOR_V2_DMA_IMSG_THRD_MASK);
> + reg |= (MV_XOR_V2_DONE_IMSG_THRD);
> reg |= MV_XOR_V2_DMA_IMSG_TIMER_EN;
> writel(reg, xor_dev->dma_base + MV_XOR_V2_DMA_IMSG_THRD_OFF);
>
> /* Configure Timer Threshold */
> reg = readl(xor_dev->dma_base + MV_XOR_V2_DMA_IMSG_TMOT);
> - reg &= (~MV_XOR_V2_DMA_IMSG_TIMER_THRD_MASK <<
> - MV_XOR_V2_DMA_IMSG_TIMER_THRD_SHIFT);
> - reg |= (MV_XOR_V2_TIMER_THRD << MV_XOR_V2_DMA_IMSG_TIMER_THRD_SHIFT);
> + reg &= (~MV_XOR_V2_DMA_IMSG_TIMER_THRD_MASK);
> + reg |= (MV_XOR_V2_TIMER_THRD);

Don't need the parentheses anymore. Please send a v2.

--
Thanks,
~Nick Desaulniers

\
 
 \ /
  Last update: 2019-06-13 19:03    [W:0.034 / U:16.612 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site