kernel/smp.c: use '|=' for csd_lock
authorliguang <[email protected]>
Tue, 30 Apr 2013 22:27:25 +0000 (15:27 -0700)
committerLinus Torvalds <[email protected]>
Wed, 1 May 2013 00:04:02 +0000 (17:04 -0700)
csd_lock() uses assignment to data->flags rather than |=.  That is not
buggy at present because only one bit (CSD_FLAG_LOCK) is defined in
call_single_data.flags.

But it will become buggy if we later add another flag, so fix it now.

Signed-off-by: liguang <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
kernel/smp.c

index 8e451f3ff51b818796bf5ca4e4b3189a215b367a..b320622543e901741eda59d636ed812b4329d60a 100644 (file)
@@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data)
 static void csd_lock(struct call_single_data *data)
 {
        csd_lock_wait(data);
-       data->flags = CSD_FLAG_LOCK;
+       data->flags |= CSD_FLAG_LOCK;
 
        /*
         * prevent CPU from reordering the above assignment