lkml.org 
[lkml]   [2004]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: fork pagesize patch


On Tue, 16 Nov 2004, David Howells wrote:
> >
> > I think it _is_ unreasonable. It's like doing
> >
> > if (a)
> > x /= a;
>
> Doing it with variables is not exactly the same. The compiler has been told to
> optimise arithmetic on constants, and as such it has to represent a div-by-0
> result, which obviously it can't.

But you snipped the part where the above source code _does_ end up being
done on constants - in macro expansion and in inline functions. So the
compiler really _can_ have a constant zero in the divide, and it really
_can_ come from perfectly normal code.

In fact, maybe code like the kernel had.

> > Anyway, to make it not warn, why not change it to
> >
> > max_threads = mempages / (8*THREAD_SIZE/PAGE_SIZE);
> >
> > instead, and be done with it?
>
> And drop the conditional entirely? I can go along with that.

Right. It looks like the obvious thing to do, and is really what the code
_tried_ to do in the first place.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:1.847 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site