kexec: fix compilation warning on xchg(&kexec_lock, 0) in kernel_kexec()
authorHuang Ying <[email protected]>
Fri, 15 Aug 2008 07:40:20 +0000 (00:40 -0700)
committerLinus Torvalds <[email protected]>
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 <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
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;
 }