Re: [PATCH] sound: Convert timers to use timer_setup()
On Thu, 26 Oct 2017 09:09:17 +0200, Mark Brown wrote: > > On Wed, Oct 25, 2017 at 08:09:27AM -0700, Kees Cook wrote: > > In preparation for unconditionally passing the struct timer_list > > pointer to all timer callbacks, switch to using the new timer_setup() > > and from_timer() to pass the timer pointer explicitly. These are all the > > "mechanical" changes remaining in the sound subsystem. > > Acked-by: Mark BrownOK, applied now. Thanks! Takashi
Re: [PATCH] sound: Convert timers to use timer_setup()
On Thu, 26 Oct 2017 09:09:17 +0200, Mark Brown wrote: > > On Wed, Oct 25, 2017 at 08:09:27AM -0700, Kees Cook wrote: > > In preparation for unconditionally passing the struct timer_list > > pointer to all timer callbacks, switch to using the new timer_setup() > > and from_timer() to pass the timer pointer explicitly. These are all the > > "mechanical" changes remaining in the sound subsystem. > > Acked-by: Mark Brown OK, applied now. Thanks! Takashi
Re: [PATCH] sound: Convert timers to use timer_setup()
On Wed, Oct 25, 2017 at 08:09:27AM -0700, Kees Cook wrote: > In preparation for unconditionally passing the struct timer_list > pointer to all timer callbacks, switch to using the new timer_setup() > and from_timer() to pass the timer pointer explicitly. These are all the > "mechanical" changes remaining in the sound subsystem. Acked-by: Mark Brownsignature.asc Description: PGP signature
Re: [PATCH] sound: Convert timers to use timer_setup()
On Wed, Oct 25, 2017 at 08:09:27AM -0700, Kees Cook wrote: > In preparation for unconditionally passing the struct timer_list > pointer to all timer callbacks, switch to using the new timer_setup() > and from_timer() to pass the timer pointer explicitly. These are all the > "mechanical" changes remaining in the sound subsystem. Acked-by: Mark Brown signature.asc Description: PGP signature
Re: [PATCH] sound: Convert timers to use timer_setup()
On Wed, 25 Oct 2017 17:09:27 +0200, Kees Cook wrote: > > In preparation for unconditionally passing the struct timer_list > pointer to all timer callbacks, switch to using the new timer_setup() > and from_timer() to pass the timer pointer explicitly. These are all the > "mechanical" changes remaining in the sound subsystem. > > Cc: Jaroslav Kysela> Cc: Takashi Iwai > Cc: Bard Liao > Cc: Oder Chiou > Cc: Liam Girdwood > Cc: Mark Brown > Cc: Peter Ujfalusi > Cc: Jarkko Nikula > Cc: Takashi Sakamoto > Cc: alsa-de...@alsa-project.org > Signed-off-by: Kees Cook > --- > sound/i2c/other/ak4117.c | 8 > sound/pci/ctxfi/cttimer.c | 7 +++ > sound/pci/echoaudio/midi.c| 10 +- > sound/pci/korg1212/korg1212.c | 7 +++ > sound/pci/rme9652/hdsp.c | 8 > sound/pci/rme9652/hdspm.c | 8 > sound/soc/codecs/rt5645.c | 7 +++ > sound/soc/omap/ams-delta.c| 4 ++-- This contains a couple of ASoC fixes. Mark, is it OK to take this through my tree directly? It's a trivial change and supposed not to conflict anything else. thanks, Takashi > 8 files changed, 28 insertions(+), 31 deletions(-) > > diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c > index 3ab099fb8c15..b923342cadf4 100644 > --- a/sound/i2c/other/ak4117.c > +++ b/sound/i2c/other/ak4117.c > @@ -35,7 +35,7 @@ MODULE_LICENSE("GPL"); > > #define AK4117_ADDR 0x00 /* fixed address */ > > -static void snd_ak4117_timer(unsigned long data); > +static void snd_ak4117_timer(struct timer_list *t); > > static void reg_write(struct ak4117 *ak4117, unsigned char reg, unsigned > char val) > { > @@ -91,7 +91,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t > *read, ak4117_write_t > chip->read = read; > chip->write = write; > chip->private_data = private_data; > - setup_timer(>timer, snd_ak4117_timer, (unsigned long)chip); > + timer_setup(>timer, snd_ak4117_timer, 0); > > for (reg = 0; reg < 5; reg++) > chip->regmap[reg] = pgm[reg]; > @@ -529,9 +529,9 @@ int snd_ak4117_check_rate_and_errors(struct ak4117 > *ak4117, unsigned int flags) > return res; > } > > -static void snd_ak4117_timer(unsigned long data) > +static void snd_ak4117_timer(struct timer_list *t) > { > - struct ak4117 *chip = (struct ak4117 *)data; > + struct ak4117 *chip = from_timer(chip, t, timer); > > if (chip->init) > return; > diff --git a/sound/pci/ctxfi/cttimer.c b/sound/pci/ctxfi/cttimer.c > index 8f945341720b..08e874e9a7f6 100644 > --- a/sound/pci/ctxfi/cttimer.c > +++ b/sound/pci/ctxfi/cttimer.c > @@ -63,9 +63,9 @@ struct ct_timer { > * system-timer-based updates > */ > > -static void ct_systimer_callback(unsigned long data) > +static void ct_systimer_callback(struct timer_list *t) > { > - struct ct_timer_instance *ti = (struct ct_timer_instance *)data; > + struct ct_timer_instance *ti = from_timer(ti, t, timer); > struct snd_pcm_substream *substream = ti->substream; > struct snd_pcm_runtime *runtime = substream->runtime; > struct ct_atc_pcm *apcm = ti->apcm; > @@ -93,8 +93,7 @@ static void ct_systimer_callback(unsigned long data) > > static void ct_systimer_init(struct ct_timer_instance *ti) > { > - setup_timer(>timer, ct_systimer_callback, > - (unsigned long)ti); > + timer_setup(>timer, ct_systimer_callback, 0); > } > > static void ct_systimer_start(struct ct_timer_instance *ti) > diff --git a/sound/pci/echoaudio/midi.c b/sound/pci/echoaudio/midi.c > index 8c685ddb1a41..6045a115cffe 100644 > --- a/sound/pci/echoaudio/midi.c > +++ b/sound/pci/echoaudio/midi.c > @@ -199,9 +199,9 @@ static int snd_echo_midi_output_open(struct > snd_rawmidi_substream *substream) > > > > -static void snd_echo_midi_output_write(unsigned long data) > +static void snd_echo_midi_output_write(struct timer_list *t) > { > - struct echoaudio *chip = (struct echoaudio *)data; > + struct echoaudio *chip = from_timer(chip, t, timer); > unsigned long flags; > int bytes, sent, time; > unsigned char buf[MIDI_OUT_BUFFER_SIZE - 1]; > @@ -257,8 +257,8 @@ static void snd_echo_midi_output_trigger(struct > snd_rawmidi_substream *substream > spin_lock_irq(>lock); > if (up) { > if (!chip->tinuse) { > - setup_timer(>timer, snd_echo_midi_output_write, > - (unsigned long)chip); > + timer_setup(>timer, snd_echo_midi_output_write, > + 0); > chip->tinuse = 1; > } > } else { > @@ -273,7 +273,7 @@ static void
Re: [PATCH] sound: Convert timers to use timer_setup()
On Wed, 25 Oct 2017 17:09:27 +0200, Kees Cook wrote: > > In preparation for unconditionally passing the struct timer_list > pointer to all timer callbacks, switch to using the new timer_setup() > and from_timer() to pass the timer pointer explicitly. These are all the > "mechanical" changes remaining in the sound subsystem. > > Cc: Jaroslav Kysela > Cc: Takashi Iwai > Cc: Bard Liao > Cc: Oder Chiou > Cc: Liam Girdwood > Cc: Mark Brown > Cc: Peter Ujfalusi > Cc: Jarkko Nikula > Cc: Takashi Sakamoto > Cc: alsa-de...@alsa-project.org > Signed-off-by: Kees Cook > --- > sound/i2c/other/ak4117.c | 8 > sound/pci/ctxfi/cttimer.c | 7 +++ > sound/pci/echoaudio/midi.c| 10 +- > sound/pci/korg1212/korg1212.c | 7 +++ > sound/pci/rme9652/hdsp.c | 8 > sound/pci/rme9652/hdspm.c | 8 > sound/soc/codecs/rt5645.c | 7 +++ > sound/soc/omap/ams-delta.c| 4 ++-- This contains a couple of ASoC fixes. Mark, is it OK to take this through my tree directly? It's a trivial change and supposed not to conflict anything else. thanks, Takashi > 8 files changed, 28 insertions(+), 31 deletions(-) > > diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c > index 3ab099fb8c15..b923342cadf4 100644 > --- a/sound/i2c/other/ak4117.c > +++ b/sound/i2c/other/ak4117.c > @@ -35,7 +35,7 @@ MODULE_LICENSE("GPL"); > > #define AK4117_ADDR 0x00 /* fixed address */ > > -static void snd_ak4117_timer(unsigned long data); > +static void snd_ak4117_timer(struct timer_list *t); > > static void reg_write(struct ak4117 *ak4117, unsigned char reg, unsigned > char val) > { > @@ -91,7 +91,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t > *read, ak4117_write_t > chip->read = read; > chip->write = write; > chip->private_data = private_data; > - setup_timer(>timer, snd_ak4117_timer, (unsigned long)chip); > + timer_setup(>timer, snd_ak4117_timer, 0); > > for (reg = 0; reg < 5; reg++) > chip->regmap[reg] = pgm[reg]; > @@ -529,9 +529,9 @@ int snd_ak4117_check_rate_and_errors(struct ak4117 > *ak4117, unsigned int flags) > return res; > } > > -static void snd_ak4117_timer(unsigned long data) > +static void snd_ak4117_timer(struct timer_list *t) > { > - struct ak4117 *chip = (struct ak4117 *)data; > + struct ak4117 *chip = from_timer(chip, t, timer); > > if (chip->init) > return; > diff --git a/sound/pci/ctxfi/cttimer.c b/sound/pci/ctxfi/cttimer.c > index 8f945341720b..08e874e9a7f6 100644 > --- a/sound/pci/ctxfi/cttimer.c > +++ b/sound/pci/ctxfi/cttimer.c > @@ -63,9 +63,9 @@ struct ct_timer { > * system-timer-based updates > */ > > -static void ct_systimer_callback(unsigned long data) > +static void ct_systimer_callback(struct timer_list *t) > { > - struct ct_timer_instance *ti = (struct ct_timer_instance *)data; > + struct ct_timer_instance *ti = from_timer(ti, t, timer); > struct snd_pcm_substream *substream = ti->substream; > struct snd_pcm_runtime *runtime = substream->runtime; > struct ct_atc_pcm *apcm = ti->apcm; > @@ -93,8 +93,7 @@ static void ct_systimer_callback(unsigned long data) > > static void ct_systimer_init(struct ct_timer_instance *ti) > { > - setup_timer(>timer, ct_systimer_callback, > - (unsigned long)ti); > + timer_setup(>timer, ct_systimer_callback, 0); > } > > static void ct_systimer_start(struct ct_timer_instance *ti) > diff --git a/sound/pci/echoaudio/midi.c b/sound/pci/echoaudio/midi.c > index 8c685ddb1a41..6045a115cffe 100644 > --- a/sound/pci/echoaudio/midi.c > +++ b/sound/pci/echoaudio/midi.c > @@ -199,9 +199,9 @@ static int snd_echo_midi_output_open(struct > snd_rawmidi_substream *substream) > > > > -static void snd_echo_midi_output_write(unsigned long data) > +static void snd_echo_midi_output_write(struct timer_list *t) > { > - struct echoaudio *chip = (struct echoaudio *)data; > + struct echoaudio *chip = from_timer(chip, t, timer); > unsigned long flags; > int bytes, sent, time; > unsigned char buf[MIDI_OUT_BUFFER_SIZE - 1]; > @@ -257,8 +257,8 @@ static void snd_echo_midi_output_trigger(struct > snd_rawmidi_substream *substream > spin_lock_irq(>lock); > if (up) { > if (!chip->tinuse) { > - setup_timer(>timer, snd_echo_midi_output_write, > - (unsigned long)chip); > + timer_setup(>timer, snd_echo_midi_output_write, > + 0); > chip->tinuse = 1; > } > } else { > @@ -273,7 +273,7 @@ static void snd_echo_midi_output_trigger(struct > snd_rawmidi_substream *substream > spin_unlock_irq(>lock); > > if (up && !chip->midi_full) > - snd_echo_midi_output_write((unsigned long)chip); > +
[PATCH] sound: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. These are all the "mechanical" changes remaining in the sound subsystem. Cc: Jaroslav KyselaCc: Takashi Iwai Cc: Bard Liao Cc: Oder Chiou Cc: Liam Girdwood Cc: Mark Brown Cc: Peter Ujfalusi Cc: Jarkko Nikula Cc: Takashi Sakamoto Cc: alsa-de...@alsa-project.org Signed-off-by: Kees Cook --- sound/i2c/other/ak4117.c | 8 sound/pci/ctxfi/cttimer.c | 7 +++ sound/pci/echoaudio/midi.c| 10 +- sound/pci/korg1212/korg1212.c | 7 +++ sound/pci/rme9652/hdsp.c | 8 sound/pci/rme9652/hdspm.c | 8 sound/soc/codecs/rt5645.c | 7 +++ sound/soc/omap/ams-delta.c| 4 ++-- 8 files changed, 28 insertions(+), 31 deletions(-) diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c index 3ab099fb8c15..b923342cadf4 100644 --- a/sound/i2c/other/ak4117.c +++ b/sound/i2c/other/ak4117.c @@ -35,7 +35,7 @@ MODULE_LICENSE("GPL"); #define AK4117_ADDR0x00 /* fixed address */ -static void snd_ak4117_timer(unsigned long data); +static void snd_ak4117_timer(struct timer_list *t); static void reg_write(struct ak4117 *ak4117, unsigned char reg, unsigned char val) { @@ -91,7 +91,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t chip->read = read; chip->write = write; chip->private_data = private_data; - setup_timer(>timer, snd_ak4117_timer, (unsigned long)chip); + timer_setup(>timer, snd_ak4117_timer, 0); for (reg = 0; reg < 5; reg++) chip->regmap[reg] = pgm[reg]; @@ -529,9 +529,9 @@ int snd_ak4117_check_rate_and_errors(struct ak4117 *ak4117, unsigned int flags) return res; } -static void snd_ak4117_timer(unsigned long data) +static void snd_ak4117_timer(struct timer_list *t) { - struct ak4117 *chip = (struct ak4117 *)data; + struct ak4117 *chip = from_timer(chip, t, timer); if (chip->init) return; diff --git a/sound/pci/ctxfi/cttimer.c b/sound/pci/ctxfi/cttimer.c index 8f945341720b..08e874e9a7f6 100644 --- a/sound/pci/ctxfi/cttimer.c +++ b/sound/pci/ctxfi/cttimer.c @@ -63,9 +63,9 @@ struct ct_timer { * system-timer-based updates */ -static void ct_systimer_callback(unsigned long data) +static void ct_systimer_callback(struct timer_list *t) { - struct ct_timer_instance *ti = (struct ct_timer_instance *)data; + struct ct_timer_instance *ti = from_timer(ti, t, timer); struct snd_pcm_substream *substream = ti->substream; struct snd_pcm_runtime *runtime = substream->runtime; struct ct_atc_pcm *apcm = ti->apcm; @@ -93,8 +93,7 @@ static void ct_systimer_callback(unsigned long data) static void ct_systimer_init(struct ct_timer_instance *ti) { - setup_timer(>timer, ct_systimer_callback, - (unsigned long)ti); + timer_setup(>timer, ct_systimer_callback, 0); } static void ct_systimer_start(struct ct_timer_instance *ti) diff --git a/sound/pci/echoaudio/midi.c b/sound/pci/echoaudio/midi.c index 8c685ddb1a41..6045a115cffe 100644 --- a/sound/pci/echoaudio/midi.c +++ b/sound/pci/echoaudio/midi.c @@ -199,9 +199,9 @@ static int snd_echo_midi_output_open(struct snd_rawmidi_substream *substream) -static void snd_echo_midi_output_write(unsigned long data) +static void snd_echo_midi_output_write(struct timer_list *t) { - struct echoaudio *chip = (struct echoaudio *)data; + struct echoaudio *chip = from_timer(chip, t, timer); unsigned long flags; int bytes, sent, time; unsigned char buf[MIDI_OUT_BUFFER_SIZE - 1]; @@ -257,8 +257,8 @@ static void snd_echo_midi_output_trigger(struct snd_rawmidi_substream *substream spin_lock_irq(>lock); if (up) { if (!chip->tinuse) { - setup_timer(>timer, snd_echo_midi_output_write, - (unsigned long)chip); + timer_setup(>timer, snd_echo_midi_output_write, + 0); chip->tinuse = 1; } } else { @@ -273,7 +273,7 @@ static void snd_echo_midi_output_trigger(struct snd_rawmidi_substream *substream spin_unlock_irq(>lock); if (up && !chip->midi_full) - snd_echo_midi_output_write((unsigned long)chip); + snd_echo_midi_output_write(>timer); } diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index 04cd71c74e5c..c7b007164c99 100644 --- a/sound/pci/korg1212/korg1212.c +++
[PATCH] sound: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. These are all the "mechanical" changes remaining in the sound subsystem. Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Bard Liao Cc: Oder Chiou Cc: Liam Girdwood Cc: Mark Brown Cc: Peter Ujfalusi Cc: Jarkko Nikula Cc: Takashi Sakamoto Cc: alsa-de...@alsa-project.org Signed-off-by: Kees Cook --- sound/i2c/other/ak4117.c | 8 sound/pci/ctxfi/cttimer.c | 7 +++ sound/pci/echoaudio/midi.c| 10 +- sound/pci/korg1212/korg1212.c | 7 +++ sound/pci/rme9652/hdsp.c | 8 sound/pci/rme9652/hdspm.c | 8 sound/soc/codecs/rt5645.c | 7 +++ sound/soc/omap/ams-delta.c| 4 ++-- 8 files changed, 28 insertions(+), 31 deletions(-) diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c index 3ab099fb8c15..b923342cadf4 100644 --- a/sound/i2c/other/ak4117.c +++ b/sound/i2c/other/ak4117.c @@ -35,7 +35,7 @@ MODULE_LICENSE("GPL"); #define AK4117_ADDR0x00 /* fixed address */ -static void snd_ak4117_timer(unsigned long data); +static void snd_ak4117_timer(struct timer_list *t); static void reg_write(struct ak4117 *ak4117, unsigned char reg, unsigned char val) { @@ -91,7 +91,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t chip->read = read; chip->write = write; chip->private_data = private_data; - setup_timer(>timer, snd_ak4117_timer, (unsigned long)chip); + timer_setup(>timer, snd_ak4117_timer, 0); for (reg = 0; reg < 5; reg++) chip->regmap[reg] = pgm[reg]; @@ -529,9 +529,9 @@ int snd_ak4117_check_rate_and_errors(struct ak4117 *ak4117, unsigned int flags) return res; } -static void snd_ak4117_timer(unsigned long data) +static void snd_ak4117_timer(struct timer_list *t) { - struct ak4117 *chip = (struct ak4117 *)data; + struct ak4117 *chip = from_timer(chip, t, timer); if (chip->init) return; diff --git a/sound/pci/ctxfi/cttimer.c b/sound/pci/ctxfi/cttimer.c index 8f945341720b..08e874e9a7f6 100644 --- a/sound/pci/ctxfi/cttimer.c +++ b/sound/pci/ctxfi/cttimer.c @@ -63,9 +63,9 @@ struct ct_timer { * system-timer-based updates */ -static void ct_systimer_callback(unsigned long data) +static void ct_systimer_callback(struct timer_list *t) { - struct ct_timer_instance *ti = (struct ct_timer_instance *)data; + struct ct_timer_instance *ti = from_timer(ti, t, timer); struct snd_pcm_substream *substream = ti->substream; struct snd_pcm_runtime *runtime = substream->runtime; struct ct_atc_pcm *apcm = ti->apcm; @@ -93,8 +93,7 @@ static void ct_systimer_callback(unsigned long data) static void ct_systimer_init(struct ct_timer_instance *ti) { - setup_timer(>timer, ct_systimer_callback, - (unsigned long)ti); + timer_setup(>timer, ct_systimer_callback, 0); } static void ct_systimer_start(struct ct_timer_instance *ti) diff --git a/sound/pci/echoaudio/midi.c b/sound/pci/echoaudio/midi.c index 8c685ddb1a41..6045a115cffe 100644 --- a/sound/pci/echoaudio/midi.c +++ b/sound/pci/echoaudio/midi.c @@ -199,9 +199,9 @@ static int snd_echo_midi_output_open(struct snd_rawmidi_substream *substream) -static void snd_echo_midi_output_write(unsigned long data) +static void snd_echo_midi_output_write(struct timer_list *t) { - struct echoaudio *chip = (struct echoaudio *)data; + struct echoaudio *chip = from_timer(chip, t, timer); unsigned long flags; int bytes, sent, time; unsigned char buf[MIDI_OUT_BUFFER_SIZE - 1]; @@ -257,8 +257,8 @@ static void snd_echo_midi_output_trigger(struct snd_rawmidi_substream *substream spin_lock_irq(>lock); if (up) { if (!chip->tinuse) { - setup_timer(>timer, snd_echo_midi_output_write, - (unsigned long)chip); + timer_setup(>timer, snd_echo_midi_output_write, + 0); chip->tinuse = 1; } } else { @@ -273,7 +273,7 @@ static void snd_echo_midi_output_trigger(struct snd_rawmidi_substream *substream spin_unlock_irq(>lock); if (up && !chip->midi_full) - snd_echo_midi_output_write((unsigned long)chip); + snd_echo_midi_output_write(>timer); } diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index 04cd71c74e5c..c7b007164c99 100644 --- a/sound/pci/korg1212/korg1212.c +++ b/sound/pci/korg1212/korg1212.c @@ -599,9 +599,9 @@ static void snd_korg1212_SendStopAndWait(struct snd_korg1212 *korg1212) } /* timer callback for checking the ack of stop request */ -static void