mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Fabio Estevam <festevam@gmail.com>
Cc: kernel test robot <lkp@intel.com>,
	llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Vinod Koul <vkoul@kernel.org>
Subject: Re: drivers/dma/imx-dma.c:1048:20: warning: cast to smaller integer type 'enum imx_dma_type' from 'const void *'
Date: Wed, 25 May 2022 17:38:45 -0700	[thread overview]
Message-ID: <Yo7MFbwDyT+1lzcr@dev-arch.thelio-3990X> (raw)
In-Reply-To: <CAOMZO5Dg8_vDbW0vau4YFspZZ-RS=in8xEavkyYvBAQB41xTWA@mail.gmail.com>

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

  reply	other threads:[~2022-05-26  0:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02  2:13 kernel test robot
2022-05-26  0:14 ` Fabio Estevam
2022-05-26  0:38   ` Nathan Chancellor [this message]
2022-05-26  0:55     ` Fabio Estevam
  -- strict thread matches above, loose matches on Subject: below --
2021-09-28  8:58 kernel test robot
2021-08-14 13:43 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yo7MFbwDyT+1lzcr@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=festevam@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®