From: Manivannan Sadhasivam <mani@kernel.org>
To: Justin Stitt <justinstitt@google.com>
Cc: "Vinod Koul" <vkoul@kernel.org>,
"Andreas Färber" <afaerber@suse.de>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nick Desaulniers" <ndesaulniers@google.com>,
"Tom Rix" <trix@redhat.com>,
dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev
Subject: Re: [PATCH] dmaengine: owl-dma: fix clang -Wvoid-pointer-to-enum-cast warning
Date: Thu, 17 Aug 2023 12:26:41 +0530 [thread overview]
Message-ID: <20230817065641.GA4864@thinkpad> (raw)
In-Reply-To: <20230816-void-drivers-dma-owl-dma-v1-1-a0a5e085e937@google.com>
On Wed, Aug 16, 2023 at 08:12:50PM +0000, Justin Stitt wrote:
> When building with clang 18 I see the following warning:
> | drivers/dma/owl-dma.c:1119:14: warning: cast to smaller integer type
> | 'enum owl_dma_id' from 'const void *' [-Wvoid-pointer-to-enum-cast]
> | 1119 | od->devid = (enum owl_dma_id)of_device_get_match_data(&pdev->dev);
>
> This is due to the fact that `of_device_get_match_data()` returns a
> void* while `enum owl_dma_id` has the size of an int.
>
> Cast result of `of_device_get_match_data()` to a uintptr_t to silence
> the above warning for clang builds using W=1
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1910
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Justin Stitt <justinstitt@google.com>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> drivers/dma/owl-dma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c
> index b6e0ac8314e5..f340a04579f4 100644
> --- a/drivers/dma/owl-dma.c
> +++ b/drivers/dma/owl-dma.c
> @@ -1116,7 +1116,7 @@ static int owl_dma_probe(struct platform_device *pdev)
> dev_info(&pdev->dev, "dma-channels %d, dma-requests %d\n",
> nr_channels, nr_requests);
>
> - od->devid = (enum owl_dma_id)of_device_get_match_data(&pdev->dev);
> + od->devid = (uintptr_t)of_device_get_match_data(&pdev->dev);
>
> od->nr_pchans = nr_channels;
> od->nr_vchans = nr_requests;
>
> ---
> base-commit: 2ccdd1b13c591d306f0401d98dedc4bdcd02b421
> change-id: 20230816-void-drivers-dma-owl-dma-41b95a098275
>
> Best regards,
> --
> Justin Stitt <justinstitt@google.com>
>
--
மணிவண்ணன் சதாசிவம்
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-08-17 6:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 20:12 [PATCH] dmaengine: owl-dma: fix clang -Wvoid-pointer-to-enum-cast warning Justin Stitt
2023-08-17 6:56 ` Manivannan Sadhasivam [this message]
2023-08-21 13:51 ` Vinod Koul
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=20230817065641.GA4864@thinkpad \
--to=mani@kernel.org \
--cc=afaerber@suse.de \
--cc=dmaengine@vger.kernel.org \
--cc=justinstitt@google.com \
--cc=linux-actions@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=trix@redhat.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;
as well as URLs for NNTP newsgroup(s).