/dev/mem: introduce size_inside_page()
authorWu Fengguang <fengguang.wu@intel.com>
Tue, 15 Dec 2009 01:58:07 +0000 (17:58 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Dec 2009 16:53:11 +0000 (08:53 -0800)
commitf222318e9c3a315723e3524fb9d6566b2430db44
treec40913c1e5e32eda037b687be2f835e2754b04b8
parent4ea2f43f28e30050bc99fe3134b6b679f3bf5b22
/dev/mem: introduce size_inside_page()

Introduce size_inside_page() to replace duplicate /dev/mem code.

Also apply it to /dev/kmem, whose alignment logic was buggy.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/mem.c