From patchwork Thu Oct 25 16:13:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 12526 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C3B6F23F58 for ; Thu, 25 Oct 2012 16:13:27 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 56EDCA18897 for ; Thu, 25 Oct 2012 16:13:27 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so2371795iej.11 for ; Thu, 25 Oct 2012 09:13:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=BktIu3SQT0GMOnww5TvO3uM+ahdjbxXUlfG8K5Re2yA=; b=WDJIucAnbsXi2HPBz7bZQlePgpzBgj4WgdoPZ5X8sEHoIrxzKd+oQTyjuDStrCm54o qqQgQiNEDkj7Lkj2PusaqIc6Wr1CIka+o1hgW76+ZvpxjMzBaVfgce6sb4mOV5ZBivUW b8N98vNZFjL1TsWtSxk3ct2csZbyixcaP+OayWTKYA0VxufmzBStoBvY8YFjx1eTQ4vS Q1dfehnHdwXRvt+19hZc2v6UTGyttJjacic69xTMJL2zraLh8fLn7nkrODeybmSqqibA lir/NkiGhYMd7wGy7ccFwgx5V7TtT0zhrRwszy0HrKaav1nArxIunyoFNtjQpPpftkrx oQUQ== Received: by 10.50.140.97 with SMTP id rf1mr4924064igb.70.1351181606728; Thu, 25 Oct 2012 09:13:26 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp76430igt; Thu, 25 Oct 2012 09:13:25 -0700 (PDT) Received: by 10.180.100.136 with SMTP id ey8mr14972778wib.1.1351181604496; Thu, 25 Oct 2012 09:13:24 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id h60si4363032wea.78.2012.10.25.09.13.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Oct 2012 09:13:24 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-we0-f178.google.com with SMTP id r6so1158180wey.37 for ; Thu, 25 Oct 2012 09:13:23 -0700 (PDT) Received: by 10.180.106.9 with SMTP id gq9mr14940558wib.12.1351181603681; Thu, 25 Oct 2012 09:13:23 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-373-205.w86-199.abo.wanadoo.fr. [86.199.108.205]) by mx.google.com with ESMTPS id hv8sm10721548wib.0.2012.10.25.09.13.21 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Oct 2012 09:13:22 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com Cc: x86@kernel.org, linaro-dev@lists.linaro.org, patches@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH] x86 : remove dead code Date: Thu, 25 Oct 2012 18:13:11 +0200 Message-Id: <1351181591-8710-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 X-Gm-Message-State: ALoCoQn79lX5mYIHzFbLgtYs0jynR6CHzvzbYvz5nNv10UzM2VJBYDA8mxvbOZ9S2zO5Z0wrqNDm The hlt_use_halt function returns always true and there is only one definition of it. The default_idle function can then get ride of the if ... statement and we can remove the else branch. Signed-off-by: Daniel Lezcano --- arch/x86/kernel/process.c | 39 ++++++++++++++------------------------- 1 files changed, 14 insertions(+), 25 deletions(-) diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index b644e1c..2f99e31 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -306,11 +306,6 @@ void (*pm_idle)(void); EXPORT_SYMBOL(pm_idle); #endif -static inline int hlt_use_halt(void) -{ - return 1; -} - #ifndef CONFIG_SMP static inline void play_dead(void) { @@ -410,28 +405,22 @@ void cpu_idle(void) */ void default_idle(void) { - if (hlt_use_halt()) { - trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id()); - trace_cpu_idle_rcuidle(1, smp_processor_id()); - current_thread_info()->status &= ~TS_POLLING; - /* - * TS_POLLING-cleared state must be visible before we - * test NEED_RESCHED: - */ - smp_mb(); + trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id()); + trace_cpu_idle_rcuidle(1, smp_processor_id()); + current_thread_info()->status &= ~TS_POLLING; + /* + * TS_POLLING-cleared state must be visible before we + * test NEED_RESCHED: + */ + smp_mb(); - if (!need_resched()) - safe_halt(); /* enables interrupts racelessly */ - else - local_irq_enable(); - current_thread_info()->status |= TS_POLLING; - trace_power_end_rcuidle(smp_processor_id()); - trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id()); - } else { + if (!need_resched()) + safe_halt(); /* enables interrupts racelessly */ + else local_irq_enable(); - /* loop is done by the caller */ - cpu_relax(); - } + current_thread_info()->status |= TS_POLLING; + trace_power_end_rcuidle(smp_processor_id()); + trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id()); } #ifdef CONFIG_APM_MODULE EXPORT_SYMBOL(default_idle);