Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3646399imm; Mon, 20 Aug 2018 02:14:12 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyufFvQpeXIongnjy+R/JsaX4NHlMiWO9qdink6Jn7zm6147YkkiaDJqIBEWKC2q/tU1AfZ X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr8493227pla.285.1534756452254; Mon, 20 Aug 2018 02:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534756452; cv=none; d=google.com; s=arc-20160816; b=T1dO0c6W8vThJBEwhYF4ISUPtjYW6uWtKwLXwM/T2mJHcCBchkL+8kVokoDPBxc/s5 B0YEWQm3Xn8i7rDcsa3Y5jiOH1ecFeJRNEnZbq1r04/w5x0dLibvLq3oXUmkAQgslX5o 0wf5FnLq3ZR5fRbC283NWmhhxg1/JQ1esWWS4EhA+tfg7MMfcjJdK73LInFWO0UwUxz8 2Jk9QeqCCOBKxrsAR/fzvVKg3UHr6zkjYPlyY5sRxuokcZKNlv+NFUOIe91YWc50nhrn MH7CgLl308eypib3oE5B365meKx+SubdupcWYLTSvTX29mnywA3c8Sq5eVf/V3XzlEly xANg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :arc-authentication-results; bh=zH+h/CpBO1JikAP65s8MRNhWAzDV4JioCyXARjgfAIA=; b=LuqzQ6hanu9HpgYRLQ77Sbf/gBmdpBwSSXBDILvmvCxZiINvqKaxuvp52yatWj/Uv8 gXur/p9ZnKJfXnNJ+R3WdNdIAj6pprqEfnmT8jTq9i85FzfZRyHcyI/yTlsArL0MDcAI wtadurqkzRxnQWBLyoN6RHppPjTwoUTdK48DGwdm3HGCep5eqohSOEs9kgrGgx0yGaZG XofMSmNCN7bbliaf8FF1NMyHS+T8uNSEX1MLuSePHen6QgDZSMsat49YG74mnIBvZn8w aVK4Ce2qD0yBDipQMzUj2cI5Wf3GQjRPua97K3od/DF444w9XOnQChd/gGWmVzCn/rHd x1LA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay4-v6si9127854plb.201.2018.08.20.02.13.57; Mon, 20 Aug 2018 02:14:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726268AbeHTM1n (ORCPT + 99 others); Mon, 20 Aug 2018 08:27:43 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:43619 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbeHTM1n (ORCPT ); Mon, 20 Aug 2018 08:27:43 -0400 X-Greylist: delayed 548 seconds by postgrey-1.27 at vger.kernel.org; Mon, 20 Aug 2018 08:27:38 EDT Received: from spf.mail.chinamobile.com (unknown[172.16.121.13]) by rmmx-syy-dmz-app09-12009 (RichMail) with SMTP id 2ee95b7a83ec8b6-6e35c; Mon, 20 Aug 2018 17:03:40 +0800 (CST) X-RM-TRANSID: 2ee95b7a83ec8b6-6e35c X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from bclinux72.localdomain (unknown[223.105.0.243]) by rmsmtp-syy-appsvr07-12007 (RichMail) with SMTP id 2ee75b7a83ebc47-2dd7c; Mon, 20 Aug 2018 17:03:40 +0800 (CST) X-RM-TRANSID: 2ee75b7a83ebc47-2dd7c From: Ding Xiang To: rjw@rjwysocki.net, viresh.kumar@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: acpi: Remove some redundant code Date: Mon, 20 Aug 2018 06:15:11 -0400 Message-Id: <1534760111-31614-1-git-send-email-dingxiang@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For single statement blocks,braces are not necessary. And "else" is not useful after return. So,remove these code. Signed-off-by: Ding Xiang --- drivers/cpufreq/acpi-cpufreq.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index b61f4ec..0751a0a 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -423,9 +423,8 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy, unsigned int next_perf_state = 0; /* Index into perf table */ int result = 0; - if (unlikely(!data)) { + if (unlikely(!data)) return -ENODEV; - } perf = to_perf_data(data); next_perf_state = policy->freq_table[index].driver_data; @@ -521,11 +520,10 @@ static unsigned int acpi_cpufreq_fast_switch(struct cpufreq_policy *policy, } perf->state = perf->state_count-1; return freqn; - } else { - /* assume CPU is at P0... */ - perf->state = 0; - return perf->states[0].core_frequency * 1000; } + /* assume CPU is at P0... */ + perf->state = 0; + return perf->states[0].core_frequency * 1000; } static void free_acpi_perf_data(void) -- 1.8.3.1