kexec: fix compilation warning on xchg(&kexec_lock, 0) in kernel_kexec()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, August 15, 2008 - 9:59 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4cd69b...
Commit:     4cd69b986ebf0f8da93f82ffbb89c032ee09c2e1
Parent:     ce289e89726948b50a58c9e8f4e81174a8c9c254
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Fri Aug 15 00:40:20 2008 -0700
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Fri Aug 15 08:35:42 2008 -0700

    kexec: fix compilation warning on xchg(&kexec_lock, 0) in kernel_kexec()
    
    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>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 kernel/kexec.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/kexec.c b/kernel/kexec.c
index c8a4370..cf3797b 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1503,7 +1503,8 @@ int kernel_kexec(void)
 	}
 
  Unlock:
-	xchg(&kexec_lock, 0);
+	if (!xchg(&kexec_lock, 0))
+		BUG();
 
 	return error;
 }
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
kexec: fix compilation warning on xchg(&kexec_lock, 0) in ..., Linux Kernel Mailing ..., (Fri Aug 15, 9:59 am)