lkml.org 
[lkml]   [2022]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] i2c: at91: Initialize dma_buf in at91_twi_xfer()
On Thu, May 05, 2022 at 08:27:38AM -0700, Nathan Chancellor wrote:
> Clang warns:
>
> drivers/i2c/busses/i2c-at91-master.c:707:6: warning: variable 'dma_buf' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
> if (dev->use_dma) {
> ^~~~~~~~~~~~
> drivers/i2c/busses/i2c-at91-master.c:717:27: note: uninitialized use occurs here
> i2c_put_dma_safe_msg_buf(dma_buf, m_start, !ret);
> ^~~~~~~
>
> Initialize dma_buf to NULL, as i2c_put_dma_safe_msg_buf() is a no-op
> when the first argument is NULL, which will work for the !dev->use_dma
> case.
>
> Fixes: 03fbb903c8bf ("i2c: at91: use dma safe buffers")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1629
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Applied to for-next, thanks!

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-05-14 15:42    [W:0.057 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site