All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Oruba <peter.oruba@amd.com>
To: Dmitry Adamushko <dmitry.adamushko@gmail.com>,
	Ingo Molnar <mingo@elte.hu>
Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86, microcode rework, v2, renaming cont.
Date: Wed, 17 Sep 2008 15:39:18 +0200	[thread overview]
Message-ID: <200809171350.m8HDoQ2E017297@elemente.amd.com> (raw)
In-Reply-To: <b647ffbd0809161443o5b7bf71aw59853d8d6086ee2d@mail.gmail.com>

Renaming based on patch from Dmitry Adamushko.

Further clarification by renaming define and variable related to
microcode container file.

Signed-off-by: Peter Oruba <peter.oruba@amd.com>


---
 arch/x86/kernel/microcode_amd.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 8d97840..113be63 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -233,21 +233,20 @@ static void * get_next_ucode(u8 *buf, unsigned int size,
 			unsigned int *mc_size)
 {
 	unsigned int total_size;
-#define UCODE_UNKNOWN_HDR	8
-	u8 hdr[UCODE_UNKNOWN_HDR];
+#define UCODE_CONTAINER_SECTION_HDR	8
+	u8 section_hdr[UCODE_CONTAINER_SECTION_HDR];
 	void *mc;
 
-	if (get_ucode_data(hdr, buf, UCODE_UNKNOWN_HDR))
+	if (get_ucode_data(section_hdr, buf, UCODE_CONTAINER_SECTION_HDR))
 		return NULL;
 
-	if (hdr[0] != UCODE_UCODE_TYPE) {
+	if (section_hdr[0] != UCODE_UCODE_TYPE) {
 		printk(KERN_ERR "microcode: error! "
 		       "Wrong microcode payload type field\n");
 		return NULL;
 	}
 
-	/* FIXME! dimm: Why not by means of get_totalsize(hdr)? */
-	total_size = (unsigned long) (hdr[4] + (hdr[5] << 8));
+	total_size = (unsigned long) (section_hdr[4] + (section_hdr[5] << 8));
 
 	printk(KERN_INFO "microcode: size %u, total_size %u\n",
 		size, total_size);
@@ -260,13 +259,13 @@ static void * get_next_ucode(u8 *buf, unsigned int size,
 	mc = vmalloc(UCODE_MAX_SIZE);
 	if (mc) {
 		memset(mc, 0, UCODE_MAX_SIZE);
-		if (get_ucode_data(mc, buf + UCODE_UNKNOWN_HDR, total_size)) {
+		if (get_ucode_data(mc, buf + UCODE_CONTAINER_SECTION_HDR, total_size)) {
 			vfree(mc);
 			mc = NULL;
 		} else
-			*mc_size = total_size + UCODE_UNKNOWN_HDR;
+			*mc_size = total_size + UCODE_CONTAINER_SECTION_HDR;
 	}
-#undef UCODE_UNKNOWN_HDR
+#undef UCODE_CONTAINER_SECTION_HDR
 	return mc;
 }
 
-- 
1.5.4.1


      parent reply	other threads:[~2008-09-17 13:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-14  9:14 [x86-tip, patch] rework of the microcode splitup Dmitry Adamushko
2008-09-14  9:18 ` Dmitry Adamushko
2008-09-14 12:55 ` Ingo Molnar
2008-09-16 21:43   ` Dmitry Adamushko
2001-09-16 22:00     ` [PATCH] x86, microcode rework, v2, renaming Peter Oruba
2008-09-17 13:39     ` Peter Oruba [this message]

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=200809171350.m8HDoQ2E017297@elemente.amd.com \
    --to=peter.oruba@amd.com \
    --cc=dmitry.adamushko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tigran@aivazian.fsnet.co.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.