Subject: Re: [net-next 06/16] i40e: Properly cast type for arithmetic

From: Joe Perches <[email-masked]>
Date: Wed, 25 Nov 2015 02:58:22 -0800

On Wed, 2015-11-25 at 02:46 -0800, Jeff Kirsher wrote:
> On Tue, 2015-11-24 at 16:43 -0800, Joe Perches wrote:
> > On Tue, 2015-11-24 at 16:04 -0800, Jeff Kirsher wrote:
> > > From: Helin Zhang <[email-masked]>
> > > 
> > > Pointer of type void * shouldn't be used in arithmetic, which may
> > > result in compilation error. Casting of (u8 *) can be added to fix
> > > that.
> > > 
> > 
> > void * arithmetic is used quite frequently in the kernel.
> > 
> > What compiler emits an error?
> 
> When you use the gcc -Wpointer-arith, it generates the warning.

make W=3 does that

$ make help
[...]
make W=n   [targets] Enable extra gcc checks, n=1,2,3 where
		1: warnings which may be relevant and do not occur too often
		2: warnings which occur quite often but may still be relevant
		3: more obscure warnings, can most likely be ignored

but I think it should be ignored.