lkml.org 
[lkml]   [2012]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] power: battery: pointer math issue in gab_probe()
On Sun, Sep 30, 2012 at 09:38:45AM +0530, anish kumar wrote:
> On Sat, 2012-09-29 at 10:13 +0300, Dan Carpenter wrote:
> > psy->properties is an enum (32 bit type) so adding sizeof() puts us
> > four times further along than we intended. It should be cast to a char
> > pointer before doing the math.
> You really read this driver to find out this one.
> Good one.

Nah. It's a static checker thing with Smatch
(http://smatch.sf.net). When you add pointer + sizeof(), the
pointer should always be char.

regards,
dan carpenter



\
 
 \ /
  Last update: 2012-09-30 10:01    [W:0.127 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site