Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3646748imm; Mon, 20 Aug 2018 02:14:39 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxuPUEfvSIhTdHrSNx8aBlYwkA4cBnKGDMrc8MGYBOR1ohSicMD+lucQ8FYfvYrS48OiKFx X-Received: by 2002:a63:db4f:: with SMTP id x15-v6mr41616731pgi.214.1534756479508; Mon, 20 Aug 2018 02:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534756479; cv=none; d=google.com; s=arc-20160816; b=WbjaqYcivAaePWhA65XkiIkzA2vRNV4MBuuJZ8V2tcpr0vCVw6xmzHTx+cabPYSp6X q44ydWQ+exSrYuFOQPo28AO0YbA99Hdun+hDuolyy7DjYz2Q6hsZpXOIZnW/aKRlyROj CD4T+v5NspXL2MO3ii9zv51fJk8UMVOVpeY/fdz7NU8ekhxmZyOzpk5fPqWknkwVNJQV w7SHIagdG3flgj0vVKgN0sgXB0SA2r9Z/6/0G7AVTeE8xXVzZWIX2q/AxB0dEROdc0eJ TmzsBFQRwLbYhHFEZN8cmN5BlGynbzKe6Hg53i2foHCwcbm0tRmhwv7NM5ZvndxLmduo 8nMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Ve9u/kcSbpIOyBPbvtwMo+ABZVdMam5d5v0dEYVdkNY=; b=GCJscJKIXPrO3ZXjps7wBDnBPmdigafKJ/pQZp1ZNtuzbpSHi5MRaDYO6tAvCsXYcY 5IRoDOy5ZAEWSNk+y0h76SWKdQ03HPxVu26neJI8lPYUuDb+PEXbQcxy/oIMZon050PR nTrw4U9R+QaF+vEytFrlbyhET9R3DrT2V+fkxoh4sCLnBuBA0C125uvOs7XvAkB2bMDt 4QMiO4NntJ+vKGEH9ST6EFmWnokmNjiN2MpsRGLoykM1dmsrDUlWFTDeiI3JxPVCSDjo ro4+8wUjY1+GKK/WlaZX6h5HIxTRVHMtFoisQ2ZETE7YRAxYEyH8FNGpeYSlk6VlqK1O vhqA== 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 x9-v6si9096237plo.377.2018.08.20.02.14.24; Mon, 20 Aug 2018 02:14:39 -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 S1726622AbeHTM2E (ORCPT + 99 others); Mon, 20 Aug 2018 08:28:04 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:64507 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726106AbeHTM2D (ORCPT ); Mon, 20 Aug 2018 08:28:03 -0400 Received: from 79.184.253.33.ipv4.supernova.orange.pl (79.184.253.33) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id 5fb2511932ddb9d1; Mon, 20 Aug 2018 11:13:12 +0200 From: "Rafael J. Wysocki" To: Ding Xiang Cc: viresh.kumar@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: acpi: Remove some redundant code Date: Mon, 20 Aug 2018 11:10:57 +0200 Message-ID: <1630840.jvZHOqyeXS@aspire.rjw.lan> In-Reply-To: <1534760111-31614-1-git-send-email-dingxiang@cmss.chinamobile.com> References: <1534760111-31614-1-git-send-email-dingxiang@cmss.chinamobile.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, August 20, 2018 12:15:11 PM CEST Ding Xiang wrote: > 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) > So what exactly is the value of this patch?