[PATCH] comedi: comedi_8254: Remove unused comedi_8254_ns_to_timer

linux@treblig.org posted 1 patch 1 year, 3 months ago
drivers/comedi/drivers/comedi_8254.c | 37 ----------------------------
include/linux/comedi/comedi_8254.h   |  2 --
2 files changed, 39 deletions(-)
[PATCH] comedi: comedi_8254: Remove unused comedi_8254_ns_to_timer
Posted by linux@treblig.org 1 year, 3 months ago
From: "Dr. David Alan Gilbert" <linux@treblig.org>

comedi_8254_ns_to_timer() has been unused since it was added
in commit
d42b5211d861 ("staging: comedi: comedi_8254: introduce module for 8254 timer support")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/comedi/drivers/comedi_8254.c | 37 ----------------------------
 include/linux/comedi/comedi_8254.h   |  2 --
 2 files changed, 39 deletions(-)

diff --git a/drivers/comedi/drivers/comedi_8254.c b/drivers/comedi/drivers/comedi_8254.c
index 6beca2a6d66e..9b7747dab747 100644
--- a/drivers/comedi/drivers/comedi_8254.c
+++ b/drivers/comedi/drivers/comedi_8254.c
@@ -77,10 +77,6 @@
  * to create a 32-bit rate generator (I8254_MODE2). These functions are
  * provided to handle the cascaded counters:
  *
- * comedi_8254_ns_to_timer()
- *	Calculates the divisor value needed for a single counter to generate
- *	ns timing.
- *
  * comedi_8254_cascade_ns_to_timer()
  *	Calculates the two divisor values needed to the generate the pacer
  *	clock (in ns).
@@ -472,39 +468,6 @@ void comedi_8254_cascade_ns_to_timer(struct comedi_8254 *i8254,
 }
 EXPORT_SYMBOL_GPL(comedi_8254_cascade_ns_to_timer);
 
-/**
- * comedi_8254_ns_to_timer - calculate the divisor value for nanosec timing
- * @i8254:	comedi_8254 struct for the timer
- * @nanosec:	the desired ns time
- * @flags:	comedi_cmd flags
- */
-void comedi_8254_ns_to_timer(struct comedi_8254 *i8254,
-			     unsigned int *nanosec, unsigned int flags)
-{
-	unsigned int divisor;
-
-	switch (flags & CMDF_ROUND_MASK) {
-	default:
-	case CMDF_ROUND_NEAREST:
-		divisor = DIV_ROUND_CLOSEST(*nanosec, i8254->osc_base);
-		break;
-	case CMDF_ROUND_UP:
-		divisor = DIV_ROUND_UP(*nanosec, i8254->osc_base);
-		break;
-	case CMDF_ROUND_DOWN:
-		divisor = *nanosec / i8254->osc_base;
-		break;
-	}
-	if (divisor < 2)
-		divisor = 2;
-	if (divisor > I8254_MAX_COUNT)
-		divisor = I8254_MAX_COUNT;
-
-	*nanosec = divisor * i8254->osc_base;
-	i8254->next_div = divisor;
-}
-EXPORT_SYMBOL_GPL(comedi_8254_ns_to_timer);
-
 /**
  * comedi_8254_set_busy - set/clear the "busy" flag for a given counter
  * @i8254:	comedi_8254 struct for the timer
diff --git a/include/linux/comedi/comedi_8254.h b/include/linux/comedi/comedi_8254.h
index d527f04400df..21be0b7250b4 100644
--- a/include/linux/comedi/comedi_8254.h
+++ b/include/linux/comedi/comedi_8254.h
@@ -129,8 +129,6 @@ void comedi_8254_pacer_enable(struct comedi_8254 *i8254,
 void comedi_8254_update_divisors(struct comedi_8254 *i8254);
 void comedi_8254_cascade_ns_to_timer(struct comedi_8254 *i8254,
 				     unsigned int *nanosec, unsigned int flags);
-void comedi_8254_ns_to_timer(struct comedi_8254 *i8254,
-			     unsigned int *nanosec, unsigned int flags);
 
 void comedi_8254_set_busy(struct comedi_8254 *i8254,
 			  unsigned int counter, bool busy);
-- 
2.47.0
Re: [PATCH] comedi: comedi_8254: Remove unused comedi_8254_ns_to_timer
Posted by Dr. David Alan Gilbert 1 year, 2 months ago
* linux@treblig.org (linux@treblig.org) wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> comedi_8254_ns_to_timer() has been unused since it was added
> in commit
> d42b5211d861 ("staging: comedi: comedi_8254: introduce module for 8254 timer support")
> 
> Remove it.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Ping.

Thanks,

Dave

> ---
>  drivers/comedi/drivers/comedi_8254.c | 37 ----------------------------
>  include/linux/comedi/comedi_8254.h   |  2 --
>  2 files changed, 39 deletions(-)
> 
> diff --git a/drivers/comedi/drivers/comedi_8254.c b/drivers/comedi/drivers/comedi_8254.c
> index 6beca2a6d66e..9b7747dab747 100644
> --- a/drivers/comedi/drivers/comedi_8254.c
> +++ b/drivers/comedi/drivers/comedi_8254.c
> @@ -77,10 +77,6 @@
>   * to create a 32-bit rate generator (I8254_MODE2). These functions are
>   * provided to handle the cascaded counters:
>   *
> - * comedi_8254_ns_to_timer()
> - *	Calculates the divisor value needed for a single counter to generate
> - *	ns timing.
> - *
>   * comedi_8254_cascade_ns_to_timer()
>   *	Calculates the two divisor values needed to the generate the pacer
>   *	clock (in ns).
> @@ -472,39 +468,6 @@ void comedi_8254_cascade_ns_to_timer(struct comedi_8254 *i8254,
>  }
>  EXPORT_SYMBOL_GPL(comedi_8254_cascade_ns_to_timer);
>  
> -/**
> - * comedi_8254_ns_to_timer - calculate the divisor value for nanosec timing
> - * @i8254:	comedi_8254 struct for the timer
> - * @nanosec:	the desired ns time
> - * @flags:	comedi_cmd flags
> - */
> -void comedi_8254_ns_to_timer(struct comedi_8254 *i8254,
> -			     unsigned int *nanosec, unsigned int flags)
> -{
> -	unsigned int divisor;
> -
> -	switch (flags & CMDF_ROUND_MASK) {
> -	default:
> -	case CMDF_ROUND_NEAREST:
> -		divisor = DIV_ROUND_CLOSEST(*nanosec, i8254->osc_base);
> -		break;
> -	case CMDF_ROUND_UP:
> -		divisor = DIV_ROUND_UP(*nanosec, i8254->osc_base);
> -		break;
> -	case CMDF_ROUND_DOWN:
> -		divisor = *nanosec / i8254->osc_base;
> -		break;
> -	}
> -	if (divisor < 2)
> -		divisor = 2;
> -	if (divisor > I8254_MAX_COUNT)
> -		divisor = I8254_MAX_COUNT;
> -
> -	*nanosec = divisor * i8254->osc_base;
> -	i8254->next_div = divisor;
> -}
> -EXPORT_SYMBOL_GPL(comedi_8254_ns_to_timer);
> -
>  /**
>   * comedi_8254_set_busy - set/clear the "busy" flag for a given counter
>   * @i8254:	comedi_8254 struct for the timer
> diff --git a/include/linux/comedi/comedi_8254.h b/include/linux/comedi/comedi_8254.h
> index d527f04400df..21be0b7250b4 100644
> --- a/include/linux/comedi/comedi_8254.h
> +++ b/include/linux/comedi/comedi_8254.h
> @@ -129,8 +129,6 @@ void comedi_8254_pacer_enable(struct comedi_8254 *i8254,
>  void comedi_8254_update_divisors(struct comedi_8254 *i8254);
>  void comedi_8254_cascade_ns_to_timer(struct comedi_8254 *i8254,
>  				     unsigned int *nanosec, unsigned int flags);
> -void comedi_8254_ns_to_timer(struct comedi_8254 *i8254,
> -			     unsigned int *nanosec, unsigned int flags);
>  
>  void comedi_8254_set_busy(struct comedi_8254 *i8254,
>  			  unsigned int counter, bool busy);
> -- 
> 2.47.0
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/
Re: [PATCH] comedi: comedi_8254: Remove unused comedi_8254_ns_to_timer
Posted by Dr. David Alan Gilbert 11 months ago
* Dr. David Alan Gilbert (linux@treblig.org) wrote:
> * linux@treblig.org (linux@treblig.org) wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > 
> > comedi_8254_ns_to_timer() has been unused since it was added
> > in commit
> > d42b5211d861 ("staging: comedi: comedi_8254: introduce module for 8254 timer support")
> > 
> > Remove it.
> > 
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> 
> Ping.

Hi,
  I'd appreciate if someone could pick up and review this old cleanup patch.

Thanks,

Dave

> Thanks,
> 
> Dave
> 
> > ---
> >  drivers/comedi/drivers/comedi_8254.c | 37 ----------------------------
> >  include/linux/comedi/comedi_8254.h   |  2 --
> >  2 files changed, 39 deletions(-)
> > 
> > diff --git a/drivers/comedi/drivers/comedi_8254.c b/drivers/comedi/drivers/comedi_8254.c
> > index 6beca2a6d66e..9b7747dab747 100644
> > --- a/drivers/comedi/drivers/comedi_8254.c
> > +++ b/drivers/comedi/drivers/comedi_8254.c
> > @@ -77,10 +77,6 @@
> >   * to create a 32-bit rate generator (I8254_MODE2). These functions are
> >   * provided to handle the cascaded counters:
> >   *
> > - * comedi_8254_ns_to_timer()
> > - *	Calculates the divisor value needed for a single counter to generate
> > - *	ns timing.
> > - *
> >   * comedi_8254_cascade_ns_to_timer()
> >   *	Calculates the two divisor values needed to the generate the pacer
> >   *	clock (in ns).
> > @@ -472,39 +468,6 @@ void comedi_8254_cascade_ns_to_timer(struct comedi_8254 *i8254,
> >  }
> >  EXPORT_SYMBOL_GPL(comedi_8254_cascade_ns_to_timer);
> >  
> > -/**
> > - * comedi_8254_ns_to_timer - calculate the divisor value for nanosec timing
> > - * @i8254:	comedi_8254 struct for the timer
> > - * @nanosec:	the desired ns time
> > - * @flags:	comedi_cmd flags
> > - */
> > -void comedi_8254_ns_to_timer(struct comedi_8254 *i8254,
> > -			     unsigned int *nanosec, unsigned int flags)
> > -{
> > -	unsigned int divisor;
> > -
> > -	switch (flags & CMDF_ROUND_MASK) {
> > -	default:
> > -	case CMDF_ROUND_NEAREST:
> > -		divisor = DIV_ROUND_CLOSEST(*nanosec, i8254->osc_base);
> > -		break;
> > -	case CMDF_ROUND_UP:
> > -		divisor = DIV_ROUND_UP(*nanosec, i8254->osc_base);
> > -		break;
> > -	case CMDF_ROUND_DOWN:
> > -		divisor = *nanosec / i8254->osc_base;
> > -		break;
> > -	}
> > -	if (divisor < 2)
> > -		divisor = 2;
> > -	if (divisor > I8254_MAX_COUNT)
> > -		divisor = I8254_MAX_COUNT;
> > -
> > -	*nanosec = divisor * i8254->osc_base;
> > -	i8254->next_div = divisor;
> > -}
> > -EXPORT_SYMBOL_GPL(comedi_8254_ns_to_timer);
> > -
> >  /**
> >   * comedi_8254_set_busy - set/clear the "busy" flag for a given counter
> >   * @i8254:	comedi_8254 struct for the timer
> > diff --git a/include/linux/comedi/comedi_8254.h b/include/linux/comedi/comedi_8254.h
> > index d527f04400df..21be0b7250b4 100644
> > --- a/include/linux/comedi/comedi_8254.h
> > +++ b/include/linux/comedi/comedi_8254.h
> > @@ -129,8 +129,6 @@ void comedi_8254_pacer_enable(struct comedi_8254 *i8254,
> >  void comedi_8254_update_divisors(struct comedi_8254 *i8254);
> >  void comedi_8254_cascade_ns_to_timer(struct comedi_8254 *i8254,
> >  				     unsigned int *nanosec, unsigned int flags);
> > -void comedi_8254_ns_to_timer(struct comedi_8254 *i8254,
> > -			     unsigned int *nanosec, unsigned int flags);
> >  
> >  void comedi_8254_set_busy(struct comedi_8254 *i8254,
> >  			  unsigned int counter, bool busy);
> > -- 
> > 2.47.0
> > 
> -- 
>  -----Open up your eyes, open up your mind, open up your code -------   
> / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
> \        dave @ treblig.org |                               | In Hex /
>  \ _________________________|_____ http://www.treblig.org   |_______/
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/