[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR0402MB3871D33D658BF35116426E9EE0210@VI1PR0402MB3871.eurprd04.prod.outlook.com>
Date: Wed, 16 Sep 2020 14:33:01 +0000
From: Ioana Ciornei <ioana.ciornei@....com>
To: "Y.b. Lu" <yangbo.lu@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: "Y.b. Lu" <yangbo.lu@....com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Ioana Ciocoi Radulescu <ruxandra.radulescu@....com>,
Richard Cochran <richardcochran@...il.com>
Subject: RE: [v3, 6/6] dpaa2-eth: fix a build warning in dpmac.c
> Subject: [v3, 6/6] dpaa2-eth: fix a build warning in dpmac.c
>
> Fix below sparse warning in dpmac.c.
> warning: cast to restricted __le64
>
> Signed-off-by: Yangbo Lu <yangbo.lu@....com>
> ---
> Changes for v3:
> - Added this patch.
> ---
> drivers/net/ethernet/freescale/dpaa2/dpmac.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpmac.c
> b/drivers/net/ethernet/freescale/dpaa2/dpmac.c
> index d5997b6..71f165c 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpmac.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpmac.c
> @@ -177,7 +177,7 @@ int dpmac_get_counter(struct fsl_mc_io *mc_io, u32
> cmd_flags, u16 token,
> return err;
>
> dpmac_rsp = (struct dpmac_rsp_get_counter *)cmd.params;
> - *value = le64_to_cpu(dpmac_rsp->counter);
> + *value = dpmac_rsp->counter;
>
Hi Yangbo,
The proper fix for this is to define as __le64 the counter in the dpmac_rsp_get_counter structure as below:
--- a/drivers/net/ethernet/freescale/dpaa2/dpmac-cmd.h
+++ b/drivers/net/ethernet/freescale/dpaa2/dpmac-cmd.h
@@ -67,7 +67,7 @@ struct dpmac_cmd_get_counter {
struct dpmac_rsp_get_counter {
u64 pad;
- u64 counter;
+ __le64 counter;
};
Also, if you feel like this is not really part of the series I can take it and send the patch separately.
Thanks,
Ioana
> return 0;
> }
> --
> 2.7.4
Powered by blists - more mailing lists