Skip to contentSkip to conversation

kernel/notifier.c: simplify expression

PATCH New [email protected] 1 participant 1 message Feb 24, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 104/124 kernel/notifier.c: simplify expression

From: Viresh Kumar <[email protected]>
Subject: kernel/notifier.c: simplify expression

NOTIFY_STOP_MASK (0x8000) has only one bit set and there is no need to compare output of "ret & NOTIFY_STOP_MASK" to NOTIFY_STOP_MASK. We just need to make sure the output is non-zero, that's it.

---

 kernel/notifier.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/notifier.c renamed from kernel/notifier.c~notifier-simplify-expression +1 -1
diff -puN kernel/notifier.c~notifier-simplify-expression kernel/notifier.c
@@ -95,7 +95,7 @@ static int notifier_call_chain(struct no
 		if (nr_calls)
 			(*nr_calls)++;
 
-		if ((ret & NOTIFY_STOP_MASK) == NOTIFY_STOP_MASK)
+		if (ret & NOTIFY_STOP_MASK)
 			break;
 		nb = next_nb;
 		nr_to_call--;

_