mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@amd64.org>
To: X86-ML <x86@kernel.org>
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>,
	Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	LKML <linux-kernel@vger.kernel.org>,
	Borislav Petkov <borislav.petkov@amd.com>
Subject: [PATCH v0 02/12] x86, microcode: Save an indentation level in reload_for_cpu
Date: Tue,  7 Aug 2012 19:44:11 +0200	[thread overview]
Message-ID: <1344361461-10076-3-git-send-email-bp@amd64.org> (raw)
In-Reply-To: <1344361461-10076-1-git-send-email-bp@amd64.org>

From: Borislav Petkov <borislav.petkov@amd.com>

Invert the uci->valid check so that the later block can be aligned on
the first indentation level of the function. No functional change.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
 arch/x86/kernel/microcode_core.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index 4873e62db6a1..63a956865022 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -276,19 +276,18 @@ static struct platform_device	*microcode_pdev;
 static int reload_for_cpu(int cpu)
 {
 	struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
+	enum ucode_state ustate;
 	int err = 0;
 
-	if (uci->valid) {
-		enum ucode_state ustate;
-
-		ustate = microcode_ops->request_microcode_fw(cpu, &microcode_pdev->dev);
-		if (ustate == UCODE_OK)
-			apply_microcode_on_target(cpu);
-		else
-			if (ustate == UCODE_ERROR)
-				err = -EINVAL;
-	}
+	if (!uci->valid)
+		return err;
 
+	ustate = microcode_ops->request_microcode_fw(cpu, &microcode_pdev->dev);
+	if (ustate == UCODE_OK)
+		apply_microcode_on_target(cpu);
+	else
+		if (ustate == UCODE_ERROR)
+			err = -EINVAL;
 	return err;
 }
 
-- 
1.7.11.rc1


  reply	other threads:[~2012-08-07 17:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07 17:44 [PATCH v0 0/12] x86, microcode, AMD: Per-family patches cache Borislav Petkov
2012-08-07 17:44 ` Borislav Petkov [this message]
2012-08-22 23:37   ` [tip:x86/microcode] x86, microcode: Save an indentation level in reload_for_cpu tip-bot for Borislav Petkov
2012-08-07 17:44 ` [PATCH v0 03/12] x86, microcode: Drop uci->mc check on resume path Borislav Petkov
2012-08-22 23:38   ` [tip:x86/microcode] x86, microcode: Drop uci-> mc " tip-bot for Borislav Petkov
2012-08-07 17:44 ` [PATCH v0 04/12] x86, microcode: Cleanup cpu hotplug notifier callback Borislav Petkov
2012-08-22 23:39   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2012-08-07 17:44 ` [PATCH v0 05/12] x86, microcode: Straighten out Kconfig text Borislav Petkov
2012-08-22 23:40   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2012-08-07 17:44 ` [PATCH v0 06/12] x86, microcode, AMD: Remove useless get_ucode_data wrapper Borislav Petkov
2012-08-22 23:41   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2012-08-07 17:44 ` [PATCH v0 07/12] x86, microcode, AMD: Check before applying a patch Borislav Petkov
2012-08-22 23:42   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2012-08-07 17:44 ` [PATCH v0 08/12] x86, microcode, AMD: Read CPUID(1).EAX on the correct cpu Borislav Petkov
2012-08-22 23:43   ` [tip:x86/microcode] x86, microcode, AMD: Read CPUID(1). EAX " tip-bot for Borislav Petkov
2012-08-07 17:44 ` [PATCH v0 09/12] x86, microcode: Add a refresh firmware flag to ->request_microcode_fw Borislav Petkov
2012-08-22 23:44   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2012-08-07 17:44 ` [PATCH v0 10/12] x86, microcode, AMD: Add reverse equiv table search Borislav Petkov
2012-08-22 23:45   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2012-08-07 17:44 ` [PATCH v0 11/12] x86, microcode, AMD: Add a small, per-family patches cache Borislav Petkov
2012-08-22 23:45   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2012-08-07 17:44 ` [PATCH v0 12/12] x86, microcode, AMD: Rewrite patch application procedure Borislav Petkov
2012-08-22 23:46   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2012-08-22 23:22 ` [tip:x86/urgent] x86, microcode, AMD: Fix broken ucode patch size check tip-bot for Andreas Herrmann

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=1344361461-10076-3-git-send-email-bp@amd64.org \
    --to=bp@amd64.org \
    --cc=andreas.herrmann3@amd.com \
    --cc=borislav.petkov@amd.com \
    --cc=hmh@hmh.eng.br \
    --cc=linux-kernel@vger.kernel.org \
    --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

Powered by JetHome