summaryrefslogtreecommitdiff
path: root/drivers/rpmsg
diff options
context:
space:
mode:
authorRichard Zhu <hongxing.zhu@nxp.com>2021-11-10 12:49:13 +0100
committerMing Liu <ming.liu@toradex.com>2021-11-10 21:57:43 +0100
commitf64f1d88f9cd1116570ec04f269223c435b6091d (patch)
tree74c118ccf53d5e3de98448d8436359d9abfad82c /drivers/rpmsg
parenta81d50eaac68c7991c7b98343e8f9321f66b78eb (diff)
LF-2108 rpmsg: imx: fix the pointer conversion loses bits issue
Fix the pointer conversion loses bits issue reported by Coverity below. CID 5433934 (#2 of 4): Parse warning (PW.POINTER_CONVERSION_LOSES_BITS) 1. pointer_conversion_loses_bits: conversion from pointer to smaller integer Related-to: ELB-4064 Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com> Reviewed-by: Jun Li <jun.li@nxp.com> Signed-off-by: Ming Liu <ming.liu@toradex.com> (cherry picked from commit 7c9a5a31bc27549bd5d5ea70654d881885eb25d5)
Diffstat (limited to 'drivers/rpmsg')
-rw-r--r--drivers/rpmsg/imx_rpmsg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/rpmsg/imx_rpmsg.c b/drivers/rpmsg/imx_rpmsg.c
index 9dd704ae5a64..6a5337c3c8f8 100644
--- a/drivers/rpmsg/imx_rpmsg.c
+++ b/drivers/rpmsg/imx_rpmsg.c
@@ -533,6 +533,7 @@ err_out:
static int imx_rpmsg_probe(struct platform_device *pdev)
{
int j, ret = 0;
+ unsigned long variant;
char *buf;
struct device *dev = &pdev->dev;
struct device_node *np = pdev->dev.of_node;
@@ -550,7 +551,8 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
#ifdef CONFIG_IMX_SCU
rpdev->proc_nb.notifier_call = imx_rpmsg_partition_notify;
#endif
- rpdev->variant = (enum imx_rpmsg_variants)of_device_get_match_data(dev);
+ variant = (uintptr_t)of_device_get_match_data(dev);
+ rpdev->variant = (enum imx_rpmsg_variants)variant;
rpdev->rx_buffer.buf = buf;
rpdev->rx_buffer.head = 0;
rpdev->rx_buffer.tail = 0;