From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: <vinod.koul@intel.com>, <dan.j.williams@intel.com>
Cc: <arnd@arndb.de>, <dmaengine@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-omap@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <tony@atomide.com>
Subject: [PATCH v3 2/9] dmaengine: edma: Fix of_device_id data parameter usage (legacy vs TPCC)
Date: Wed, 21 Sep 2016 15:41:28 +0300 [thread overview]
Message-ID: <20160921124135.11849-3-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <20160921124135.11849-1-peter.ujfalusi@ti.com>
Use pointers to static constant variables for eDMA binding
type (legacy vs TPCC).
Fixes the following warning when compiling the driver for 64bit
architectures (x86_64 for example):
drivers/dma/edma.c:2185:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
if (match && (u32)match->data == EDMA_BINDING_TPCC)
^
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/edma.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index c2098a4b4dcf..87c58710ae31 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -263,14 +263,19 @@ static const struct edmacc_param dummy_paramset = {
#define EDMA_BINDING_LEGACY 0
#define EDMA_BINDING_TPCC 1
+static const u32 edma_binding_type[] = {
+ [EDMA_BINDING_LEGACY] = EDMA_BINDING_LEGACY,
+ [EDMA_BINDING_TPCC] = EDMA_BINDING_TPCC,
+};
+
static const struct of_device_id edma_of_ids[] = {
{
.compatible = "ti,edma3",
- .data = (void *)EDMA_BINDING_LEGACY,
+ .data = &edma_binding_type[EDMA_BINDING_LEGACY],
},
{
.compatible = "ti,edma3-tpcc",
- .data = (void *)EDMA_BINDING_TPCC,
+ .data = &edma_binding_type[EDMA_BINDING_TPCC],
},
{}
};
@@ -2184,7 +2189,7 @@ static int edma_probe(struct platform_device *pdev)
const struct of_device_id *match;
match = of_match_node(edma_of_ids, node);
- if (match && (u32)match->data == EDMA_BINDING_TPCC)
+ if (match && (*(u32*)match->data) == EDMA_BINDING_TPCC)
legacy_mode = false;
info = edma_setup_info_from_dt(dev, legacy_mode);
--
2.10.0
next prev parent reply other threads:[~2016-09-21 12:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-21 12:41 [PATCH v3 0/9] dmaengine: ti drivers: enable COMPILE_TESTing Peter Ujfalusi
2016-09-21 12:41 ` [PATCH v3 1/9] dmaengine: edma: Add missing MODULE_DEVICE_TABLE() for of_device_id structs Peter Ujfalusi
2016-09-21 12:41 ` Peter Ujfalusi [this message]
2016-09-21 12:41 ` [PATCH v3 3/9] dmaengine: edma: Use correct type for of_find_property() third parameter Peter Ujfalusi
2016-09-21 12:41 ` [PATCH v3 4/9] dmaengine/ARM: omap-dma: Fix the DMAengine compile test on non OMAP configs Peter Ujfalusi
2016-09-21 12:41 ` [PATCH v3 5/9] dmaengine: ti-dma-crossbar: Correct type for of_find_property() third parameter Peter Ujfalusi
2016-09-21 12:41 ` [PATCH v3 6/9] dmaengine: ti-dma-crossbar: Fix of_device_id data parameter usage Peter Ujfalusi
2016-09-28 3:17 ` Vinod Koul
2016-09-21 12:41 ` [PATCH v3 7/9] dmaengine: edma: enable COMPILE_TEST Peter Ujfalusi
2016-09-22 4:50 ` kbuild test robot
2016-09-21 12:41 ` [PATCH v3 8/9] dmaengine: omap-dma: " Peter Ujfalusi
2016-09-21 12:41 ` [PATCH v3 9/9] dmaengine: ti-dma-crossbar: " Peter Ujfalusi
2016-09-28 3:26 ` [PATCH v3 0/9] dmaengine: ti drivers: enable COMPILE_TESTing Vinod Koul
2016-09-28 5:58 ` Peter Ujfalusi
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=20160921124135.11849-3-peter.ujfalusi@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=arnd@arndb.de \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.com \
--cc=vinod.koul@intel.com \
/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®