All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: netlink: Fix parameter type of thermal_genl_cpu_capability_event() stub
@ 2022-02-07 16:38 Nathan Chancellor
  2022-02-07 16:54 ` srinivas pandruvada
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2022-02-07 16:38 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano
  Cc: Amit Kucheria, Zhang Rui, Srinivas Pandruvada, linux-pm,
	linux-kernel, Nathan Chancellor, Stephen Rothwell

When building with CONFIG_THERMAL_NETLINK=n, there is a spew of warnings
along the lines of:

  In file included from drivers/thermal/thermal_core.c:27:
  In file included from drivers/thermal/thermal_core.h:15:
  drivers/thermal/thermal_netlink.h:113:71: warning: declaration of 'struct cpu_capability' will not be visible outside of this function [-Wvisibility]
  static inline int thermal_genl_cpu_capability_event(int count, struct cpu_capability *caps)
                                                                        ^
  1 warning generated.

'struct cpu_capability' is not forward declared anywhere in the header.
As it turns out, this should really be 'struct thermal_genl_cpu_caps',
which silences the warning and makes the parameter types of the stub
match the full function.

Fixes: e4b1eb24ce5a ("thermal: netlink: Add a new event to notify CPU capabilities change")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/thermal/thermal_netlink.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_netlink.h b/drivers/thermal/thermal_netlink.h
index 04d1adbbc012..1052f523188d 100644
--- a/drivers/thermal/thermal_netlink.h
+++ b/drivers/thermal/thermal_netlink.h
@@ -110,7 +110,7 @@ static inline int thermal_genl_sampling_temp(int id, int temp)
 	return 0;
 }
 
-static inline int thermal_genl_cpu_capability_event(int count, struct cpu_capability *caps)
+static inline int thermal_genl_cpu_capability_event(int count, struct thermal_genl_cpu_caps *caps)
 {
 	return 0;
 }

base-commit: 08615cb8c0e1deeca5489d672213fb205fa53c3b
-- 
2.35.1


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

* Re: [PATCH] thermal: netlink: Fix parameter type of thermal_genl_cpu_capability_event() stub
  2022-02-07 16:38 [PATCH] thermal: netlink: Fix parameter type of thermal_genl_cpu_capability_event() stub Nathan Chancellor
@ 2022-02-07 16:54 ` srinivas pandruvada
  2022-02-07 16:58   ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: srinivas pandruvada @ 2022-02-07 16:54 UTC (permalink / raw)
  To: Nathan Chancellor, Rafael J. Wysocki, Daniel Lezcano
  Cc: Amit Kucheria, Zhang Rui, linux-pm, linux-kernel, Stephen Rothwell

On Mon, 2022-02-07 at 09:38 -0700, Nathan Chancellor wrote:
> When building with CONFIG_THERMAL_NETLINK=n, there is a spew of
> warnings
> along the lines of:
> 
>   In file included from drivers/thermal/thermal_core.c:27:
>   In file included from drivers/thermal/thermal_core.h:15:
>   drivers/thermal/thermal_netlink.h:113:71: warning: declaration of
> 'struct cpu_capability' will not be visible outside of this function
> [-Wvisibility]
>   static inline int thermal_genl_cpu_capability_event(int count,
> struct cpu_capability *caps)
>                                                                      
>    ^
>   1 warning generated.
> 
> 'struct cpu_capability' is not forward declared anywhere in the
> header.
> As it turns out, this should really be 'struct
> thermal_genl_cpu_caps',
> which silences the warning and makes the parameter types of the stub
> match the full function.
Thanks for sending the patch. I was about to send this change.
Since this patch target only linux-next, don't we need prefix:
"[PATCH -next]" instead of "[PATCH]"?

> 
> Fixes: e4b1eb24ce5a ("thermal: netlink: Add a new event to notify CPU
> capabilities change")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  drivers/thermal/thermal_netlink.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/thermal_netlink.h
> b/drivers/thermal/thermal_netlink.h
> index 04d1adbbc012..1052f523188d 100644
> --- a/drivers/thermal/thermal_netlink.h
> +++ b/drivers/thermal/thermal_netlink.h
> @@ -110,7 +110,7 @@ static inline int thermal_genl_sampling_temp(int
> id, int temp)
>         return 0;
>  }
>  
> -static inline int thermal_genl_cpu_capability_event(int count,
> struct cpu_capability *caps)
> +static inline int thermal_genl_cpu_capability_event(int count,
> struct thermal_genl_cpu_caps *caps)
>  {
>         return 0;
>  }
> 
> base-commit: 08615cb8c0e1deeca5489d672213fb205fa53c3b


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

* Re: [PATCH] thermal: netlink: Fix parameter type of thermal_genl_cpu_capability_event() stub
  2022-02-07 16:54 ` srinivas pandruvada
@ 2022-02-07 16:58   ` Nathan Chancellor
  2022-02-07 19:47     ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2022-02-07 16:58 UTC (permalink / raw)
  To: srinivas pandruvada
  Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	linux-pm, linux-kernel, Stephen Rothwell

On Mon, Feb 07, 2022 at 08:54:41AM -0800, srinivas pandruvada wrote:
> On Mon, 2022-02-07 at 09:38 -0700, Nathan Chancellor wrote:
> > When building with CONFIG_THERMAL_NETLINK=n, there is a spew of
> > warnings
> > along the lines of:
> > 
> >   In file included from drivers/thermal/thermal_core.c:27:
> >   In file included from drivers/thermal/thermal_core.h:15:
> >   drivers/thermal/thermal_netlink.h:113:71: warning: declaration of
> > 'struct cpu_capability' will not be visible outside of this function
> > [-Wvisibility]
> >   static inline int thermal_genl_cpu_capability_event(int count,
> > struct cpu_capability *caps)
> >                                                                      
> >    ^
> >   1 warning generated.
> > 
> > 'struct cpu_capability' is not forward declared anywhere in the
> > header.
> > As it turns out, this should really be 'struct
> > thermal_genl_cpu_caps',
> > which silences the warning and makes the parameter types of the stub
> > match the full function.
> Thanks for sending the patch. I was about to send this change.
> Since this patch target only linux-next, don't we need prefix:
> "[PATCH -next]" instead of "[PATCH]"?

I could probably get better about adding "-next" to the subject prefix
to make it easier for maintainers but I do include the commit that the
patch was based on at the bottom of the patch to accomplish the same
thing.

Thank you for the review!

Cheers,
Nathan

> > 
> > Fixes: e4b1eb24ce5a ("thermal: netlink: Add a new event to notify CPU
> > capabilities change")
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> 
> > ---
> >  drivers/thermal/thermal_netlink.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/thermal/thermal_netlink.h
> > b/drivers/thermal/thermal_netlink.h
> > index 04d1adbbc012..1052f523188d 100644
> > --- a/drivers/thermal/thermal_netlink.h
> > +++ b/drivers/thermal/thermal_netlink.h
> > @@ -110,7 +110,7 @@ static inline int thermal_genl_sampling_temp(int
> > id, int temp)
> >         return 0;
> >  }
> >  
> > -static inline int thermal_genl_cpu_capability_event(int count,
> > struct cpu_capability *caps)
> > +static inline int thermal_genl_cpu_capability_event(int count,
> > struct thermal_genl_cpu_caps *caps)
> >  {
> >         return 0;
> >  }
> > 
> > base-commit: 08615cb8c0e1deeca5489d672213fb205fa53c3b
> 

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

* Re: [PATCH] thermal: netlink: Fix parameter type of thermal_genl_cpu_capability_event() stub
  2022-02-07 16:58   ` Nathan Chancellor
@ 2022-02-07 19:47     ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2022-02-07 19:47 UTC (permalink / raw)
  To: Nathan Chancellor, srinivas pandruvada
  Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Linux PM, Linux Kernel Mailing List, Stephen Rothwell

On Mon, Feb 7, 2022 at 5:58 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> On Mon, Feb 07, 2022 at 08:54:41AM -0800, srinivas pandruvada wrote:
> > On Mon, 2022-02-07 at 09:38 -0700, Nathan Chancellor wrote:
> > > When building with CONFIG_THERMAL_NETLINK=n, there is a spew of
> > > warnings
> > > along the lines of:
> > >
> > >   In file included from drivers/thermal/thermal_core.c:27:
> > >   In file included from drivers/thermal/thermal_core.h:15:
> > >   drivers/thermal/thermal_netlink.h:113:71: warning: declaration of
> > > 'struct cpu_capability' will not be visible outside of this function
> > > [-Wvisibility]
> > >   static inline int thermal_genl_cpu_capability_event(int count,
> > > struct cpu_capability *caps)
> > >
> > >    ^
> > >   1 warning generated.
> > >
> > > 'struct cpu_capability' is not forward declared anywhere in the
> > > header.
> > > As it turns out, this should really be 'struct
> > > thermal_genl_cpu_caps',
> > > which silences the warning and makes the parameter types of the stub
> > > match the full function.
> > Thanks for sending the patch. I was about to send this change.
> > Since this patch target only linux-next, don't we need prefix:
> > "[PATCH -next]" instead of "[PATCH]"?
>
> I could probably get better about adding "-next" to the subject prefix
> to make it easier for maintainers but I do include the commit that the
> patch was based on at the bottom of the patch to accomplish the same
> thing.
>
> Thank you for the review!

Patch applied, thanks!

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

end of thread, other threads:[~2022-02-07 19:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 16:38 [PATCH] thermal: netlink: Fix parameter type of thermal_genl_cpu_capability_event() stub Nathan Chancellor
2022-02-07 16:54 ` srinivas pandruvada
2022-02-07 16:58   ` Nathan Chancellor
2022-02-07 19:47     ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.