devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: ti-soc-thermal: ti-bandgap.c:  Remove unused function
@ 2014-12-21 17:43 Rickard Strandqvist
  2014-12-24 14:57 ` Nishanth Menon
  0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2014-12-21 17:43 UTC (permalink / raw)
  To: Eduardo Valentin, Zhang Rui
  Cc: Rickard Strandqvist, Grant Likely, Rob Herring, linux-pm,
	linux-kernel, devicetree

Remove the function ti_bandgap_write_thot() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/thermal/ti-soc-thermal/ti-bandgap.c |   13 -------------
 drivers/thermal/ti-soc-thermal/ti-bandgap.h |    1 -
 2 files changed, 14 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 634b6ce..cbb6a5f 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -611,19 +611,6 @@ int ti_bandgap_read_thot(struct ti_bandgap *bgp, int id, int *thot)
 }
 
 /**
- * ti_bandgap_write_thot() - sets sensor current thot
- * @bgp: pointer to bandgap instance
- * @id: sensor id
- * @val: desired thot value
- *
- * Return: 0 on success or the proper error code
- */
-int ti_bandgap_write_thot(struct ti_bandgap *bgp, int id, int val)
-{
-	return _ti_bandgap_write_threshold(bgp, id, val, true);
-}
-
-/**
  * ti_bandgap_read_tcold() - reads sensor current tcold
  * @bgp: pointer to bandgap instance
  * @id: sensor id
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.h b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
index b3adf72..976afc0 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
@@ -371,7 +371,6 @@ struct ti_bandgap_data {
 };
 
 int ti_bandgap_read_thot(struct ti_bandgap *bgp, int id, int *thot);
-int ti_bandgap_write_thot(struct ti_bandgap *bgp, int id, int val);
 int ti_bandgap_read_tcold(struct ti_bandgap *bgp, int id, int *tcold);
 int ti_bandgap_write_tcold(struct ti_bandgap *bgp, int id, int val);
 int ti_bandgap_read_update_interval(struct ti_bandgap *bgp, int id,
-- 
1.7.10.4


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

* Re: [PATCH] thermal: ti-soc-thermal: ti-bandgap.c:  Remove unused function
  2014-12-21 17:43 [PATCH] thermal: ti-soc-thermal: ti-bandgap.c: Remove unused function Rickard Strandqvist
@ 2014-12-24 14:57 ` Nishanth Menon
  2015-01-05 21:33   ` Eduardo Valentin
  0 siblings, 1 reply; 3+ messages in thread
From: Nishanth Menon @ 2014-12-24 14:57 UTC (permalink / raw)
  To: Rickard Strandqvist, Eduardo Valentin, Zhang Rui, Tero Kristo
  Cc: Grant Likely, Rob Herring, linux-pm, linux-kernel, devicetree,
	linux-omap

On 12/21/2014 11:43 AM, Rickard Strandqvist wrote:
> Remove the function ti_bandgap_write_thot() that is not used anywhere.
> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/thermal/ti-soc-thermal/ti-bandgap.c |   13 -------------
>  drivers/thermal/ti-soc-thermal/ti-bandgap.h |    1 -
>  2 files changed, 14 deletions(-)
> 
> diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> index 634b6ce..cbb6a5f 100644
> --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> @@ -611,19 +611,6 @@ int ti_bandgap_read_thot(struct ti_bandgap *bgp, int id, int *thot)
>  }
>  
>  /**
> - * ti_bandgap_write_thot() - sets sensor current thot
> - * @bgp: pointer to bandgap instance
> - * @id: sensor id
> - * @val: desired thot value
> - *
> - * Return: 0 on success or the proper error code
> - */
> -int ti_bandgap_write_thot(struct ti_bandgap *bgp, int id, int val)
> -{
> -	return _ti_bandgap_write_threshold(bgp, id, val, true);
> -}
> -
> -/**
>   * ti_bandgap_read_tcold() - reads sensor current tcold
>   * @bgp: pointer to bandgap instance
>   * @id: sensor id
> diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.h b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
> index b3adf72..976afc0 100644
> --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.h
> +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
> @@ -371,7 +371,6 @@ struct ti_bandgap_data {
>  };
>  
>  int ti_bandgap_read_thot(struct ti_bandgap *bgp, int id, int *thot);
> -int ti_bandgap_write_thot(struct ti_bandgap *bgp, int id, int val);
>  int ti_bandgap_read_tcold(struct ti_bandgap *bgp, int id, int *tcold);
>  int ti_bandgap_write_tcold(struct ti_bandgap *bgp, int id, int val);
>  int ti_bandgap_read_update_interval(struct ti_bandgap *bgp, int id,
> 

Not sure if removing support for programming of hot threshold is a
good idea. how about ti_bandgap_write_tcold then?


-- 
Regards,
Nishanth Menon

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

* Re: [PATCH] thermal: ti-soc-thermal: ti-bandgap.c:  Remove unused function
  2014-12-24 14:57 ` Nishanth Menon
@ 2015-01-05 21:33   ` Eduardo Valentin
  0 siblings, 0 replies; 3+ messages in thread
From: Eduardo Valentin @ 2015-01-05 21:33 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Rickard Strandqvist, Zhang Rui, Tero Kristo, Grant Likely,
	Rob Herring, linux-pm, linux-kernel, devicetree, linux-omap

[-- Attachment #1: Type: text/plain, Size: 2456 bytes --]

On Wed, Dec 24, 2014 at 08:57:14AM -0600, Nishanth Menon wrote:
> On 12/21/2014 11:43 AM, Rickard Strandqvist wrote:
> > Remove the function ti_bandgap_write_thot() that is not used anywhere.
> > 
> > This was partially found by using a static code analysis program called cppcheck.
> > 
> > Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> > ---
> >  drivers/thermal/ti-soc-thermal/ti-bandgap.c |   13 -------------
> >  drivers/thermal/ti-soc-thermal/ti-bandgap.h |    1 -
> >  2 files changed, 14 deletions(-)
> > 
> > diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> > index 634b6ce..cbb6a5f 100644
> > --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> > +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> > @@ -611,19 +611,6 @@ int ti_bandgap_read_thot(struct ti_bandgap *bgp, int id, int *thot)
> >  }
> >  
> >  /**
> > - * ti_bandgap_write_thot() - sets sensor current thot
> > - * @bgp: pointer to bandgap instance
> > - * @id: sensor id
> > - * @val: desired thot value
> > - *
> > - * Return: 0 on success or the proper error code
> > - */
> > -int ti_bandgap_write_thot(struct ti_bandgap *bgp, int id, int val)
> > -{
> > -	return _ti_bandgap_write_threshold(bgp, id, val, true);
> > -}
> > -
> > -/**
> >   * ti_bandgap_read_tcold() - reads sensor current tcold
> >   * @bgp: pointer to bandgap instance
> >   * @id: sensor id
> > diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.h b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
> > index b3adf72..976afc0 100644
> > --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.h
> > +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
> > @@ -371,7 +371,6 @@ struct ti_bandgap_data {
> >  };
> >  
> >  int ti_bandgap_read_thot(struct ti_bandgap *bgp, int id, int *thot);
> > -int ti_bandgap_write_thot(struct ti_bandgap *bgp, int id, int val);
> >  int ti_bandgap_read_tcold(struct ti_bandgap *bgp, int id, int *tcold);
> >  int ti_bandgap_write_tcold(struct ti_bandgap *bgp, int id, int val);
> >  int ti_bandgap_read_update_interval(struct ti_bandgap *bgp, int id,
> > 
> 
> Not sure if removing support for programming of hot threshold is a
> good idea. how about ti_bandgap_write_tcold then?


Agreed here. I believe the right thing to do is to use those functions
to update the thresholds when necessary.

> 
> 
> -- 
> Regards,
> Nishanth Menon

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

end of thread, other threads:[~2015-01-05 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-21 17:43 [PATCH] thermal: ti-soc-thermal: ti-bandgap.c: Remove unused function Rickard Strandqvist
2014-12-24 14:57 ` Nishanth Menon
2015-01-05 21:33   ` Eduardo Valentin

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).