lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM7PR04MB6885F0D0172B0F2E8D4E375BF83F0@AM7PR04MB6885.eurprd04.prod.outlook.com>
Date:   Fri, 18 Sep 2020 08:59:42 +0000
From:   "Y.b. Lu" <yangbo.lu@....com>
To:     Ioana Ciornei <ioana.ciornei@....com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:     "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

Hi Ioana,

> -----Original Message-----
> From: Ioana Ciornei <ioana.ciornei@....com>
> Sent: Wednesday, September 16, 2020 10:33 PM
> To: Y.b. Lu <yangbo.lu@....com>; 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.

Thank you. Let me send the fix for v2 separately.

> 
> Thanks,
> Ioana
> 
> >  	return 0;
> >  }
> > --
> > 2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ