From: Nathan Chancellor <natechancellor@gmail.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: Souptick Joarder <jrdr.linux@gmail.com>,
kernel test robot <lkp@intel.com>,
kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
Linux Memory Management List <linux-mm@kvack.org>,
Vinod Koul <vkoul@kernel.org>
Subject: Re: [linux-next:master 6953/13205] drivers/dma/imx-dma.c:1048:20: warning: cast to smaller integer type 'enum imx_dma_type' from 'const void
Date: Sat, 12 Dec 2020 13:03:12 -0700 [thread overview]
Message-ID: <20201212200312.GA1773888@ubuntu-m3-large-x86> (raw)
In-Reply-To: <CAOMZO5AE6sxRrZiLws5LJ3-iVpGFx+eK=8N38863g2hG-Jmn=w@mail.gmail.com>
On Sat, Dec 12, 2020 at 12:40:22PM -0300, Fabio Estevam wrote:
> On Fri, Dec 11, 2020 at 11:54 AM Souptick Joarder <jrdr.linux@gmail.com> wrote:
>
> > of_device_get_match_data() returns void * which is assigned to enum
> > imx_dma_type type without extracting
> > the value. Anything wrong with the previous assignment ?
>
> The driver data is now passed via:
> imxdma->devtype = (enum imx_dma_type)of_device_get_match_data(&pdev->dev);
>
> There was nothing wrong with the previous assignment.
>
> The original driver used to run on non-DT platforms. Now it only runs
> on DT-platforms, which means we no longer need the platform data
> structure.
>
> Please note that this a W=1 clang warning. gcc does not complain about it.
Correct. The clang developers explicitly wanted this behavior so I moved
it under a new warning that could be disabled on regular builds but show
up on W=1 in case people wanted to fix these occurrences.
https://reviews.llvm.org/D72231
https://github.com/ClangBuiltLinux/linux/issues/887
82f2bc2fcc01 ("kbuild: Disable -Wpointer-to-enum-cast")
> Not sure how to make clang happy in this case.
Added a cast to unsigned long or uintptr_t before the cast to the enum
should fix it.
Cheers,
Nathan
next prev parent reply other threads:[~2020-12-12 20:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-11 13:46 kernel test robot
2020-12-11 14:54 ` Souptick Joarder
2020-12-12 15:40 ` Fabio Estevam
2020-12-12 20:03 ` Nathan Chancellor [this message]
2020-12-12 21:44 ` Fabio Estevam
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=20201212200312.GA1773888@ubuntu-m3-large-x86 \
--to=natechancellor@gmail.com \
--cc=clang-built-linux@googlegroups.com \
--cc=festevam@gmail.com \
--cc=jrdr.linux@gmail.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--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