public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Khan M Rashedun-Naby <naby88@gmail.com>
To: tglx@linutronix.de
Cc: mingo@redhat.com, hpa@zytor.com, x86@kernel.org, bp@suse.de,
	thomas.lendacky@amd.com, jgross@suse.com, r.marek@assembler.cz,
	qianyue.zj@alibaba-inc.com, linux-kernel@vger.kernel.org,
	Khan M Rashedun-Naby <naby88@gmail.com>
Subject: [PATCH] Fixed some style warnings and errors
Date: Mon,  2 Apr 2018 21:17:43 +0600	[thread overview]
Message-ID: <1522682263-11935-1-git-send-email-naby88@gmail.com> (raw)

Signed-off-by: Khan M Rashedun-Naby <naby88@gmail.com>
---
 arch/x86/kernel/cpu/amd.c | 46 ++++++++++++++++++++++++++--------------------
 1 file changed, 26 insertions(+), 20 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index f0e6456..1a6e45e 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -32,7 +32,7 @@ static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum);
  */
 static u32 nodes_per_socket = 1;
 
-static inline int rdmsrl_amd_safe(unsigned msr, unsigned long long *p)
+static inline int rdmsrl_amd_safe(unsigned int msr, unsigned long long *p)
 {
 	u32 gprs[8] = { 0 };
 	int err;
@@ -50,7 +50,7 @@ static inline int rdmsrl_amd_safe(unsigned msr, unsigned long long *p)
 	return err;
 }
 
-static inline int wrmsrl_amd_safe(unsigned msr, unsigned long long val)
+static inline int wrmsrl_amd_safe(unsigned int msr, unsigned long long val)
 {
 	u32 gprs[8] = { 0 };
 
@@ -157,6 +157,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
 		rdmsr(MSR_K6_WHCR, l, h);
 		if ((l&0x0000FFFF) == 0) {
 			unsigned long flags;
+
 			l = (1<<0)|((mbytes/4)<<1);
 			local_irq_save(flags);
 			wbinvd();
@@ -178,6 +179,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
 		rdmsr(MSR_K6_WHCR, l, h);
 		if ((l&0xFFFF0000) == 0) {
 			unsigned long flags;
+
 			l = ((mbytes>>2)<<22)|(1<<16);
 			local_irq_save(flags);
 			wbinvd();
@@ -268,8 +270,7 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
 	 * Don't taint if we are running SMP kernel on a single non-MP
 	 * approved Athlon
 	 */
-	WARN_ONCE(1, "WARNING: This combination of AMD"
-		" processors is not suitable for SMP.\n");
+	WARN_ONCE(1, "WARNING: This combination of AMD processors is not suitable for SMP.\n");
 	add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_NOW_UNRELIABLE);
 #endif
 }
@@ -384,7 +385,7 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
 static void amd_detect_cmp(struct cpuinfo_x86 *c)
 {
 #ifdef CONFIG_SMP
-	unsigned bits;
+	unsigned int bits;
 	int cpu = smp_processor_id();
 
 	bits = c->x86_coreid_bits;
@@ -419,7 +420,7 @@ static void srat_detect_node(struct cpuinfo_x86 *c)
 #ifdef CONFIG_NUMA
 	int cpu = smp_processor_id();
 	int node;
-	unsigned apicid = c->apicid;
+	unsigned int apicid = c->apicid;
 
 	node = numa_cpu_node(cpu);
 	if (node == NUMA_NO_NODE)
@@ -468,7 +469,7 @@ static void srat_detect_node(struct cpuinfo_x86 *c)
 static void early_init_amd_mc(struct cpuinfo_x86 *c)
 {
 #ifdef CONFIG_SMP
-	unsigned bits, ecx;
+	unsigned int bits, ecx;
 
 	/* Multi core CPU? */
 	if (c->extended_cpuid_level < 0x80000008)
@@ -820,14 +821,22 @@ static void init_amd(struct cpuinfo_x86 *c)
 		clear_cpu_cap(c, X86_FEATURE_MCE);
 
 	switch (c->x86) {
-	case 4:    init_amd_k5(c); break;
-	case 5:    init_amd_k6(c); break;
-	case 6:	   init_amd_k7(c); break;
-	case 0xf:  init_amd_k8(c); break;
-	case 0x10: init_amd_gh(c); break;
-	case 0x12: init_amd_ln(c); break;
-	case 0x15: init_amd_bd(c); break;
-	case 0x17: init_amd_zn(c); break;
+	case 4:
+	  init_amd_k5(c); break;
+	case 5:
+	  init_amd_k6(c); break;
+	case 6:
+	  init_amd_k7(c); break;
+	case 0xf:
+	  init_amd_k8(c); break;
+	case 0x10:
+	  init_amd_gh(c); break;
+	case 0x12:
+	  init_amd_ln(c); break;
+	case 0x15:
+	  init_amd_bd(c); break;
+	case 0x17:
+	  init_amd_zn(c); break;
 	}
 
 	/*
@@ -970,17 +979,14 @@ static const struct cpu_dev amd_cpu_dev = {
 	.c_vendor	= "AMD",
 	.c_ident	= { "AuthenticAMD" },
 #ifdef CONFIG_X86_32
-	.legacy_models = {
-		{ .family = 4, .model_names =
-		  {
+	.legacy_models = { { .family = 4, .model_names = {
 			  [3] = "486 DX/2",
 			  [7] = "486 DX/2-WB",
 			  [8] = "486 DX/4",
 			  [9] = "486 DX/4-WB",
 			  [14] = "Am5x86-WT",
 			  [15] = "Am5x86-WB"
-		  }
-		},
+		  } },
 	},
 	.legacy_cache_size = amd_size_cache,
 #endif
-- 
2.7.4

             reply	other threads:[~2018-04-02 15:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-02 15:17 Khan M Rashedun-Naby [this message]
2018-04-02 16:17 ` [PATCH] Fixed some style warnings and errors Borislav Petkov
     [not found]   ` <CANOsoeva82vod1QDHoJiJr2bBAmD7hULZVowebK9yrpF+5cpOQ@mail.gmail.com>
2018-04-02 16:43     ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522682263-11935-1-git-send-email-naby88@gmail.com \
    --to=naby88@gmail.com \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=qianyue.zj@alibaba-inc.com \
    --cc=r.marek@assembler.cz \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox