From patchwork Wed Mar 19 23:25:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stratos Karafotis X-Patchwork-Id: 3862091 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1D3229F334 for ; Wed, 19 Mar 2014 23:25:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4838E201F9 for ; Wed, 19 Mar 2014 23:25:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A879C20203 for ; Wed, 19 Mar 2014 23:25:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757481AbaCSXZS (ORCPT ); Wed, 19 Mar 2014 19:25:18 -0400 Received: from sema.semaphore.gr ([78.46.194.137]:45317 "EHLO sema.semaphore.gr" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755129AbaCSXZR (ORCPT ); Wed, 19 Mar 2014 19:25:17 -0400 Received: from albert.lan (ppp079166134095.access.hol.gr [79.166.134.95]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: stratosk) by sema.semaphore.gr (Postfix) with ESMTPSA id D887B82C01; Thu, 20 Mar 2014 00:25:13 +0100 (CET) Message-ID: <532A2759.1000708@semaphore.gr> Date: Thu, 20 Mar 2014 01:25:13 +0200 From: Stratos Karafotis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: "Rafael J. Wysocki" CC: Viresh Kumar , "cpufreq@vger.kernel.org" , "linux-pm@vger.kernel.org" , LKML Subject: Re: [PATCH] cpufreq: Remove unnecessary braces References: <532A0D0C.50507@semaphore.gr> <93042283.W9rbzHbJB2@vostro.rjw.lan> In-Reply-To: <93042283.W9rbzHbJB2@vostro.rjw.lan> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 20/03/2014 12:45 ??, Rafael J. Wysocki wrote: > On Wednesday, March 19, 2014 11:33:00 PM Stratos Karafotis wrote: >> Remove 3 sets of unnecessary braces >> >> Signed-off-by: Stratos Karafotis >> --- >> drivers/cpufreq/cpufreq.c | 11 ++++------- >> 1 file changed, 4 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c >> index 1eafd8c..ca3c01f 100644 >> --- a/drivers/cpufreq/cpufreq.c >> +++ b/drivers/cpufreq/cpufreq.c >> @@ -1325,17 +1325,16 @@ static int __cpufreq_remove_dev_prepare(struct device *dev, >> cpus = cpumask_weight(policy->cpus); >> up_read(&policy->rwsem); >> >> - if (cpu != policy->cpu) { >> + if (cpu != policy->cpu) >> sysfs_remove_link(&dev->kobj, "cpufreq"); >> - } else if (cpus > 1) { > > These braces aren't in fact unnecessary, they are in accordance with CodingStyle. > >> + else if (cpus > 1) { >> new_cpu = cpufreq_nominate_new_policy_cpu(policy, cpu); >> if (new_cpu >= 0) { >> update_policy_cpu(policy, new_cpu); >> >> - if (!cpufreq_suspended) { >> + if (!cpufreq_suspended) >> pr_debug("%s: policy Kobject moved to cpu: %d from: %d\n", >> __func__, new_cpu, cpu); >> - } >> } >> } >> >> @@ -2158,11 +2157,9 @@ int cpufreq_update_policy(unsigned int cpu) >> if (!policy->cur) { >> pr_debug("Driver did not initialize current freq\n"); >> policy->cur = new_policy.cur; >> - } else { >> - if (policy->cur != new_policy.cur && has_target()) >> + } else if (policy->cur != new_policy.cur && has_target()) > > And here too. > >> cpufreq_out_of_sync(cpu, policy->cur, >> new_policy.cur); >> - } >> } >> >> ret = cpufreq_set_policy(policy, &new_policy); >> > I'm sorry for the inconvenience. I read again the CodingStyle (more carefully :) ). I'm sending the corrected patch with the single case of unnecessary braces. Thanks, Stratos ------------------------8<----------------------- Remove unnecessary braces from a single statement. Signed-off-by: Stratos Karafotis Acked-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index e3aa9de..220c4a9 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1330,10 +1330,9 @@ static int __cpufreq_remove_dev_prepare(struct device *dev, if (new_cpu >= 0) { update_policy_cpu(policy, new_cpu); - if (!cpufreq_suspended) { + if (!cpufreq_suspended) pr_debug("%s: policy Kobject moved to cpu: %d from: %d\n", __func__, new_cpu, cpu); - } } }