]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mtrr, x86: clean up mtrr_type_lookup()
authorToshi Kani <toshi.kani@hp.com>
Tue, 7 Apr 2015 23:57:08 +0000 (09:57 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 9 Apr 2015 09:07:13 +0000 (19:07 +1000)
commitbbff1707d4f9a3fb4740c787a02e4099be175fda
treeb280abd07c0de234a4c53b8bee9c5e975f03ae6c
parentcc85667af1329fa275c0a618f6790dff31b3e402
mtrr, x86: clean up mtrr_type_lookup()

MTRRs contain fixed and variable entries.  mtrr_type_lookup() may
repeatedly call __mtrr_type_lookup() to handle a request that overlaps
with variable entries.  However, __mtrr_type_lookup() also handles the
fixed entries, which do not have to be repeated.  Therefore, this patch
creates separate functions, mtrr_type_lookup_fixed() and
mtrr_type_lookup_variable(), to handle the fixed and variable ranges
respectively.

The patch also updates the function headers to clarify the return values
and output argument.  It updates comments to clarify that the repeating is
necessary to handle overlaps with the default type, since overlaps with
multiple entries alone can be handled without such repeating.

There is no functional change in this patch.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Robert Elliott <Elliott@hp.com>
Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/kernel/cpu/mtrr/generic.c