2014-02-26 16:39:00

by Rashika Kheria

[permalink] [raw]
Subject: [PATCH v2] drivers: cpufreq: Mark function as static in cpufreq.c

Mark function as static in cpufreq.c because it is not
used outside this file.

This eliminates the following warning in cpufreq.c:
drivers/cpufreq/cpufreq.c:355:9: warning: no previous prototype for ‘show_boost’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <[email protected]>
---
drivers/cpufreq/cpufreq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 08ca8c9..54fd670 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -352,7 +352,7 @@ EXPORT_SYMBOL_GPL(cpufreq_notify_post_transition);
/*********************************************************************
* SYSFS INTERFACE *
*********************************************************************/
-ssize_t show_boost(struct kobject *kobj,
+static ssize_t show_boost(struct kobject *kobj,
struct attribute *attr, char *buf)
{
return sprintf(buf, "%d\n", cpufreq_driver->boost_enabled);
--
1.7.9.5


2014-02-26 16:41:52

by Josh Triplett

[permalink] [raw]
Subject: Re: [PATCH v2] drivers: cpufreq: Mark function as static in cpufreq.c

On Wed, Feb 26, 2014 at 10:08:26PM +0530, Rashika Kheria wrote:
> Mark function as static in cpufreq.c because it is not
> used outside this file.
>
> This eliminates the following warning in cpufreq.c:
> drivers/cpufreq/cpufreq.c:355:9: warning: no previous prototype for ‘show_boost’ [-Wmissing-prototypes]
>
> Signed-off-by: Rashika Kheria <[email protected]>

I don't see any uses of this function in cpufreq.c; have uses appeared
in a development branch?

> drivers/cpufreq/cpufreq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 08ca8c9..54fd670 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -352,7 +352,7 @@ EXPORT_SYMBOL_GPL(cpufreq_notify_post_transition);
> /*********************************************************************
> * SYSFS INTERFACE *
> *********************************************************************/
> -ssize_t show_boost(struct kobject *kobj,
> +static ssize_t show_boost(struct kobject *kobj,
> struct attribute *attr, char *buf)
> {
> return sprintf(buf, "%d\n", cpufreq_driver->boost_enabled);
> --
> 1.7.9.5
>

2014-02-26 16:46:00

by Rashika Kheria

[permalink] [raw]
Subject: Re: [PATCH v2] drivers: cpufreq: Mark function as static in cpufreq.c

On Wed, Feb 26, 2014 at 10:11 PM, Josh Triplett <[email protected]> wrote:
> On Wed, Feb 26, 2014 at 10:08:26PM +0530, Rashika Kheria wrote:
>> Mark function as static in cpufreq.c because it is not
>> used outside this file.
>>
>> This eliminates the following warning in cpufreq.c:
>> drivers/cpufreq/cpufreq.c:355:9: warning: no previous prototype for 'show_boost' [-Wmissing-prototypes]
>>
>> Signed-off-by: Rashika Kheria <[email protected]>
>
> I don't see any uses of this function in cpufreq.c; have uses appeared
> in a development branch?
>

It isn't used directly but through "define_one_global_rw(boost);".

The "define_one_global_rw()" is defined in include/linux/cpufreq.h. It
therefore, need the definition of the function.

>> drivers/cpufreq/cpufreq.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>> index 08ca8c9..54fd670 100644
>> --- a/drivers/cpufreq/cpufreq.c
>> +++ b/drivers/cpufreq/cpufreq.c
>> @@ -352,7 +352,7 @@ EXPORT_SYMBOL_GPL(cpufreq_notify_post_transition);
>> /*********************************************************************
>> * SYSFS INTERFACE *
>> *********************************************************************/
>> -ssize_t show_boost(struct kobject *kobj,
>> +static ssize_t show_boost(struct kobject *kobj,
>> struct attribute *attr, char *buf)
>> {
>> return sprintf(buf, "%d\n", cpufreq_driver->boost_enabled);
>> --
>> 1.7.9.5
>>



--
Rashika Kheria
B.Tech CSE
IIIT Hyderabad

2014-02-26 16:52:57

by Dirk Brandewie

[permalink] [raw]
Subject: Re: [PATCH v2] drivers: cpufreq: Mark function as static in cpufreq.c

On 02/26/2014 08:41 AM, Josh Triplett wrote:
> On Wed, Feb 26, 2014 at 10:08:26PM +0530, Rashika Kheria wrote:
>> Mark function as static in cpufreq.c because it is not
>> used outside this file.
>>
>> This eliminates the following warning in cpufreq.c:
>> drivers/cpufreq/cpufreq.c:355:9: warning: no previous prototype for ‘show_boost’ [-Wmissing-prototypes]
>>
>> Signed-off-by: Rashika Kheria <[email protected]>
>
> I don't see any uses of this function in cpufreq.c; have uses appeared
> in a development branch?
>

This is a sysfs accessor used to control the boost feature it is not used by the
core but userspace.


>> drivers/cpufreq/cpufreq.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>> index 08ca8c9..54fd670 100644
>> --- a/drivers/cpufreq/cpufreq.c
>> +++ b/drivers/cpufreq/cpufreq.c
>> @@ -352,7 +352,7 @@ EXPORT_SYMBOL_GPL(cpufreq_notify_post_transition);
>> /*********************************************************************
>> * SYSFS INTERFACE *
>> *********************************************************************/
>> -ssize_t show_boost(struct kobject *kobj,
>> +static ssize_t show_boost(struct kobject *kobj,
>> struct attribute *attr, char *buf)
>> {
>> return sprintf(buf, "%d\n", cpufreq_driver->boost_enabled);
>> --
>> 1.7.9.5
>>
> --
> To unsubscribe from this list: send the line "unsubscribe cpufreq" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2014-02-26 17:09:02

by Josh Triplett

[permalink] [raw]
Subject: Re: [PATCH v2] drivers: cpufreq: Mark function as static in cpufreq.c

On Wed, Feb 26, 2014 at 10:15:57PM +0530, Rashika Kheria wrote:
> On Wed, Feb 26, 2014 at 10:11 PM, Josh Triplett <[email protected]> wrote:
> > On Wed, Feb 26, 2014 at 10:08:26PM +0530, Rashika Kheria wrote:
> >> Mark function as static in cpufreq.c because it is not
> >> used outside this file.
> >>
> >> This eliminates the following warning in cpufreq.c:
> >> drivers/cpufreq/cpufreq.c:355:9: warning: no previous prototype for 'show_boost' [-Wmissing-prototypes]
> >>
> >> Signed-off-by: Rashika Kheria <[email protected]>
> >
> > I don't see any uses of this function in cpufreq.c; have uses appeared
> > in a development branch?
> >
>
> It isn't used directly but through "define_one_global_rw(boost);".
>
> The "define_one_global_rw()" is defined in include/linux/cpufreq.h. It
> therefore, need the definition of the function.

Ah, that's quite non-obvious. Hiding the "show_" makes that hard to
grep for.

Reviewed-by: Josh Triplett <[email protected]>

> >> drivers/cpufreq/cpufreq.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> >> index 08ca8c9..54fd670 100644
> >> --- a/drivers/cpufreq/cpufreq.c
> >> +++ b/drivers/cpufreq/cpufreq.c
> >> @@ -352,7 +352,7 @@ EXPORT_SYMBOL_GPL(cpufreq_notify_post_transition);
> >> /*********************************************************************
> >> * SYSFS INTERFACE *
> >> *********************************************************************/
> >> -ssize_t show_boost(struct kobject *kobj,
> >> +static ssize_t show_boost(struct kobject *kobj,
> >> struct attribute *attr, char *buf)
> >> {
> >> return sprintf(buf, "%d\n", cpufreq_driver->boost_enabled);
> >> --
> >> 1.7.9.5
> >>
>
>
>
> --
> Rashika Kheria
> B.Tech CSE
> IIIT Hyderabad

2014-02-27 05:25:21

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH v2] drivers: cpufreq: Mark function as static in cpufreq.c

Hi Rashika,

On 26 February 2014 22:08, Rashika Kheria <[email protected]> wrote:
> Mark function as static in cpufreq.c because it is not
> used outside this file.
>
> This eliminates the following warning in cpufreq.c:
> drivers/cpufreq/cpufreq.c:355:9: warning: no previous prototype for 'show_boost' [-Wmissing-prototypes]

Can you please elaborate how this warning is related to
the non-static definition of this function?

> Signed-off-by: Rashika Kheria <[email protected]>
> ---
> drivers/cpufreq/cpufreq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 08ca8c9..54fd670 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -352,7 +352,7 @@ EXPORT_SYMBOL_GPL(cpufreq_notify_post_transition);
> /*********************************************************************
> * SYSFS INTERFACE *
> *********************************************************************/
> -ssize_t show_boost(struct kobject *kobj,
> +static ssize_t show_boost(struct kobject *kobj,
> struct attribute *attr, char *buf)
> {
> return sprintf(buf, "%d\n", cpufreq_driver->boost_enabled);
> --
> 1.7.9.5
>