lkml.org 
[lkml]   [2022]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: drivers/dma/imx-dma.c:1048:20: warning: cast to smaller integer type 'enum imx_dma_type' from 'const void *'
On Wed, May 25, 2022 at 09:14:30PM -0300, Fabio Estevam wrote:
> On Sun, May 1, 2022 at 11:13 PM kernel test robot <lkp@intel.com> wrote:
> >
> > Hi Fabio,
> >
> > FYI, the error/warning still remains.
> >
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head: 672c0c5173427e6b3e2a9bbb7be51ceeec78093a
> > commit: 0ab785c894e618587e83bb67e8a8e96649868ad1 dmaengine: imx-dma: Remove unused .id_table
> > date: 1 year, 5 months ago
> > config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20220502/202205021042.xPjJ6Z4J-lkp@intel.com/config)
> > compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 09325d36061e42b495d1f4c7e933e260eac260ed)
> > reproduce (this is a W=1 build):
> > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > chmod +x ~/bin/make.cross
> > # install arm64 cross compiling tool for clang build
> > # apt-get install binutils-aarch64-linux-gnu
> > # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0ab785c894e618587e83bb67e8a8e96649868ad1
> > git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > git fetch --no-tags linus master
> > git checkout 0ab785c894e618587e83bb67e8a8e96649868ad1
> > # save the config file
> > mkdir build_dir && cp config build_dir/.config
> > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/dma/
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> >
> > All warnings (new ones prefixed by >>):
> >
> > >> drivers/dma/imx-dma.c:1048:20: warning: cast to smaller integer type 'enum imx_dma_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
> > imxdma->devtype = (enum imx_dma_type)of_device_get_match_data(&pdev->dev);
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 1 warning generated.
>
> Does anyone know how to fix this clang warning?

Either an intermediate cast to uintptr_t or unsigned long or replacing
the enum cast with one of those should work. See commits:

2602dc10f9d9 ("memory: renesas-rpc-if: Silence clang warning")
10462b3558d4 ("can: mcp251x: mcp251x_can_probe(): silence clang warning")
83415669d8d8 ("can: hi311x: hi3110_can_probe(): silence clang warning")
be5aeee30e45 ("scsi: fcoe: Suppress a compiler warning")

Cheers,
Nathan

\
 
 \ /
  Last update: 2022-05-26 02:39    [W:0.044 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site