[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201103232806.GL1109407@lunn.ch>
Date: Wed, 4 Nov 2020 00:28:06 +0100
From: Andrew Lunn <andrew@...n.ch>
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).
Andrew
Powered by blists - more mailing lists