Re: [PATCH] bitops: Provide generic sign_extend function (moving itout from wireless code)

From: Bob Copeland
Date: Fri Aug 27 2010 - 18:09:57 EST


On Fri, Aug 27, 2010 at 6:16 AM, Andreas Herrmann
<herrmann.der.user@xxxxxxxxxxxxxx> wrote:

> -static int sign_extend(int val, const int nbits)
> -static s32 sign_extend(u32 oper, int index)

Note these two are specified slightly differently, so return different
values with the same arguments. The ath[59]k version takes the number
of bits (1-based) while the other one takes the position of the high
order bit (0-based). I think the former is a little more natural but
it's a matter of taste.

Anyway I personally have no problem with merging them once the above
is fixed. I wrote a similar patch when I wrote the ath5k version, but
never bothered to submit it.

--
Bob Copeland %% www.bobcopeland.com
--
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/