All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <jj@chaosbits.net>
To: linux-kernel@vger.kernel.org
Cc: Peter Oruba <peter.oruba@amd.com>,
	Andreas Herrmann <andreas.herrmann3@amd.com>,
	amd64-microcode@amd64.org
Subject: [PATCH] AMD Microcode: Prefer vzalloc() over calls to vmalloc()+memset()
Date: Sat, 30 Oct 2010 21:23:14 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1010302118160.1572@swampdragon.chaosbits.net> (raw)

Hi,

We don't have to do memset() ourselves after vmalloc() when we have 
vzalloc(), so change that in 
arch/x86/kernel/microcode_amd.c::get_next_ucode().

Please CC me on replies.


Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
compile tested only.

 microcode_amd.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index e1af7c0..d46e805 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -183,9 +183,8 @@ get_next_ucode(const u8 *buf, unsigned int size, unsigned int *mc_size)
 		return NULL;
 	}
 
-	mc = vmalloc(UCODE_MAX_SIZE);
+	mc = vzalloc(UCODE_MAX_SIZE);
 	if (mc) {
-		memset(mc, 0, UCODE_MAX_SIZE);
 		if (get_ucode_data(mc, buf + UCODE_CONTAINER_SECTION_HDR,
 				   total_size)) {
 			vfree(mc);


-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html


             reply	other threads:[~2010-10-30 19:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-30 19:23 Jesper Juhl [this message]
2010-10-31 10:08 ` [PATCH] AMD Microcode: Prefer vzalloc() over calls to vmalloc()+memset() Borislav Petkov
2010-11-01 19:23   ` Jesper Juhl
2010-11-01 21:27     ` Borislav Petkov
2010-11-01 21:44       ` [PATCH v2] " Jesper Juhl
2010-11-02 17:51         ` 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=alpine.LNX.2.00.1010302118160.1572@swampdragon.chaosbits.net \
    --to=jj@chaosbits.net \
    --cc=amd64-microcode@amd64.org \
    --cc=andreas.herrmann3@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.oruba@amd.com \
    /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.