[PATCH] USB: typec: tcpci: Make tcpci_pm_ops variable static

Krzysztof Kozlowski posted 1 patch 1 month ago
drivers/usb/typec/tcpm/tcpci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] USB: typec: tcpci: Make tcpci_pm_ops variable static
Posted by Krzysztof Kozlowski 1 month ago
File-scope 'tcpci_pm_ops' is not used outside of this unit, so make it
static to silence sparse warning:

  tcpm/tcpci.c:1002:1: warning: symbol 'tcpci_pm_ops' was not declared. Should it be static?

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
 drivers/usb/typec/tcpm/tcpci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
index 2a951c585e92..8b7e6eb92ca2 100644
--- a/drivers/usb/typec/tcpm/tcpci.c
+++ b/drivers/usb/typec/tcpm/tcpci.c
@@ -999,7 +999,7 @@ static int tcpci_resume(struct device *dev)
 	return ret;
 }
 
-DEFINE_SIMPLE_DEV_PM_OPS(tcpci_pm_ops, tcpci_suspend, tcpci_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(tcpci_pm_ops, tcpci_suspend, tcpci_resume);
 
 static const struct i2c_device_id tcpci_id[] = {
 	{ "tcpci" },
-- 
2.51.0
Re: [PATCH] USB: typec: tcpci: Make tcpci_pm_ops variable static
Posted by Heikki Krogerus 3 weeks, 2 days ago
Mon, Feb 16, 2026 at 12:04:04PM +0100, Krzysztof Kozlowski wrote:
> File-scope 'tcpci_pm_ops' is not used outside of this unit, so make it
> static to silence sparse warning:
> 
>   tcpm/tcpci.c:1002:1: warning: symbol 'tcpci_pm_ops' was not declared. Should it be static?
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tcpm/tcpci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
> index 2a951c585e92..8b7e6eb92ca2 100644
> --- a/drivers/usb/typec/tcpm/tcpci.c
> +++ b/drivers/usb/typec/tcpm/tcpci.c
> @@ -999,7 +999,7 @@ static int tcpci_resume(struct device *dev)
>  	return ret;
>  }
>  
> -DEFINE_SIMPLE_DEV_PM_OPS(tcpci_pm_ops, tcpci_suspend, tcpci_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(tcpci_pm_ops, tcpci_suspend, tcpci_resume);
>  
>  static const struct i2c_device_id tcpci_id[] = {
>  	{ "tcpci" },
> -- 
> 2.51.0

-- 
heikki
Re: [PATCH] USB: typec: tcpci: Make tcpci_pm_ops variable static
Posted by Badhri Jagan Sridharan 4 weeks ago
On Mon, Feb 16, 2026 at 3:04 AM Krzysztof Kozlowski
<krzysztof.kozlowski@oss.qualcomm.com> wrote:
>
> File-scope 'tcpci_pm_ops' is not used outside of this unit, so make it
> static to silence sparse warning:
>
>   tcpm/tcpci.c:1002:1: warning: symbol 'tcpci_pm_ops' was not declared. Should it be static?
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Reviewed-by: Badhri Jagan Sridharan <badhri@google.com>

> ---
>  drivers/usb/typec/tcpm/tcpci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
> index 2a951c585e92..8b7e6eb92ca2 100644
> --- a/drivers/usb/typec/tcpm/tcpci.c
> +++ b/drivers/usb/typec/tcpm/tcpci.c
> @@ -999,7 +999,7 @@ static int tcpci_resume(struct device *dev)
>         return ret;
>  }
>
> -DEFINE_SIMPLE_DEV_PM_OPS(tcpci_pm_ops, tcpci_suspend, tcpci_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(tcpci_pm_ops, tcpci_suspend, tcpci_resume);
>
>  static const struct i2c_device_id tcpci_id[] = {
>         { "tcpci" },
> --
> 2.51.0
>
Re: [PATCH] USB: typec: tcpci: Make tcpci_pm_ops variable static
Posted by Badhri Jagan Sridharan 4 weeks ago
On Mon, Feb 16, 2026 at 3:04 AM Krzysztof Kozlowski
<krzysztof.kozlowski@oss.qualcomm.com> wrote:
>
> File-scope 'tcpci_pm_ops' is not used outside of this unit, so make it
> static to silence sparse warning:
>
>   tcpm/tcpci.c:1002:1: warning: symbol 'tcpci_pm_ops' was not declared. Should it be static?
>

Thanks for sending the patch Krzysztof !
Can you also please add "Fixes:" and "Cc: stable@vger.kernel.org" ?

Thanks,
Badhri

> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
>  drivers/usb/typec/tcpm/tcpci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
> index 2a951c585e92..8b7e6eb92ca2 100644
> --- a/drivers/usb/typec/tcpm/tcpci.c
> +++ b/drivers/usb/typec/tcpm/tcpci.c
> @@ -999,7 +999,7 @@ static int tcpci_resume(struct device *dev)
>         return ret;
>  }
>
> -DEFINE_SIMPLE_DEV_PM_OPS(tcpci_pm_ops, tcpci_suspend, tcpci_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(tcpci_pm_ops, tcpci_suspend, tcpci_resume);
>
>  static const struct i2c_device_id tcpci_id[] = {
>         { "tcpci" },
> --
> 2.51.0
>
Re: [PATCH] USB: typec: tcpci: Make tcpci_pm_ops variable static
Posted by Krzysztof Kozlowski 4 weeks ago
On 18/02/2026 21:35, Badhri Jagan Sridharan wrote:
> On Mon, Feb 16, 2026 at 3:04 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@oss.qualcomm.com> wrote:
>>
>> File-scope 'tcpci_pm_ops' is not used outside of this unit, so make it
>> static to silence sparse warning:
>>
>>   tcpm/tcpci.c:1002:1: warning: symbol 'tcpci_pm_ops' was not declared. Should it be static?
>>
> 
> Thanks for sending the patch Krzysztof !
> Can you also please add "Fixes:" and "Cc: stable@vger.kernel.org" ?

This has no practical impact on users, so I don't think it is a fix. It
is a code improvement, but not a fix.


Best regards,
Krzysztof
Re: [PATCH] USB: typec: tcpci: Make tcpci_pm_ops variable static
Posted by Greg Kroah-Hartman 4 weeks ago
On Wed, Feb 18, 2026 at 12:35:04PM -0800, Badhri Jagan Sridharan wrote:
> On Mon, Feb 16, 2026 at 3:04 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@oss.qualcomm.com> wrote:
> >
> > File-scope 'tcpci_pm_ops' is not used outside of this unit, so make it
> > static to silence sparse warning:
> >
> >   tcpm/tcpci.c:1002:1: warning: symbol 'tcpci_pm_ops' was not declared. Should it be static?
> >
> 
> Thanks for sending the patch Krzysztof !
> Can you also please add "Fixes:" and "Cc: stable@vger.kernel.org" ?

Why would a sparse warning fix need either of those?  Are you wanting to
just pre-load my "WTF" email bot to go off?  :)

thanks,

greg k-h
Re: [PATCH] USB: typec: tcpci: Make tcpci_pm_ops variable static
Posted by Badhri Jagan Sridharan 4 weeks ago
On Wed, Feb 18, 2026 at 12:56 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Wed, Feb 18, 2026 at 12:35:04PM -0800, Badhri Jagan Sridharan wrote:
> > On Mon, Feb 16, 2026 at 3:04 AM Krzysztof Kozlowski
> > <krzysztof.kozlowski@oss.qualcomm.com> wrote:
> > >
> > > File-scope 'tcpci_pm_ops' is not used outside of this unit, so make it
> > > static to silence sparse warning:
> > >
> > >   tcpm/tcpci.c:1002:1: warning: symbol 'tcpci_pm_ops' was not declared. Should it be static?
> > >
> >
> > Thanks for sending the patch Krzysztof !
> > Can you also please add "Fixes:" and "Cc: stable@vger.kernel.org" ?
>
> Why would a sparse warning fix need either of those?  Are you wanting to
> just pre-load my "WTF" email bot to go off?  :)

I am still learning :) Wasn't aware that warning fixes are not
supposed to have those.


>
> thanks,
>
> greg k-h
Re: [PATCH] USB: typec: tcpci: Make tcpci_pm_ops variable static
Posted by Greg Kroah-Hartman 4 weeks ago
On Wed, Feb 18, 2026 at 01:02:50PM -0800, Badhri Jagan Sridharan wrote:
> On Wed, Feb 18, 2026 at 12:56 PM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Wed, Feb 18, 2026 at 12:35:04PM -0800, Badhri Jagan Sridharan wrote:
> > > On Mon, Feb 16, 2026 at 3:04 AM Krzysztof Kozlowski
> > > <krzysztof.kozlowski@oss.qualcomm.com> wrote:
> > > >
> > > > File-scope 'tcpci_pm_ops' is not used outside of this unit, so make it
> > > > static to silence sparse warning:
> > > >
> > > >   tcpm/tcpci.c:1002:1: warning: symbol 'tcpci_pm_ops' was not declared. Should it be static?
> > > >
> > >
> > > Thanks for sending the patch Krzysztof !
> > > Can you also please add "Fixes:" and "Cc: stable@vger.kernel.org" ?
> >
> > Why would a sparse warning fix need either of those?  Are you wanting to
> > just pre-load my "WTF" email bot to go off?  :)
> 
> I am still learning :) Wasn't aware that warning fixes are not
> supposed to have those.

This is a warning from sparse, not the build.  sparse is an add-on
thing, not a part of a normal kernel build.

thanks,

greg k-h
Re: [PATCH] USB: typec: tcpci: Make tcpci_pm_ops variable static
Posted by Badhri Jagan Sridharan 4 weeks ago
On Wed, Feb 18, 2026 at 1:19 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Wed, Feb 18, 2026 at 01:02:50PM -0800, Badhri Jagan Sridharan wrote:
> > On Wed, Feb 18, 2026 at 12:56 PM Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Wed, Feb 18, 2026 at 12:35:04PM -0800, Badhri Jagan Sridharan wrote:
> > > > On Mon, Feb 16, 2026 at 3:04 AM Krzysztof Kozlowski
> > > > <krzysztof.kozlowski@oss.qualcomm.com> wrote:
> > > > >
> > > > > File-scope 'tcpci_pm_ops' is not used outside of this unit, so make it
> > > > > static to silence sparse warning:
> > > > >
> > > > >   tcpm/tcpci.c:1002:1: warning: symbol 'tcpci_pm_ops' was not declared. Should it be static?
> > > > >
> > > >
> > > > Thanks for sending the patch Krzysztof !
> > > > Can you also please add "Fixes:" and "Cc: stable@vger.kernel.org" ?
> > >
> > > Why would a sparse warning fix need either of those?  Are you wanting to
> > > just pre-load my "WTF" email bot to go off?  :)
> >
> > I am still learning :) Wasn't aware that warning fixes are not
> > supposed to have those.
>
> This is a warning from sparse, not the build.  sparse is an add-on
> thing, not a part of a normal kernel build.

Thanks Greg for the additional context. I will keep this in mind in the future!

>
> thanks,
>
> greg k-h