Skip to contentSkip to conversation

ALSA: line6: use msecs_to_jiffies for conversion

PATCH Applied Nicholas Mc Guire 2 participants 2 messages Feb 3, 2015 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ALSA: line6: use msecs_to_jiffies for conversion

This is only an API consolidation and should make things more readable it replaces var * HZ / 1000 by msecs_to_jiffies(var).

---

Converting milliseconds to jiffies by val * HZ / 1000 is technically not wrong but msecs_to_jiffies(val) is the cleaner solution and handles all corner cases correctly. This is a minor API cleanup only.

Patch was only compile tested for x86_64_defconfig + CONFIG_SOUND=y, CONFIG_SND_USB_POD=m (implies CONFIG_SND_USB_LINE6=y)

Patch is against 3.0.19-rc6 (localversion = -next-20150202)

 sound/usb/line6/driver.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/line6/driver.c +1 -1
index 2328ec9..3cf12cc 100644
@@ -166,7 +166,7 @@ void line6_start_timer(struct timer_list *timer, unsigned int msecs,
 		       void (*function)(unsigned long), unsigned long data)
 {
 	setup_timer(timer, function, data);
-	mod_timer(timer, jiffies + msecs * HZ / 1000);
+	mod_timer(timer, jiffies + msecs_to_jiffies(msecs));
 }
 EXPORT_SYMBOL_GPL(line6_start_timer);
 
Signature · 1 line
1.7.10.4
Applied
#1 lore raw

At Tue, 3 Feb 2015 02:38:39 -0500,

Quoted 8 lines · Nicholas Mc Guire

This is only an API consolidation and should make things more readable it replaces var * HZ / 1000 by msecs_to_jiffies(var).

---

Quoted 8 lines

Converting milliseconds to jiffies by val * HZ / 1000 is technically not wrong but msecs_to_jiffies(val) is the cleaner solution and handles all corner cases correctly. This is a minor API cleanup only.

Patch was only compile tested for x86_64_defconfig + CONFIG_SOUND=y, CONFIG_SND_USB_POD=m (implies CONFIG_SND_USB_LINE6=y)

Patch is against 3.0.19-rc6 (localversion = -next-20150202)

Applied, thanks.

Takashi

Quoted 20 lines
 sound/usb/line6/driver.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/line6/driver.c +1 -1
index 2328ec9..3cf12cc 100644
@@ -166,7 +166,7 @@ void line6_start_timer(struct timer_list *timer, unsigned int msecs,
 		       void (*function)(unsigned long), unsigned long data)
 {
 	setup_timer(timer, function, data);
-	mod_timer(timer, jiffies + msecs * HZ / 1000);
+	mod_timer(timer, jiffies + msecs_to_jiffies(msecs));
 }
 EXPORT_SYMBOL_GPL(line6_start_timer);
 
Signature · 1 line
1.7.10.4