[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200630142427.GP2599@vkoul-mobl>
Date: Tue, 30 Jun 2020 19:54:27 +0530
From: Vinod Koul <vkoul@...nel.org>
To: Amit Tomer <amittomer25@...il.com>
Cc: Andre Przywara <andre.przywara@....com>,
Andreas Färber <afaerber@...e.de>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
dan.j.williams@...el.com, cristian.ciocaltea@...il.com,
dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
linux-actions@...ts.infradead.org
Subject: Re: [PATCH v4 02/10] dmaengine: Actions: Add support for S700 DMA
engine
On 30-06-20, 15:17, Amit Tomer wrote:
> Hi Vinod,
>
> On Mon, Jun 29, 2020 at 3:22 PM Vinod Koul <vkoul@...nel.org> wrote:
>
> > If you use of_device_get_match_data() you will not fall into this :)
>
> But again, of_device_get_match_data() returns void *, and we need
> "uintptr_t" in order to type cast it properly (at-least without
> warning).
Not really, you can cast from void * to you own structure.. btw why do
you need uintptr_t?
>
> Also, while looking around found the similar warning for other file
> where it uses " of_device_get_match_data()"
> drivers/pci/controller/pcie-iproc-platform.c:56:15: warning: cast to
> smaller integer type 'enum iproc_pcie_type' from 'const void *'
> [-Wvoid-pointer-to-enum-cast]
> pcie->type = (enum iproc_pcie_type) of_device_get_match_data(dev);
The problem is a pointer to enum conversion :) I think the right way
would be to do would be below
soc_type = (enum foo)of_device_get_match_data(dev);
or
soc_type = (unsigned long) of_device_get_match_data(dev);
which I think should be fine in gcc, but possibly give you above warning
in clang.. but i thought that was fixed in clang https://reviews.llvm.org/D75758
Thanks
--
~Vinod
Powered by blists - more mailing lists