All of lore.kernel.org
 help / color / mirror / Atom feed
From: bill4carson@gmail.com
To: bill4carson@gmail.com
Cc: linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] Copy machine descriptor after probe succeed
Date: Tue, 20 Dec 2011 17:08:47 +0800	[thread overview]
Message-ID: <1324372127-8552-2-git-send-email-bill4carson@gmail.com> (raw)
In-Reply-To: <1324372127-8552-1-git-send-email-bill4carson@gmail.com>

From: Bill Carson <bill4carson@gmail.com>

It make more sense to copy machine descriptor AFTER machine probe return
succeed.

Signed-off-by: Bill Carson <bill4carson@gmail.com>
---
 arch/powerpc/kernel/setup-common.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index d426b1d..3362097 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -574,9 +574,9 @@ void probe_machine(void)
 	     machine_id < &__machine_desc_end;
 	     machine_id++) {
 		DBG("  %s ...", machine_id->name);
-		memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls));
-		if (ppc_md.probe()) {
+		if (machine_id->probe()) {
 			DBG(" match !\n");
+			memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls));
 			break;
 		}
 		DBG("\n");
-- 
1.6.3.1

  reply	other threads:[~2011-12-20  9:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20  9:08 [PATCH-v1]Copy machine descriptor after probe succeed bill4carson
2011-12-20  9:08 ` bill4carson [this message]
2011-12-20 10:17   ` [PATCH] Copy " Stephen Rothwell
2011-12-21  2:15     ` bill4carson

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=1324372127-8552-2-git-send-email-bill4carson@gmail.com \
    --to=bill4carson@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.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 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.