linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: devfreq_cooling: Fix kernel-doc
@ 2021-06-08  9:46 Yang Li
  2021-06-08 18:39 ` Nick Desaulniers
  0 siblings, 1 reply; 4+ messages in thread
From: Yang Li @ 2021-06-08  9:46 UTC (permalink / raw)
  To: rui.zhang
  Cc: daniel.lezcano, amitk, nathan, ndesaulniers, linux-pm,
	linux-kernel, clang-built-linux, Yang Li

Fix function name in devfreq_cooling.c kernel-doc comment
to remove a warning found by clang(make W=1 LLVM=1).

drivers/thermal/devfreq_cooling.c:479: warning: expecting prototype for
devfreq_cooling_em_register_power(). Prototype was for
devfreq_cooling_em_register() instead.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/thermal/devfreq_cooling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
index 3a788ac..5a86cff 100644
--- a/drivers/thermal/devfreq_cooling.c
+++ b/drivers/thermal/devfreq_cooling.c
@@ -458,7 +458,7 @@ struct thermal_cooling_device *devfreq_cooling_register(struct devfreq *df)
 EXPORT_SYMBOL_GPL(devfreq_cooling_register);
 
 /**
- * devfreq_cooling_em_register_power() - Register devfreq cooling device with
+ * devfreq_cooling_em_register() - Register devfreq cooling device with
  *		power information and automatically register Energy Model (EM)
  * @df:		Pointer to devfreq device.
  * @dfc_power:	Pointer to devfreq_cooling_power.
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal: devfreq_cooling: Fix kernel-doc
  2021-06-08  9:46 [PATCH] thermal: devfreq_cooling: Fix kernel-doc Yang Li
@ 2021-06-08 18:39 ` Nick Desaulniers
  2021-06-08 18:49   ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Desaulniers @ 2021-06-08 18:39 UTC (permalink / raw)
  To: Yang Li
  Cc: Zhang Rui, Daniel Lezcano, amitk, Nathan Chancellor, linux-pm,
	LKML, clang-built-linux

On Tue, Jun 8, 2021 at 2:46 AM Yang Li <yang.lee@linux.alibaba.com> wrote:
>
> Fix function name in devfreq_cooling.c kernel-doc comment
> to remove a warning found by clang(make W=1 LLVM=1).
>
> drivers/thermal/devfreq_cooling.c:479: warning: expecting prototype for
> devfreq_cooling_em_register_power(). Prototype was for
> devfreq_cooling_em_register() instead.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>

That compiler warning doesn't come from kernel-doc.  Your diff looks
good (the comment was wrong), but the commit message is curious.

Usually that warning is from when the function prototype does not
exist for a function with extern linkage.  It looks like that's always
provided though in include/linux/devfreq_cooling.h.  Can you share a
link to the original report?

> ---
>  drivers/thermal/devfreq_cooling.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
> index 3a788ac..5a86cff 100644
> --- a/drivers/thermal/devfreq_cooling.c
> +++ b/drivers/thermal/devfreq_cooling.c
> @@ -458,7 +458,7 @@ struct thermal_cooling_device *devfreq_cooling_register(struct devfreq *df)
>  EXPORT_SYMBOL_GPL(devfreq_cooling_register);
>
>  /**
> - * devfreq_cooling_em_register_power() - Register devfreq cooling device with
> + * devfreq_cooling_em_register() - Register devfreq cooling device with
>   *             power information and automatically register Energy Model (EM)
>   * @df:                Pointer to devfreq device.
>   * @dfc_power: Pointer to devfreq_cooling_power.
> --
> 1.8.3.1
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal: devfreq_cooling: Fix kernel-doc
  2021-06-08 18:39 ` Nick Desaulniers
@ 2021-06-08 18:49   ` Nathan Chancellor
  2021-06-08 18:53     ` Nick Desaulniers
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2021-06-08 18:49 UTC (permalink / raw)
  To: Nick Desaulniers, Yang Li
  Cc: Zhang Rui, Daniel Lezcano, amitk, linux-pm, LKML, clang-built-linux

On 6/8/2021 11:39 AM, Nick Desaulniers wrote:
> On Tue, Jun 8, 2021 at 2:46 AM Yang Li <yang.lee@linux.alibaba.com> wrote:
>>
>> Fix function name in devfreq_cooling.c kernel-doc comment
>> to remove a warning found by clang(make W=1 LLVM=1).
>>
>> drivers/thermal/devfreq_cooling.c:479: warning: expecting prototype for
>> devfreq_cooling_em_register_power(). Prototype was for
>> devfreq_cooling_em_register() instead.
>>
>> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
>> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> 
> That compiler warning doesn't come from kernel-doc.  Your diff looks
> good (the comment was wrong), but the commit message is curious.

No, this is indeed kernel-doc complaining. Clang should not even be 
mentioned in the commit message:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/kernel-doc?h=v5.13-rc5#n1228

The warning could probably be improved to say "definition" instead of 
"prototype" in certain cases but *shrugs*.

This warning is similar to -Wmissing-prototypes from clang but refers to 
the fact that the comment claims it is documenting one function but it 
is really documenting another.

Cheers,
Nathan

> Usually that warning is from when the function prototype does not
> exist for a function with extern linkage.  It looks like that's always
> provided though in include/linux/devfreq_cooling.h.  Can you share a
> link to the original report?
> 
>> ---
>>   drivers/thermal/devfreq_cooling.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
>> index 3a788ac..5a86cff 100644
>> --- a/drivers/thermal/devfreq_cooling.c
>> +++ b/drivers/thermal/devfreq_cooling.c
>> @@ -458,7 +458,7 @@ struct thermal_cooling_device *devfreq_cooling_register(struct devfreq *df)
>>   EXPORT_SYMBOL_GPL(devfreq_cooling_register);
>>
>>   /**
>> - * devfreq_cooling_em_register_power() - Register devfreq cooling device with
>> + * devfreq_cooling_em_register() - Register devfreq cooling device with
>>    *             power information and automatically register Energy Model (EM)
>>    * @df:                Pointer to devfreq device.
>>    * @dfc_power: Pointer to devfreq_cooling_power.
>> --
>> 1.8.3.1
>>
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal: devfreq_cooling: Fix kernel-doc
  2021-06-08 18:49   ` Nathan Chancellor
@ 2021-06-08 18:53     ` Nick Desaulniers
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Desaulniers @ 2021-06-08 18:53 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Yang Li, Zhang Rui, Daniel Lezcano, amitk, linux-pm, LKML,
	clang-built-linux

On Tue, Jun 8, 2021 at 11:49 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> On 6/8/2021 11:39 AM, Nick Desaulniers wrote:
> > On Tue, Jun 8, 2021 at 2:46 AM Yang Li <yang.lee@linux.alibaba.com> wrote:
> >>
> >> Fix function name in devfreq_cooling.c kernel-doc comment
> >> to remove a warning found by clang(make W=1 LLVM=1).

Ah, good find. In that case I'd be happy to sign off on a V2 that
replaced s/clang(make W=1 LLVM=1)/kernel-doc/.

> >>
> >> drivers/thermal/devfreq_cooling.c:479: warning: expecting prototype for
> >> devfreq_cooling_em_register_power(). Prototype was for
> >> devfreq_cooling_em_register() instead.
> >>
> >> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> >> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> >
> > That compiler warning doesn't come from kernel-doc.  Your diff looks
> > good (the comment was wrong), but the commit message is curious.
>
> No, this is indeed kernel-doc complaining. Clang should not even be
> mentioned in the commit message:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/kernel-doc?h=v5.13-rc5#n1228
>
> The warning could probably be improved to say "definition" instead of
> "prototype" in certain cases but *shrugs*.
>
> This warning is similar to -Wmissing-prototypes from clang but refers to
> the fact that the comment claims it is documenting one function but it
> is really documenting another.
>
> Cheers,
> Nathan
>
> > Usually that warning is from when the function prototype does not
> > exist for a function with extern linkage.  It looks like that's always
> > provided though in include/linux/devfreq_cooling.h.  Can you share a
> > link to the original report?
> >
> >> ---
> >>   drivers/thermal/devfreq_cooling.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
> >> index 3a788ac..5a86cff 100644
> >> --- a/drivers/thermal/devfreq_cooling.c
> >> +++ b/drivers/thermal/devfreq_cooling.c
> >> @@ -458,7 +458,7 @@ struct thermal_cooling_device *devfreq_cooling_register(struct devfreq *df)
> >>   EXPORT_SYMBOL_GPL(devfreq_cooling_register);
> >>
> >>   /**
> >> - * devfreq_cooling_em_register_power() - Register devfreq cooling device with
> >> + * devfreq_cooling_em_register() - Register devfreq cooling device with
> >>    *             power information and automatically register Energy Model (EM)
> >>    * @df:                Pointer to devfreq device.
> >>    * @dfc_power: Pointer to devfreq_cooling_power.
> >> --
> >> 1.8.3.1
> >>
> >
> >



-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-08 19:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08  9:46 [PATCH] thermal: devfreq_cooling: Fix kernel-doc Yang Li
2021-06-08 18:39 ` Nick Desaulniers
2021-06-08 18:49   ` Nathan Chancellor
2021-06-08 18:53     ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).