> -----Original Message-----
> From: Andrew Lunn <and...@lunn.ch>
> Sent: Wednesday, November 4, 2020 4:58 AM
> To: Radhey Shyam Pandey <radh...@xilinx.com>
> Cc: Michal Simek <mich...@xilinx.com>; Jakub Kicinski <k...@kernel.org>;
> netdev <netdev@vger.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

Reply via email to