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
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
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;
#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;