[PATCH 1/2] swsusp: simplify memory_bm_find_bit()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The bit obtained by the function memory_bm_find_bit() is represented
by addr and bit_nr. The callers of memory_bm_find_bit() just use addr
and bit_nr as the arguments of set_bit/clear_bit/test_bit.

This patch simplifies the representation of the obtained bit without
using BM_BITS_PER_CHUNK.

Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
Cc: Pavel Machek <pavel@xxxxxxx>
Cc: Rafael J. Wysocki <rjw@xxxxxxx>
Cc: linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
---
 kernel/power/snapshot.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: 2.6-git/kernel/power/snapshot.c
===================================================================
--- 2.6-git.orig/kernel/power/snapshot.c
+++ 2.6-git/kernel/power/snapshot.c
@@ -478,8 +478,8 @@ static int memory_bm_find_bit(struct mem
 	}
 	zone_bm->cur_block = bb;
 	pfn -= bb->start_pfn;
-	*bit_nr = pfn % BM_BITS_PER_CHUNK;
-	*addr = bb->data + pfn / BM_BITS_PER_CHUNK;
+	*bit_nr = pfn;
+	*addr = bb->data;
 	return 0;
 }
 
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux