[ALSA] timer: remove list_entry() type casts
Modules: Timer Midlevel
The return value of list_entry() already has the type from the second
argument, so we don't need to typecase it again.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
diff --git a/sound/core/timer.c b/sound/core/timer.c
index c8496c7..488c28a 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -131,7 +131,7 @@
struct list_head *p;
list_for_each(p, &snd_timer_list) {
- timer = (snd_timer_t *)list_entry(p, snd_timer_t, device_list);
+ timer = list_entry(p, snd_timer_t, device_list);
if (timer->tmr_class != tid->dev_class)
continue;
@@ -186,9 +186,9 @@
/* FIXME: it's really dumb to look up all entries.. */
list_for_each(p, &snd_timer_list) {
- timer = (snd_timer_t *)list_entry(p, snd_timer_t, device_list);
+ timer = list_entry(p, snd_timer_t, device_list);
list_for_each(q, &timer->open_list_head) {
- master = (snd_timer_instance_t *)list_entry(q, snd_timer_instance_t, open_list);
+ master = list_entry(q, snd_timer_instance_t, open_list);
if (slave->slave_class == master->slave_class &&
slave->slave_id == master->slave_id) {
list_del(&slave->open_list);
@@ -216,7 +216,7 @@
/* check all pending slaves */
list_for_each_safe(p, n, &snd_timer_slave_list) {
- slave = (snd_timer_instance_t *)list_entry(p, snd_timer_instance_t, open_list);
+ slave = list_entry(p, snd_timer_instance_t, open_list);
if (slave->slave_class == master->slave_class &&
slave->slave_id == master->slave_id) {
list_del(p);
@@ -348,7 +348,7 @@
timer->hw.close(timer);
/* remove slave links */
list_for_each_safe(p, n, &timeri->slave_list_head) {
- slave = (snd_timer_instance_t *)list_entry(p, snd_timer_instance_t, open_list);
+ slave = list_entry(p, snd_timer_instance_t, open_list);
spin_lock_irq(&slave_active_lock);
_snd_timer_stop(slave, 1, SNDRV_TIMER_EVENT_RESOLUTION);
list_del(p);
@@ -406,7 +406,7 @@
return;
spin_lock_irqsave(&timer->lock, flags);
list_for_each(n, &ti->slave_active_head) {
- ts = (snd_timer_instance_t *)list_entry(n, snd_timer_instance_t, active_list);
+ ts = list_entry(n, snd_timer_instance_t, active_list);
if (ts->ccallback)
ts->ccallback(ti, event + 100, &tstamp, resolution);
}
@@ -584,7 +584,7 @@
struct list_head *p;
list_for_each(p, &timer->active_list_head) {
- ti = (snd_timer_instance_t *)list_entry(p, snd_timer_instance_t, active_list);
+ ti = list_entry(p, snd_timer_instance_t, active_list);
if (ti->flags & SNDRV_TIMER_IFLG_START) {
ti->flags &= ~SNDRV_TIMER_IFLG_START;
ti->flags |= SNDRV_TIMER_IFLG_RUNNING;
@@ -621,7 +621,7 @@
/* now process all callbacks */
while (!list_empty(&timer->sack_list_head)) {
p = timer->sack_list_head.next; /* get first item */
- ti = (snd_timer_instance_t *)list_entry(p, snd_timer_instance_t, ack_list);
+ ti = list_entry(p, snd_timer_instance_t, ack_list);
/* remove from ack_list and make empty */
list_del_init(p);
@@ -669,7 +669,7 @@
* instance is relinked to done_list_head before callback is called.
*/
list_for_each_safe(p, n, &timer->active_list_head) {
- ti = (snd_timer_instance_t *)list_entry(p, snd_timer_instance_t, active_list);
+ ti = list_entry(p, snd_timer_instance_t, active_list);
if (!(ti->flags & SNDRV_TIMER_IFLG_RUNNING))
continue;
ti->pticks += ticks_left;
@@ -696,7 +696,7 @@
}
}
list_for_each(q, &ti->slave_active_head) {
- ts = (snd_timer_instance_t *)list_entry(q, snd_timer_instance_t, active_list);
+ ts = list_entry(q, snd_timer_instance_t, active_list);
ts->pticks = ti->pticks;
ts->resolution = resolution;
if (list_empty(&ts->ack_list)) {
@@ -729,7 +729,7 @@
/* now process all fast callbacks */
while (!list_empty(&timer->ack_list_head)) {
p = timer->ack_list_head.next; /* get first item */
- ti = (snd_timer_instance_t *)list_entry(p, snd_timer_instance_t, ack_list);
+ ti = list_entry(p, snd_timer_instance_t, ack_list);
/* remove from ack_list and make empty */
list_del_init(p);
@@ -825,7 +825,7 @@
down(®ister_mutex);
list_for_each(p, &snd_timer_list) {
- timer1 = (snd_timer_t *)list_entry(p, snd_timer_t, device_list);
+ timer1 = list_entry(p, snd_timer_t, device_list);
if (timer1->tmr_class > timer->tmr_class)
break;
if (timer1->tmr_class < timer->tmr_class)
@@ -864,7 +864,7 @@
snd_printk(KERN_WARNING "timer 0x%lx is busy?\n", (long)timer);
list_for_each_safe(p, n, &timer->open_list_head) {
list_del_init(p);
- ti = (snd_timer_instance_t *)list_entry(p, snd_timer_instance_t, open_list);
+ ti = list_entry(p, snd_timer_instance_t, open_list);
ti->timer = NULL;
}
}
@@ -899,11 +899,11 @@
resolution = timer->hw.resolution;
}
list_for_each(p, &timer->active_list_head) {
- ti = (snd_timer_instance_t *)list_entry(p, snd_timer_instance_t, active_list);
+ ti = list_entry(p, snd_timer_instance_t, active_list);
if (ti->ccallback)
ti->ccallback(ti, event, tstamp, resolution);
list_for_each(n, &ti->slave_active_head) {
- ts = (snd_timer_instance_t *)list_entry(n, snd_timer_instance_t, active_list);
+ ts = list_entry(n, snd_timer_instance_t, active_list);
if (ts->ccallback)
ts->ccallback(ts, event, tstamp, resolution);
}
@@ -1052,7 +1052,7 @@
down(®ister_mutex);
list_for_each(p, &snd_timer_list) {
- timer = (snd_timer_t *)list_entry(p, snd_timer_t, device_list);
+ timer = list_entry(p, snd_timer_t, device_list);
switch (timer->tmr_class) {
case SNDRV_TIMER_CLASS_GLOBAL:
snd_iprintf(buffer, "G%i: ", timer->tmr_device);
@@ -1074,7 +1074,7 @@
snd_iprintf(buffer, "\n");
spin_lock_irqsave(&timer->lock, flags);
list_for_each(q, &timer->open_list_head) {
- ti = (snd_timer_instance_t *)list_entry(q, snd_timer_instance_t, open_list);
+ ti = list_entry(q, snd_timer_instance_t, open_list);
snd_iprintf(buffer, " Client %s : %s : lost interrupts %li\n",
ti->owner ? ti->owner : "unknown",
ti->flags & (SNDRV_TIMER_IFLG_START|SNDRV_TIMER_IFLG_RUNNING) ? "running" : "stopped",
@@ -1275,7 +1275,8 @@
if (list_empty(&snd_timer_list))
snd_timer_user_zero_id(&id);
else {
- timer = (snd_timer_t *)list_entry(snd_timer_list.next, snd_timer_t, device_list);
+ timer = list_entry(snd_timer_list.next,
+ snd_timer_t, device_list);
snd_timer_user_copy_id(&id, timer);
}
} else {
@@ -1283,7 +1284,7 @@
case SNDRV_TIMER_CLASS_GLOBAL:
id.device = id.device < 0 ? 0 : id.device + 1;
list_for_each(p, &snd_timer_list) {
- timer = (snd_timer_t *)list_entry(p, snd_timer_t, device_list);
+ timer = list_entry(p, snd_timer_t, device_list);
if (timer->tmr_class > SNDRV_TIMER_CLASS_GLOBAL) {
snd_timer_user_copy_id(&id, timer);
break;
@@ -1312,7 +1313,7 @@
}
}
list_for_each(p, &snd_timer_list) {
- timer = (snd_timer_t *)list_entry(p, snd_timer_t, device_list);
+ timer = list_entry(p, snd_timer_t, device_list);
if (timer->tmr_class > id.dev_class) {
snd_timer_user_copy_id(&id, timer);
break;
@@ -1915,7 +1916,7 @@
snd_unregister_device(SNDRV_DEVICE_TYPE_TIMER, NULL, 0);
/* unregister the system timer */
list_for_each_safe(p, n, &snd_timer_list) {
- snd_timer_t *timer = (snd_timer_t *)list_entry(p, snd_timer_t, device_list);
+ snd_timer_t *timer = list_entry(p, snd_timer_t, device_list);
snd_timer_unregister(timer);
}
if (snd_timer_proc_entry) {