mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jiri Slaby <jslaby@suse.cz>
Cc: linux-kernel@vger.kernel.org, Roman Kollar <rkollar@mail.muni.cz>,
	Jaroslav Kysela <perex@perex.cz>,
	alsa-devel@alsa-project.org
Subject: Re: [PATCH 1/3] sound: dummy, use setup_timer and mod_timer
Date: Mon, 19 Jan 2015 10:53:24 +0100	[thread overview]
Message-ID: <s5htwznqep7.wl-tiwai@suse.de> (raw)
In-Reply-To: <1421660576-8435-1-git-send-email-jslaby@suse.cz>

At Mon, 19 Jan 2015 10:42:54 +0100,
Jiri Slaby wrote:
> 
> From: Roman Kollar <rkollar@mail.muni.cz>
> 
> Use setup_timer and mod_timer instead of structure assignments as it
> is the preferred way to setup and set the timer.
> 
> Signed-off-by: Roman Kollar <rkollar@mail.muni.cz>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.de>
> Cc: alsa-devel@alsa-project.org

Applied this one, thanks.


Takashi

> ---
>  sound/drivers/dummy.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
> index 5d0dfb787cec..d11baaf0f0b4 100644
> --- a/sound/drivers/dummy.c
> +++ b/sound/drivers/dummy.c
> @@ -245,9 +245,8 @@ struct dummy_systimer_pcm {
>  
>  static void dummy_systimer_rearm(struct dummy_systimer_pcm *dpcm)
>  {
> -	dpcm->timer.expires = jiffies +
> -		(dpcm->frac_period_rest + dpcm->rate - 1) / dpcm->rate;
> -	add_timer(&dpcm->timer);
> +	mod_timer(&dpcm->timer, jiffies +
> +		(dpcm->frac_period_rest + dpcm->rate - 1) / dpcm->rate);
>  }
>  
>  static void dummy_systimer_update(struct dummy_systimer_pcm *dpcm)
> @@ -340,9 +339,8 @@ static int dummy_systimer_create(struct snd_pcm_substream *substream)
>  	if (!dpcm)
>  		return -ENOMEM;
>  	substream->runtime->private_data = dpcm;
> -	init_timer(&dpcm->timer);
> -	dpcm->timer.data = (unsigned long) dpcm;
> -	dpcm->timer.function = dummy_systimer_callback;
> +	setup_timer(&dpcm->timer, dummy_systimer_callback,
> +			(unsigned long) dpcm);
>  	spin_lock_init(&dpcm->lock);
>  	dpcm->substream = substream;
>  	return 0;
> -- 
> 2.2.1
> 

      parent reply	other threads:[~2015-01-19  9:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19  9:42 Jiri Slaby
2015-01-19  9:42 ` [PATCH 2/3] sound: dummy, use del_timer_sync Jiri Slaby
2015-01-19  9:52   ` Takashi Iwai
2015-01-19  9:59     ` Jiri Slaby
2015-01-19  9:42 ` [PATCH 3/3] sound: dummy, avoid races with timer Jiri Slaby
2015-01-19  9:49   ` Takashi Iwai
2015-01-19  9:53     ` Jiri Slaby
2015-01-19  9:56     ` [PATCH v2 2/2] sound: dummy, avoid race " Jiri Slaby
2015-01-19  9:59       ` Takashi Iwai
2015-01-19  9:53 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5htwznqep7.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rkollar@mail.muni.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®