Re: [PATCH 1/6] kernel: add clamp(), clamp_t() and clamp_val()macros

From: Andrew Morton
Date: Wed Mar 12 2008 - 01:10:21 EST


On Tue, 11 Mar 2008 14:11:34 -0700 Harvey Harrison <harvey.harrison@xxxxxxxxx> wrote:

> Adds macros similar to min/max/min_t/max_t.
>
> Also, change the variable names used in the min/max macros to
> avoid shadowed variable warnings when min/max min_t/max_t are
> nested.
>
> clamp_val is useful when clamping to constants so all types are
> taken from typeof() the first arg.
>
> Small formatting changes to make all the macros have a similar
> form.
>
> Signed-off-by: Harvey Harrison <harvey.harrison@xxxxxxxxx>
> ---
> Andrew, this is a rollup of my original patch already in -mm with
> checkpatch warnings fixed up and one additional macro based on
> limit_value found in the b43 driver, called clamp_val.

Well, this is why I dislike replacement patches. You don't know what
changed, and the replacement patch can fail to incproporate fixes from
third parties.

> include/linux/kernel.h | 66 ++++++++++++++++++++++++++++++++++-------------
> 1 files changed, 48 insertions(+), 18 deletions(-)

And so it did. You lost my patch which removes the clamp() implementation
from v4l. Instead it seems that you put it into [2/6]. Which means that
this patch on its own will break the build, thus screwing up life for
git-bisect users.

Please don't screw up git-bisect users' lives.

> clamp_t is no longer used, but I introduce it anyway as some future
> user may want to force the return type similar to how min_t/max_t
> operate.

eh, just nuke it.

> 1.5.4.4.592.g32d4c

Is all this new infrastructure actually used? We seem to be adding more
complexity than we're taking away.

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