All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: 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 12:40:22 -0300	[thread overview]
Message-ID: <CAOMZO5AE6sxRrZiLws5LJ3-iVpGFx+eK=8N38863g2hG-Jmn=w@mail.gmail.com> (raw)
In-Reply-To: <CAFqt6zb8O+yvwGAcv-n1mHJgWrCpOBL2XQZz4CTw_7NqDZ7VDg@mail.gmail.com>

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.

Not sure how to make clang happy in this case.

The (enum ....)of_device_get_match_data() cast is widely used in the
kernel, so this is not specific usage in this driver.


WARNING: multiple messages have this Message-ID (diff)
From: Fabio Estevam <festevam@gmail.com>
To: kbuild-all@lists.01.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 12:40:22 -0300	[thread overview]
Message-ID: <CAOMZO5AE6sxRrZiLws5LJ3-iVpGFx+eK=8N38863g2hG-Jmn=w@mail.gmail.com> (raw)
In-Reply-To: <CAFqt6zb8O+yvwGAcv-n1mHJgWrCpOBL2XQZz4CTw_7NqDZ7VDg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 829 bytes --]

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.

Not sure how to make clang happy in this case.

The (enum ....)of_device_get_match_data() cast is widely used in the
kernel, so this is not specific usage in this driver.

  reply	other threads:[~2020-12-12 15:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11 13:46 [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 kernel test robot
2020-12-11 13:46 ` kernel test robot
2020-12-11 14:54 ` Souptick Joarder
2020-12-11 14:54   ` Souptick Joarder
2020-12-12 15:40   ` Fabio Estevam [this message]
2020-12-12 15:40     ` Fabio Estevam
2020-12-12 20:03     ` Nathan Chancellor
2020-12-12 20:03       ` Nathan Chancellor
2020-12-12 21:44       ` Fabio Estevam
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='CAOMZO5AE6sxRrZiLws5LJ3-iVpGFx+eK=8N38863g2hG-Jmn=w@mail.gmail.com' \
    --to=festevam@gmail.com \
    --cc=clang-built-linux@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.