Re: [PATCH] kexec jump: fix compiling warning on xchg(&kexec_lock, 0) in kernel_kexec()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Huang Ying <ying.huang@...>
Cc: Eric W. Biederman <ebiederm@...>, Pavel Machek <pavel@...>, <nigel@...>, Rafael J. Wysocki <rjw@...>, Vivek Goyal <vgoyal@...>, <mingo@...>, Linus Torvalds <torvalds@...>, <linux-kernel@...>, Kexec Mailing List <kexec@...>
Date: Wednesday, August 13, 2008 - 5:27 am

On Wed, 13 Aug 2008 17:12:40 +0800 Huang Ying <ying.huang@intel.com> wrote:


Would prefer that thi code not use such a peculair idiom.  I don't
believe that it needs to.

I guess that's a separate activity.


Please always quote the compiler output in the changelog when fixing
warnings and build errors.

The patch is titled "kexec jump: ..." whereas this is just a plain old
kexec fix, which is applicable to mainline.

We don't need to create that local.  I queued this:



Subject: kexec: fix compilation warning on xchg(&kexec_lock, 0) in kernel_kexec()
From: Huang Ying <ying.huang@intel.com>

kernel/kexec.c: In function 'kernel_kexec':
kernel/kexec.c:1506: warning: value computed is not used

Signed-off-by: Huang Ying <ying.huang@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/kexec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN kernel/kexec.c~kexec-jump-fix-compiling-warning-on-xchgkexec_lock-0-in-kernel_kexec kernel/kexec.c
--- a/kernel/kexec.c~kexec-jump-fix-compiling-warning-on-xchgkexec_lock-0-in-kernel_kexec
+++ a/kernel/kexec.c
@@ -1503,7 +1503,8 @@ int kernel_kexec(void)
 	}
 
  Unlock:
-	xchg(&kexec_lock, 0);
+	if (!xchg(&kexec_lock, 0))
+		BUG();
 
 	return error;
 }
_

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] kexec jump: fix compiling warning on xchg(&amp;k..., Eric W. Biederman, (Wed Aug 13, 2:12 pm)
Re: [PATCH] kexec jump: fix compiling warning on xchg(&k..., Andrew Morton, (Wed Aug 13, 5:27 am)