Re: small patch for pty.c

From: Richard Guenther (richard.guenther@student.uni-tuebingen.de)
Date: Mon Apr 17 2000 - 10:48:11 EST


On Mon, 17 Apr 2000, Horst von Brand wrote:

> Paul Mackerras <paulus@linuxcare.com.au> said:
> > In looking through drivers/char/pty.c, I saw a couple of places where
> > the MIN() macro is used and one of its arguments is a function call
> > which could potentially return a different number each time it is
> > called, particularly on SMP systems. Here is a patch to fix that.
>
> It would be better to fix MIN in that case, so no others slip through:
>
> #define MIN(x, y) ({typeof x x_ = x; typeof y y_ = y; x_ < y_ ? x_ : y_})
>
> should work right for any combination of types. BTW, there are several
> implementations of MIN floating around, perhaps they should be unified?

Last time unification of MIN/MAX was not accepted by the networking guys -
they have some "different" (static inline) min/max implementation. I had
a patch for this floating around one or two years ago (early 2.1).

Richard.

--
Richard Guenther <richard.guenther@student.uni-tuebingen.de>
WWW: http://www.anatom.uni-tuebingen.de/~richi/
The GLAME Project: http://www.glame.de/

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



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:11 EST