Re: [PATCH] ds2760: fix integer overflow for time_to_empty_now

From: Daniel Mack
Date: Thu Jul 30 2009 - 13:40:42 EST


On Thu, Jul 30, 2009 at 06:26:16PM +0400, Anton Vorontsov wrote:
> > > Hm... "(di->current_uA / 100L)" might result to 0, so you'll get
> > > div by zero. Removing the parenthesis will help.
> >
> > Hmm, no, then it gets the precedence wrong.
>
> Ah.
>
> > But checking for values >=
> > 100 of current_uA helps. Thanks for spotting this.
>
> Yeah, that'll be fine indeed.

Just wanted to make sure you noticed that there was a new patch attached
to this mail :) I copied it again here.

Daniel