lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1246674092.2642.8.camel@ht.satnam>
Date:	Sat, 04 Jul 2009 07:51:32 +0530
From:	Jaswinder Singh Rajput <jaswinder@...nel.org>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Alan Cox <alan@...rguk.ukuu.org.uk>, linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Yinghai Lu <yinghai@...nel.org>
Subject: [PATCH 3/9 -tip] x86: mtrr/cleanup.c fix trivial style problems


Fix trivial style problems:

  WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
  WARNING: Use #include <linux/kvm_para.h> instead of <asm/kvm_para.h>
  WARNING: consider using strict_strtoul in preference to simple_strtoul

nr_mtrr_spare_reg should be unsigned long

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@...il.com>
---
 arch/x86/kernel/cpu/mtrr/cleanup.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
index 1d584a1..9cbf207 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -24,13 +24,13 @@
 #include <linux/cpu.h>
 #include <linux/mutex.h>
 #include <linux/sort.h>
+#include <linux/uaccess.h>
+#include <linux/kvm_para.h>
 
 #include <asm/e820.h>
 #include <asm/mtrr.h>
-#include <asm/uaccess.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
-#include <asm/kvm_para.h>
 #include "mtrr.h"
 
 /* should be related to MTRR_VAR_RANGES nums */
@@ -59,7 +59,7 @@ add_range(struct res_range *range, int nr_range, unsigned long start,
 
 static int __init
 add_range_with_merge(struct res_range *range, int nr_range, unsigned long start,
-			      unsigned long end)
+		     unsigned long end)
 {
 	int i;
 
@@ -577,13 +577,13 @@ static int __init parse_mtrr_gran_size_opt(char *p)
 }
 early_param("mtrr_gran_size", parse_mtrr_gran_size_opt);
 
-static int nr_mtrr_spare_reg __initdata =
+static unsigned long nr_mtrr_spare_reg __initdata =
 				 CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT;
 
 static int __init parse_mtrr_spare_reg(char *arg)
 {
 	if (arg)
-		nr_mtrr_spare_reg = simple_strtoul(arg, NULL, 0);
+		return strict_strtoul(arg, 0, &nr_mtrr_spare_reg);
 	return 0;
 }
 
@@ -661,7 +661,7 @@ static void __init print_out_mtrr_range_state(void)
 		start_base = to_size_factor(start_base, &start_factor),
 		type = range_state[i].type;
 
-		printk(KERN_DEBUG "reg %d, base: %ld%cB, range: %ld%cB, type %s\n",
+		pr_debug("reg %d, base: %ld%cB, range: %ld%cB, type %s\n",
 			i, start_base, start_factor,
 			size_base, size_factor,
 			(type == MTRR_TYPE_UNCACHABLE) ? "UC" :
@@ -699,7 +699,7 @@ static int __init mtrr_need_cleanup(void)
 
 	/* check if we only had WB and UC */
 	if (num[MTRR_TYPE_WRBACK] + num[MTRR_TYPE_UNCACHABLE] !=
-		num_var_ranges - num[MTRR_NUM_TYPES])
+	    num_var_ranges - num[MTRR_NUM_TYPES])
 		return 0;
 
 	return 1;
@@ -708,8 +708,7 @@ static int __init mtrr_need_cleanup(void)
 static unsigned long __initdata range_sums;
 static void __init mtrr_calc_range_state(u64 chunk_size, u64 gran_size,
 					 unsigned long extra_remove_base,
-					 unsigned long extra_remove_size,
-					 int i)
+					 unsigned long extra_remove_size, int i)
 {
 	int num_reg;
 	static struct res_range range_new[RANGE_NUM];
@@ -1098,4 +1097,3 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
 
 	return 0;
 }
-
-- 
1.6.0.6



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ