mm: define flags using bit numbers
Subsystems (2)
PATCH 1/1 mm: define flags using bit numbers
These flag is meant the bit numbers, they are
used like '(type & SLOTS_CACHE)' and so on.
Define these flags using bit numbers instead of
hardcoding powers of 2, which maybe better.
No change in the actual values.
Signed-off-by Hui Su <[email protected]>
--- mm/swap_slots.c | 4 ++-- mm/swapfile.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
mm/swap_slots.c +2 -2
@@ -47,8 +47,8 @@ static void deactivate_swap_slots_cache(void);static void reactivate_swap_slots_cache (void );#define use_swap_slot_cache (swap_slot_cache_active && swap_slot_cache_enabled) -#define SLOTS_CACHE 0x1 -#define SLOTS_CACHE_RET 0x2 +#define SLOTS_CACHE (1 << 0) +#define SLOTS_CACHE_RET (1 << 1)static void deactivate_swap_slots_cache (void ) {
mm/swapfile.c +3 -3
@@ -113,14 +113,14 @@ static inline unsigned char swap_count(unsigned char ent) }/* Reclaim the swap entry anyway if possible */ -#define TTRS_ANYWAY 0x1 +#define TTRS_ANYWAY (1 << 0)/* * Reclaim the swap entry if there are no more mappings of the * corresponding page */ -#define TTRS_UNMAPPED 0x2 +#define TTRS_UNMAPPED (1 << 1)/* Reclaim the swap entry if swap is getting full*/ -#define TTRS_FULL 0x4 +#define TTRS_FULL (1 << 2)/* returns 1 if swap entry is freed */ static int __try_to_reclaim_swap(struct swap_info_struct *si,
Signature · 1 line
2.29.0