lkml.org 
[lkml]   [2010]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] bitops: Provide generic sign_extend function (moving it out from wireless code)
From
On Fri, Aug 27, 2010 at 6:16 AM, Andreas Herrmann
<herrmann.der.user@googlemail.com> 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


\
 
 \ /
  Last update: 2010-08-28 00:13    [W:0.076 / U:2.888 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site