All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]  OSS: fix error return in dma_ioctl()
@ 2009-11-12 16:43 Roel Kluin
  2009-11-12 17:04   ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Roel Kluin @ 2009-11-12 16:43 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, alsa-devel, Andrew Morton, LKML

The returned error should stay negative

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
 sound/oss/audio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/oss/audio.c b/sound/oss/audio.c
index b69c05b..7df48a2 100644
--- a/sound/oss/audio.c
+++ b/sound/oss/audio.c
@@ -838,7 +838,7 @@ static int dma_ioctl(int dev, unsigned int cmd, void __user *arg)
 					if ((err = audio_devs[dev]->d->prepare_for_input(dev,
 						     dmap_in->fragment_size, dmap_in->nbufs)) < 0) {
 						spin_unlock_irqrestore(&dmap_in->lock,flags);
-						return -err;
+						return err;
 					}
 					dmap_in->dma_mode = DMODE_INPUT;
 					audio_devs[dev]->enable_bits |= PCM_ENABLE_INPUT;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH]  OSS: fix error return in dma_ioctl()
  2009-11-12 16:43 [PATCH] OSS: fix error return in dma_ioctl() Roel Kluin
@ 2009-11-12 17:04   ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2009-11-12 17:04 UTC (permalink / raw)
  To: Roel Kluin; +Cc: LKML, alsa-devel, Andrew Morton

At Thu, 12 Nov 2009 17:43:11 +0100,
Roel Kluin wrote:
> 
> The returned error should stay negative
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
>  sound/oss/audio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/oss/audio.c b/sound/oss/audio.c
> index b69c05b..7df48a2 100644
> --- a/sound/oss/audio.c
> +++ b/sound/oss/audio.c
> @@ -838,7 +838,7 @@ static int dma_ioctl(int dev, unsigned int cmd, void __user *arg)
>  					if ((err = audio_devs[dev]->d->prepare_for_input(dev,
>  						     dmap_in->fragment_size, dmap_in->nbufs)) < 0) {
>  						spin_unlock_irqrestore(&dmap_in->lock,flags);
> -						return -err;
> +						return err;

Hmm, looks like a wrong fix to me.
Here, err itself is already negative, so you don't need to flip the
sign.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]  OSS: fix error return in dma_ioctl()
@ 2009-11-12 17:04   ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2009-11-12 17:04 UTC (permalink / raw)
  To: Roel Kluin; +Cc: Jaroslav Kysela, alsa-devel, Andrew Morton, LKML

At Thu, 12 Nov 2009 17:43:11 +0100,
Roel Kluin wrote:
> 
> The returned error should stay negative
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
>  sound/oss/audio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/oss/audio.c b/sound/oss/audio.c
> index b69c05b..7df48a2 100644
> --- a/sound/oss/audio.c
> +++ b/sound/oss/audio.c
> @@ -838,7 +838,7 @@ static int dma_ioctl(int dev, unsigned int cmd, void __user *arg)
>  					if ((err = audio_devs[dev]->d->prepare_for_input(dev,
>  						     dmap_in->fragment_size, dmap_in->nbufs)) < 0) {
>  						spin_unlock_irqrestore(&dmap_in->lock,flags);
> -						return -err;
> +						return err;

Hmm, looks like a wrong fix to me.
Here, err itself is already negative, so you don't need to flip the
sign.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]  OSS: fix error return in dma_ioctl()
  2009-11-12 17:04   ` Takashi Iwai
@ 2009-11-12 20:12     ` Takashi Iwai
  -1 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2009-11-12 20:12 UTC (permalink / raw)
  To: Roel Kluin; +Cc: LKML, alsa-devel, Andrew Morton

At Thu, 12 Nov 2009 18:04:53 +0100,
I wrote:
> 
> At Thu, 12 Nov 2009 17:43:11 +0100,
> Roel Kluin wrote:
> > 
> > The returned error should stay negative
> > 
> > Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> > ---
> >  sound/oss/audio.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/sound/oss/audio.c b/sound/oss/audio.c
> > index b69c05b..7df48a2 100644
> > --- a/sound/oss/audio.c
> > +++ b/sound/oss/audio.c
> > @@ -838,7 +838,7 @@ static int dma_ioctl(int dev, unsigned int cmd, void __user *arg)
> >  					if ((err = audio_devs[dev]->d->prepare_for_input(dev,
> >  						     dmap_in->fragment_size, dmap_in->nbufs)) < 0) {
> >  						spin_unlock_irqrestore(&dmap_in->lock,flags);
> > -						return -err;
> > +						return err;
> 
> Hmm, looks like a wrong fix to me.
> Here, err itself is already negative, so you don't need to flip the
> sign.

My bad, I looked at the patch in a reverse way.
Now applied.  Thanks!


Takashi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]  OSS: fix error return in dma_ioctl()
@ 2009-11-12 20:12     ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2009-11-12 20:12 UTC (permalink / raw)
  To: Roel Kluin; +Cc: Jaroslav Kysela, alsa-devel, Andrew Morton, LKML

At Thu, 12 Nov 2009 18:04:53 +0100,
I wrote:
> 
> At Thu, 12 Nov 2009 17:43:11 +0100,
> Roel Kluin wrote:
> > 
> > The returned error should stay negative
> > 
> > Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> > ---
> >  sound/oss/audio.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/sound/oss/audio.c b/sound/oss/audio.c
> > index b69c05b..7df48a2 100644
> > --- a/sound/oss/audio.c
> > +++ b/sound/oss/audio.c
> > @@ -838,7 +838,7 @@ static int dma_ioctl(int dev, unsigned int cmd, void __user *arg)
> >  					if ((err = audio_devs[dev]->d->prepare_for_input(dev,
> >  						     dmap_in->fragment_size, dmap_in->nbufs)) < 0) {
> >  						spin_unlock_irqrestore(&dmap_in->lock,flags);
> > -						return -err;
> > +						return err;
> 
> Hmm, looks like a wrong fix to me.
> Here, err itself is already negative, so you don't need to flip the
> sign.

My bad, I looked at the patch in a reverse way.
Now applied.  Thanks!


Takashi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-11-12 20:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-12 16:43 [PATCH] OSS: fix error return in dma_ioctl() Roel Kluin
2009-11-12 17:04 ` Takashi Iwai
2009-11-12 17:04   ` Takashi Iwai
2009-11-12 20:12   ` Takashi Iwai
2009-11-12 20:12     ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.