Re: [PATCH] document optimizing macro for translating PROT_ to VM_ bits

From: Jamie Lokier
Date: Mon Sep 29 2003 - 12:18:18 EST


Valdis.Kletnieks@xxxxxx wrote:
> Is this supposed to return the bitmask bit2, or (x & bit2)? If the former,
> then your code is right. If the latter, (x & bit1) ? (x & bit2) : 0

The former.

> I'm totally failing to see why the original did the bit1 == bit2 compare,
> so maybe mhyself and Jamie are both missing some subtlety?

"bit1 == bit2" was an optimisation. It made the machine code smaller,
without changing the result.

-- Jamie
-
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/