lkml.org 
[lkml]   [2003]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/7] dm: Replace __HIGH() and __LOW() macros
On Mon, Jun 09, 2003 at 03:34:40PM +0100, Joe Thornber wrote:
> Replace __HIGH() and __LOW() with max() and min_not_zero().
> --- diff/drivers/md/dm-table.c 2003-05-21 11:50:15.000000000 +0100
> +++ source/drivers/md/dm-table.c 2003-06-09 15:04:57.000000000 +0100
> @@ -78,22 +78,33 @@
> return result;
> }
>
> -#define __HIGH(l, r) if (*(l) < (r)) *(l) = (r)
> -#define __LOW(l, r) if (*(l) == 0 || *(l) > (r)) *(l) = (r)
> +/*
> + * Returns the minimum that is _not_ zero, unless both are zero.
> + */
> +#define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r))
>...

Are there potential other users of min_not_zero?
If yes, shouldn't it go into kernel.h?

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

-
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: 2005-03-22 13:36    [W:0.112 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site