Skip to contentSkip to conversation

use setup_timer() helper function.

PATCH New Allen Pais 1 participant 6 messages Sep 22, 2017

Subsystems (2)
lore
Share & tools
lore

Allen Pais

author
#0 lore raw

cover use setup_timer() helper function.

This series uses setup_timer() helper function. The series addresses the files under drivers/block/*.

Allen Pais (5):
block: amiflop: use setup_timer() helper.
block: aoe: use setup_timer() helper.
block: aoe: use setup_timer() helper.
block: umem: use setup_timer() helper.
block: DAC960: use setup_timer() helper.

 drivers/block/DAC960.c      |  5 ++---
 drivers/block/amiflop.c     | 16 ++++------------
 drivers/block/aoe/aoedev.c  |  4 +---
 drivers/block/aoe/aoemain.c |  4 +---
 drivers/block/umem.c        |  3 +--
 5 files changed, 9 insertions(+), 23 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/5 block: amiflop: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/block/amiflop.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/block/amiflop.c +4 -12
index 49908c7..c4b1cba 100644
@@ -1792,27 +1792,19 @@ static int __init amiga_floppy_probe(struct platform_device *pdev)
 				floppy_find, NULL, NULL);
 
 	/* initialize variables */
-	init_timer(&motor_on_timer);
+	setup_timer(&motor_on_timer, motor_on_callback, 0);
 	motor_on_timer.expires = 0;
-	motor_on_timer.data = 0;
-	motor_on_timer.function = motor_on_callback;
 	for (i = 0; i < FD_MAX_UNITS; i++) {
-		init_timer(&motor_off_timer[i]);
+		setup_timer(&motor_off_timer[i], fd_motor_off, i | 0x80000000);
 		motor_off_timer[i].expires = 0;
-		motor_off_timer[i].data = i|0x80000000;
-		motor_off_timer[i].function = fd_motor_off;
-		init_timer(&flush_track_timer[i]);
+		setup_timer(&flush_track_timer[i], flush_track_callback, i);
 		flush_track_timer[i].expires = 0;
-		flush_track_timer[i].data = i;
-		flush_track_timer[i].function = flush_track_callback;
 
 		unit[i].track = -1;
 	}
 
-	init_timer(&post_write_timer);
+	setup_timer(&post_write_timer, post_write, 0);
 	post_write_timer.expires = 0;
-	post_write_timer.data = 0;
-	post_write_timer.function = post_write;
   
 	for (i = 0; i < 128; i++)
 		mfmdecode[i]=255;
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/5 block: aoe: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/block/aoe/aoemain.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/block/aoe/aoemain.c +1 -3
index 4b987c2..20865d4 100644
@@ -28,10 +28,8 @@ discover_timer(ulong vp)
 
 	switch (vp) {
 	case TINIT:
-		init_timer(&t);
+		setup_timer(&t, discover_timer, TRUN);
 		spin_lock_init(&lock);
-		t.data = TRUN;
-		t.function = discover_timer;
 		die = 0;
 	case TRUN:
 		spin_lock_irqsave(&lock, flags);
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH 3/5 block: aoe: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/block/aoe/aoedev.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/block/aoe/aoedev.c +1 -3
index b28fefb..1461cfc 100644
@@ -466,9 +466,7 @@ aoedev_by_aoeaddr(ulong maj, int min, int do_alloc)
 	INIT_WORK(&d->work, aoecmd_sleepwork);
 	spin_lock_init(&d->lock);
 	skb_queue_head_init(&d->skbpool);
-	init_timer(&d->timer);
-	d->timer.data = (ulong) d;
-	d->timer.function = dummy_timer;
+	setup_timer(&d->timer, dummy_timer, (ulong)d);
 	d->timer.expires = jiffies + HZ;
 	add_timer(&d->timer);
 	d->bufpool = NULL;	/* defer to aoeblk_gdalloc */
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH 4/5 block: umem: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/block/umem.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/block/umem.c +1 -2
index 0677d25..b4d4ccf 100644
@@ -738,8 +738,7 @@ static void check_all_batteries(unsigned long ptr)
 
 static void init_battery_timer(void)
 {
-	init_timer(&battery_timer);
-	battery_timer.function = check_all_batteries;
+	setup_timer(&battery_timer, check_all_batteries, 0UL);
 	battery_timer.expires = jiffies + (HZ * 60);
 	add_timer(&battery_timer);
 }
Signature · 1 line
2.7.4
author
#5 lore raw

PATCH 5/5 block: DAC960: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/block/DAC960.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/block/DAC960.c +2 -3
index 255591a..83dc8ca 100644
@@ -3079,11 +3079,10 @@ DAC960_InitializeController(DAC960_Controller_T *Controller)
       /*
 	Initialize the Monitoring Timer.
       */
-      init_timer(&Controller->MonitoringTimer);
+	setup_timer(&Controller->MonitoringTimer,
+		  DAC960_MonitoringTimerFunction, (unsigned long)Controller);
       Controller->MonitoringTimer.expires =
 	jiffies + DAC960_MonitoringTimerInterval;
-      Controller->MonitoringTimer.data = (unsigned long) Controller;
-      Controller->MonitoringTimer.function = DAC960_MonitoringTimerFunction;
       add_timer(&Controller->MonitoringTimer);
       Controller->ControllerInitialized = true;
       return true;
Signature · 1 line
2.7.4