[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BYAPR02MB5638FFA54D46ACED52AB1A52C7ED0@BYAPR02MB5638.namprd02.prod.outlook.com>
Date: Fri, 6 Nov 2020 16:43:50 +0000
From: Radhey Shyam Pandey <radheys@...inx.com>
To: Andrew Lunn <andrew@...n.ch>
CC: Michal Simek <michals@...inx.com>,
Jakub Kicinski <kuba@...nel.org>,
netdev <netdev@...r.kernel.org>
Subject: RE: [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix
-Wpointer-to-int-cast warnings with W=1
> -----Original Message-----
> From: Andrew Lunn <andrew@...n.ch>
> Sent: Wednesday, November 4, 2020 4:58 AM
> To: Radhey Shyam Pandey <radheys@...inx.com>
> Cc: Michal Simek <michals@...inx.com>; Jakub Kicinski <kuba@...nel.org>;
> netdev <netdev@...r.kernel.org>
> Subject: Re: [PATCH net-next 2/3] drivers: net: xilinx_emaclite: Fix -Wpointer-
> to-int-cast warnings with W=1
>
> > > > /* BUFFER_ALIGN(adr) calculates the number of bytes to the next
> > > > alignment. */ -#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((u32)adr))
> %
> > > > ALIGNMENT)
> > > > +#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((long)adr)) %
> ALIGNMENT)
> > >
> > > I can't see any reason to change unsigned type to signed one.
>
> > Agree. Also, I think we can get rid of this custom BUFFER_ALIGN
> > macro and simply calling skb_reserve(skb, NET_IP_ALIGN)
> > will make the protocol header to be aligned on at
> > least a 4-byte boundary?
>
> Hi Radhey
>
> I'm just going to replace the long with a uintptr_t. That will fix the
> warnings. I don't have this hardware, so don't want to risk anything
> more invasive which i cannot test.
>
> Please feel free to add a follow up patch replacing this with
> skb_reserve(skb, NET_IP_ALIGN).
Ok, thanks. I will send out a patch to remove this buffer align macro.
>
> Andrew
Powered by blists - more mailing lists