From patchwork Mon Jan 28 09:49:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 2054621 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 1D52EE00C6 for ; Mon, 28 Jan 2013 09:47:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751847Ab3A1JrN (ORCPT ); Mon, 28 Jan 2013 04:47:13 -0500 Received: from mail.skyhub.de ([78.46.96.112]:33886 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751755Ab3A1JrM (ORCPT ); Mon, 28 Jan 2013 04:47:12 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1359366431; bh=BYS1hpPqJwSIss/8aAGdbO34geP4QPSEzSyKO9I4zJI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=iFz0/FdLqbMfXAPXWu6S5Xwhfq9ZBAuAnD0GRK C3us7m91L7RGvqXanDmiwmefWKWW5nEao9ego3M6shCJLHGQaA7teHIq77iRaJVjVMl mmIw//6bjEiw5OR9UTdNtiIsXsMysk1ZUkpVsLT1ZkM4p2OhXRtE5SZcxVBYSxe7Qc= Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 5w8D7Rx4fMZE; Mon, 28 Jan 2013 10:47:10 +0100 (CET) Received: from liondog.tnic (p54B7E70E.dip.t-dialin.net [84.183.231.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 7B6AB1D9DC9; Mon, 28 Jan 2013 10:47:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1359366430; bh=BYS1hpPqJwSIss/8aAGdbO34geP4QPSEzSyKO9I4zJI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=RfdB6OP/RzUxxQ3YaHp2OOQ5Kakmmghv92lN3u HliK3TiV/4EsFGmvqyt7WZwBYb1O0siGZUVdO8txd1IXbJhyERojtHsiOtzv3pfG9K8 MPxN+uF1vKnCwzcjGtnEQOpwJGLQPMFb79n+i8CZhiQdeu/9YUsCFs8OIVKgoxsfl0= Received: by liondog.tnic (Postfix, from userid 1000) id BDF47100363; Mon, 28 Jan 2013 10:49:57 +0100 (CET) Date: Mon, 28 Jan 2013 10:49:57 +0100 From: Borislav Petkov To: Viresh Kumar Cc: "Rafael J. Wysocki" , =?utf-8?B?QW5kcsOp?= Przywara , Leonid Isaev , Tom Gundersen , cpufreq@vger.kernel.org, linux-acpi@vger.kernel.org, LKML , Borislav Petkov Subject: Re: [PATCH 4/6] cpufreq: Add a get_current_driver helper Message-ID: <20130128094957.GA6109@pd.tnic> Mail-Followup-To: Borislav Petkov , Viresh Kumar , "Rafael J. Wysocki" , =?utf-8?B?QW5kcsOp?= Przywara , Leonid Isaev , Tom Gundersen , cpufreq@vger.kernel.org, linux-acpi@vger.kernel.org, LKML , Borislav Petkov References: <1358677470-17394-1-git-send-email-bp@alien8.de> <1358677470-17394-5-git-send-email-bp@alien8.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Mon, Jan 28, 2013 at 10:07:10AM +0530, Viresh Kumar wrote: > Two minor things here: > - You placed the routine at bad place. This place is meant for > freq_table helpers. Which one would you suggest: CPUFREQ DRIVER INTERFACE? Btw, this function type splitting looks kinda silly to me. In that same section there are two which clearly don't belong there: struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); void cpufreq_cpu_put(struct cpufreq_policy *data); since they don't have anything to do with freq_table. And since they return cpufreq_policy, they should be maybe called: cpufreq_get_cpu_policy cpufreq_put_cpu_policy or something more expressive, pertaining to what they actually do. But they actually get/put the module (inc/dec the module's refcount) *and* return the cpufreq_policy... whatever, I don't care that much so see below. > - And you really don't need extern for function prototypes. Yeah, Rafael corrected that when committing: http://git.kernel.org/?p=linux/kernel/git/rafael/linux-pm.git;a=commitdiff;h=fcbf43dcacb0daecffca0f5c862c9d8815108e58 Acked-by: Viresh Kumar --- From 830eb9ebc715d329229772d11332c50dfd1d9330 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Mon, 28 Jan 2013 10:38:33 +0100 Subject: [PATCH] cpufreq: Sort function prototypes properly Move function prototypes to a place where they logically fit better. Signed-off-by: Borislav Petkov --- include/linux/cpufreq.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index a018da2d2a7c..f33ace57adb6 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -308,6 +308,9 @@ __ATTR(_name, 0444, show_##_name, NULL) static struct global_attr _name = \ __ATTR(_name, 0644, show_##_name, store_##_name) +struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); +void cpufreq_cpu_put(struct cpufreq_policy *data); +const char *cpufreq_get_current_driver(void); /********************************************************************* * CPUFREQ 2.6. INTERFACE * @@ -397,8 +400,6 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, /* the following 3 funtions are for cpufreq core use only */ struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); -struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); -void cpufreq_cpu_put(struct cpufreq_policy *data); /* the following are really really optional */ extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; @@ -407,5 +408,4 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, unsigned int cpu); void cpufreq_frequency_table_put_attr(unsigned int cpu); -extern const char *cpufreq_get_current_driver(void); #endif /* _LINUX_CPUFREQ_H */