Skip to contentSkip to conversation

x86: kernel/apb_timer.c: remove unnecessary "if"

PATCH In review Cong Ding 1 participant 2 messages Jan 14, 2013 – Jan 24, 2013 x86

lore
Share & tools
lore

Cong Ding

author
#0 lore raw

PATCH 1/1 x86: kernel/apb_timer.c: remove unnecessary "if"

adev has no chance to be NULL, so we don't need to check it. it is also used before the check in line 241.

---
 arch/x86/kernel/apb_timer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/apb_timer.c +1 -1
index cc74fd0..c9876ef 100644
@@ -240,7 +240,7 @@ static int apbt_cpuhp_notify(struct notifier_block *n,
 		dw_apb_clockevent_pause(adev->timer);
 		if (system_state == SYSTEM_RUNNING) {
 			pr_debug("skipping APBT CPU %lu offline\n", cpu);
-		} else if (adev) {
+		} else {
 			pr_debug("APBT clockevent for cpu %lu offline\n", cpu);
 			dw_apb_clockevent_stop(adev->timer);
 		}
Signature · 1 line
1.7.9.5
#1 lore raw

[tip:x86/platform] x86/apb/timer: Remove unnecessary "if"

Commit-ID:  b9975dabe3f0a6e4d1af52c47f66b5558df207a3
Gitweb:     http://git.kernel.org/tip/b9975dabe3f0a6e4d1af52c47f66b5558df207a3
Author:     Cong Ding <[email protected]>
AuthorDate: Mon, 14 Jan 2013 22:39:18 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 24 Jan 2013 13:03:26 +0100

x86/apb/timer: Remove unnecessary "if"

adev has no chance to be NULL, so we don't need to check it. It is also dereferenced just before the check .

---
 arch/x86/kernel/apb_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/apb_timer.c +1 -1
index afdc3f75..cf92735 100644
@@ -240,7 +240,7 @@ static int apbt_cpuhp_notify(struct notifier_block *n,
 		dw_apb_clockevent_pause(adev->timer);
 		if (system_state == SYSTEM_RUNNING) {
 			pr_debug("skipping APBT CPU %lu offline\n", cpu);
-		} else if (adev) {
+		} else {
 			pr_debug("APBT clockevent for cpu %lu offline\n", cpu);
 			dw_apb_clockevent_stop(adev->timer);
 		}