diff options
author | Helge Deller <deller@gmx.de> | 2020-06-14 10:54:10 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2020-07-21 08:04:39 +0200 |
commit | 208151bfb70fb7fb39959998832f7b5879be4751 (patch) | |
tree | 643d64de8eac2446e965c9622b5769e5f5268c4d /arch/parisc/mm | |
parent | ba47d845d715a010f7b51f6f89bae32845e6acb7 (diff) |
parisc: Convert to BIT_MASK() and BIT_WORD()
Drop own open-coded implementation to set bits and use the kernel
provided BIT_MASK() and BIT_WORD() macros.
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/mm')
-rw-r--r-- | arch/parisc/mm/init.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 48d628a1a0af..39ea464c8bd9 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -750,7 +750,7 @@ unsigned long alloc_sid(void) free_space_ids--; index = find_next_zero_bit(space_id, NR_SPACE_IDS, space_id_index); - space_id[index >> SHIFT_PER_LONG] |= (1L << (index & (BITS_PER_LONG - 1))); + space_id[BIT_WORD(index)] |= BIT_MASK(index); space_id_index = index; spin_unlock(&sid_lock); @@ -761,16 +761,16 @@ unsigned long alloc_sid(void) void free_sid(unsigned long spaceid) { unsigned long index = spaceid >> SPACEID_SHIFT; - unsigned long *dirty_space_offset; + unsigned long *dirty_space_offset, mask; - dirty_space_offset = dirty_space_id + (index >> SHIFT_PER_LONG); - index &= (BITS_PER_LONG - 1); + dirty_space_offset = &dirty_space_id[BIT_WORD(index)]; + mask = BIT_MASK(index); spin_lock(&sid_lock); - BUG_ON(*dirty_space_offset & (1L << index)); /* attempt to free space id twice */ + BUG_ON(*dirty_space_offset & mask); /* attempt to free space id twice */ - *dirty_space_offset |= (1L << index); + *dirty_space_offset |= mask; dirty_space_ids++; spin_unlock(&sid_lock); |