Fix set_bits

pull/2536/merge
kwolekr 2015-03-31 23:30:44 -04:00
parent 337e79c656
commit 699e066bea
1 changed files with 1 additions and 1 deletions

View File

@ -258,7 +258,7 @@ inline u32 get_bits(u32 x, u32 pos, u32 len)
inline void set_bits(u32 *x, u32 pos, u32 len, u32 val)
{
u32 mask = (1 << len) - 1;
*x &= ~(mask << len);
*x &= ~(mask << pos);
*x |= (val & mask) << pos;
}