public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jaroslav Kysela <perex@perex.cz>,
	alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] sound: sys_timer: indent poll_def_tmr() correctly
Date: Wed, 25 Feb 2015 19:09:19 +0000	[thread overview]
Message-ID: <s5hzj813j1c.wl-tiwai@suse.de> (raw)
In-Reply-To: <20150225132709.GN19745@mwanda>

At Wed, 25 Feb 2015 16:27:10 +0300,
Dan Carpenter wrote:
> 
> The indenting here was really whacky and not consistent from one line to
> the next.  I also reverse the "if (opened)" and "if (tmr_running)" tests
> so that I could remove two indent levels.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks.


Takashi

> 
> diff --git a/sound/oss/sys_timer.c b/sound/oss/sys_timer.c
> index 9f03983..2226dda 100644
> --- a/sound/oss/sys_timer.c
> +++ b/sound/oss/sys_timer.c
> @@ -50,29 +50,24 @@ tmr2ticks(int tmr_value)
>  static void
>  poll_def_tmr(unsigned long dummy)
>  {
> +	if (!opened)
> +		return;
> +	def_tmr.expires = (1) + jiffies;
> +	add_timer(&def_tmr);
>  
> -	if (opened)
> -	  {
> +	if (!tmr_running)
> +		return;
>  
> -		  {
> -			  def_tmr.expires = (1) + jiffies;
> -			  add_timer(&def_tmr);
> -		  }
> +	spin_lock(&lock);
> +	tmr_ctr++;
> +	curr_ticks = ticks_offs + tmr2ticks(tmr_ctr);
>  
> -		  if (tmr_running)
> -		    {
> -				spin_lock(&lock);
> -			    tmr_ctr++;
> -			    curr_ticks = ticks_offs + tmr2ticks(tmr_ctr);
> -
> -			    if (curr_ticks >= next_event_time)
> -			      {
> -				      next_event_time = (unsigned long) -1;
> -				      sequencer_timer(0);
> -			      }
> -				spin_unlock(&lock);
> -		    }
> -	  }
> +	if (curr_ticks >= next_event_time) {
> +		next_event_time = (unsigned long) -1;
> +		sequencer_timer(0);
> +	}
> +
> +	spin_unlock(&lock);
>  }
>  
>  static void
> 

      reply	other threads:[~2015-02-25 19:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 13:27 [patch] sound: sys_timer: indent poll_def_tmr() correctly Dan Carpenter
2015-02-25 19:09 ` 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=s5hzj813j1c.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=perex@perex.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