mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Takashi Iwai <tiwai@suse.de>
Cc: perex@suse.cz, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [Alsa-devel] [2.6 patch] sound/core/control.c: remove dead code
Date: Tue, 7 Nov 2006 13:38:06 +0100	[thread overview]
Message-ID: <20061107123806.GE8099@stusta.de> (raw)
In-Reply-To: <s5h8xinfsez.wl%tiwai@suse.de>

On Tue, Nov 07, 2006 at 11:43:48AM +0100, Takashi Iwai wrote:
> At Mon, 6 Nov 2006 19:30:18 +0100,
> Adrian Bunk wrote:
> > 
> > This patch removes some obviously dead code spotted by the Coverity 
> > checker.
> > 
> > Signed-off-by: Adrian Bunk <bunk@stusta.de>
> 
> I think it's a wrong fix.  result could be > 0 indeed.
> 
> Takashi
> 
> > 
> > --- linux-2.6/sound/core/control.c.old	2006-11-06 19:11:32.000000000 +0100
> > +++ linux-2.6/sound/core/control.c	2006-11-06 19:11:52.000000000 +0100
> > @@ -1267,23 +1267,23 @@ static ssize_t snd_ctl_read(struct file 
> >  			if ((file->f_flags & O_NONBLOCK) != 0 || result > 0) {

That is already checked here ->                                  ^^^^^^^^^^

And after this point, result is never assigned any value.

> >  				err = -EAGAIN;
> >  				goto __end_lock;
> >  			}
> >  			init_waitqueue_entry(&wait, current);
> >  			add_wait_queue(&ctl->change_sleep, &wait);
> >  			set_current_state(TASK_INTERRUPTIBLE);
> >  			spin_unlock_irq(&ctl->read_lock);
> >  			schedule();
> >  			remove_wait_queue(&ctl->change_sleep, &wait);
> >  			if (signal_pending(current))
> > -				return result > 0 ? result : -ERESTARTSYS;
> > +				return -ERESTARTSYS;
> >  			spin_lock_irq(&ctl->read_lock);
> >  		}
> >  		kev = snd_kctl_event(ctl->events.next);
> >  		ev.type = SNDRV_CTL_EVENT_ELEM;
> >  		ev.data.elem.mask = kev->mask;
> >  		ev.data.elem.id = kev->id;
> >  		list_del(&kev->list);
> >  		spin_unlock_irq(&ctl->read_lock);
> >  		kfree(kev);
> >  		if (copy_to_user(buffer, &ev, sizeof(struct snd_ctl_event))) {
> >  			err = -EFAULT;
> > 

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


  reply	other threads:[~2006-11-07 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-06 18:30 Adrian Bunk
2006-11-07 10:43 ` [Alsa-devel] " Takashi Iwai
2006-11-07 12:38   ` Adrian Bunk [this message]
2006-11-07 12:45     ` Takashi Iwai

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=20061107123806.GE8099@stusta.de \
    --to=bunk@stusta.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    --cc=tiwai@suse.de \
    /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®