[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CH2PR02MB7000E00674D836639F371E35C7190@CH2PR02MB7000.namprd02.prod.outlook.com>
Date: Mon, 10 Feb 2020 14:26:58 +0000
From: Radhey Shyam Pandey <radheys@...inx.com>
To: Andrew Lunn <andrew@...n.ch>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Anirudha Sarangi <anirudh@...inx.com>,
Michal Simek <michals@...inx.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"mchehab+samsung@...nel.org" <mchehab+samsung@...nel.org>,
John Linn <linnj@...inx.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: RE: [PATCH v3 -next 3/4] net: emaclite: Fix arm64 compilation
warnings
> -----Original Message-----
> From: Andrew Lunn <andrew@...n.ch>
> Sent: Friday, January 31, 2020 7:08 PM
> To: Radhey Shyam Pandey <radheys@...inx.com>
> Cc: davem@...emloft.net; netdev@...r.kernel.org; linux-
> kernel@...r.kernel.org; Anirudha Sarangi <anirudh@...inx.com>; Michal Simek
> <michals@...inx.com>; gregkh@...uxfoundation.org;
> mchehab+samsung@...nel.org; John Linn <linnj@...inx.com>; linux-arm-
> kernel@...ts.infradead.org
> Subject: Re: [PATCH v3 -next 3/4] net: emaclite: Fix arm64 compilation warnings
>
> On Fri, Jan 31, 2020 at 05:17:49PM +0530, Radhey Shyam Pandey wrote:
> >
> > /* 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 - ((ulong)adr)) % ALIGNMENT)
>
> Hi Radhey
>
> linux/kernel.h has a few interesting macros, like
>
> #define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
>
> These are more likely to be correct across all architectures than
> anything you role yourself.
>
Thanks for the review. I agree using a kernel macro is preferred. However,
as a second thought it seems 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.
> Andrew
Powered by blists - more mailing lists