Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61372
b: refs/heads/master
c: d67be61
h: refs/heads/master
v: v3
  • Loading branch information
Trent Piepho authored and Mauro Carvalho Chehab committed Jul 18, 2007
1 parent 1262c4b commit 123266f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ba2cf98249795f03792d1409a3b6aaa589ea0745
refs/heads/master: d67be61ebe5efaf9c4c11bf168781d678854c966
23 changes: 11 additions & 12 deletions trunk/drivers/media/common/ir-functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,20 @@ void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
}

/* -------------------------------------------------------------------------- */

/* extract mask bits out of data and pack them into the result */
u32 ir_extract_bits(u32 data, u32 mask)
{
int mbit, vbit;
u32 value;
u32 vbit = 1, value = 0;

do {
if (mask&1) {
if (data&1)
value |= vbit;
vbit<<=1;
}
data>>=1;
} while (mask>>=1);

value = 0;
vbit = 0;
for (mbit = 0; mbit < 32; mbit++) {
if (!(mask & ((u32)1 << mbit)))
continue;
if (data & ((u32)1 << mbit))
value |= (1 << vbit);
vbit++;
}
return value;
}

Expand Down

0 comments on commit 123266f

Please sign in to comment.