kexec: fix compilation warning on xchg(&kexec_lock, 0) in kernel_kexec()
authorHuang Ying <ying.huang@intel.com>
Fri, 15 Aug 2008 07:40:20 +0000 (00:40 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Aug 2008 15:35:42 +0000 (08:35 -0700)
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

index c8a4370e2a34e94b2e391fada22fec051b162195..cf3797b767863a31f7518b6bb3819961eec37d87 100644 (file)
@@ -1503,7 +1503,8 @@ int kernel_kexec(void)
        }
 
  Unlock:
-       xchg(&kexec_lock, 0);
+       if (!xchg(&kexec_lock, 0))
+               BUG();
 
        return error;
 }