Skip to contentSkip to conversation

comedi: comedi_8254: Remove unused comedi_8254_ns_to_timer

PATCH In review [email protected] 1 participant 3 messages Oct 10, 2024 – Mar 13, 2025 Comedi drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 comedi: comedi_8254: Remove unused comedi_8254_ns_to_timer

From: "Dr. David Alan Gilbert" <[email protected]>

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.

---
 drivers/comedi/drivers/comedi_8254.c | 37 ----------------------------
 include/linux/comedi/comedi_8254.h   |  2 --
 2 files changed, 39 deletions(-)
drivers/comedi/drivers/comedi_8254.c +0 -37
index 6beca2a6d66e..9b7747dab747 100644
@@ -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
include/linux/comedi/comedi_8254.h +0 -2
index d527f04400df..21be0b7250b4 100644
@@ -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);
Signature · 1 line
2.47.0
#1 lore raw
Quoted 9 lines · * [email protected] ([email protected]) wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

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.

Ping.

Thanks,

Dave

Quoted 76 lines
---
 drivers/comedi/drivers/comedi_8254.c | 37 ----------------------------
 include/linux/comedi/comedi_8254.h   |  2 --
 2 files changed, 39 deletions(-)
drivers/comedi/drivers/comedi_8254.c +0 -37
index 6beca2a6d66e..9b7747dab747 100644
@@ -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
include/linux/comedi/comedi_8254.h +0 -2
index d527f04400df..21be0b7250b4 100644
@@ -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);
Signature · 1 line
2.47.0
Signature · 4 lines
 -----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   |_______/
#2 lore raw
Quoted 7 lines · * Dr. David Alan Gilbert ([email protected]) wrote:
Quoted 6 lines · * [email protected] ([email protected]) wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

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

Quoted 5 lines
Quoted 3 lines

Remove it.

Ping.

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

Thanks,

Dave

Quoted 86 lines

Thanks,

Dave

Quoted 76 lines
---
 drivers/comedi/drivers/comedi_8254.c | 37 ----------------------------
 include/linux/comedi/comedi_8254.h   |  2 --
 2 files changed, 39 deletions(-)
drivers/comedi/drivers/comedi_8254.c +0 -37
index 6beca2a6d66e..9b7747dab747 100644
@@ -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
include/linux/comedi/comedi_8254.h +0 -2
index d527f04400df..21be0b7250b4 100644
@@ -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);
Signature · 1 line
2.47.0
Signature · 4 lines
 -----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   |_______/
Signature · 4 lines
 -----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   |_______/