From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGstZ-0000az-C5 for qemu-devel@nongnu.org; Wed, 17 Jun 2009 07:01:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGstU-0000YM-Qt for qemu-devel@nongnu.org; Wed, 17 Jun 2009 07:01:32 -0400 Received: from [199.232.76.173] (port=37299 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGstU-0000YH-IV for qemu-devel@nongnu.org; Wed, 17 Jun 2009 07:01:28 -0400 Received: from mail-ew0-f220.google.com ([209.85.219.220]:43757) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGstT-0004bi-UE for qemu-devel@nongnu.org; Wed, 17 Jun 2009 07:01:28 -0400 Received: by ewy20 with SMTP id 20so278233ewy.34 for ; Wed, 17 Jun 2009 04:01:26 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <5b31733c0906170400n63a2b45ekc14ebb7db05dbf65@mail.gmail.com> References: <1245235662-20071-1-git-send-email-kraxel@redhat.com> <5b31733c0906170400n63a2b45ekc14ebb7db05dbf65@mail.gmail.com> Date: Wed, 17 Jun 2009 13:01:26 +0200 Message-ID: <5b31733c0906170401o2ea04c46oe6f6e68d90945104@mail.gmail.com> Subject: Re: [Qemu-devel] [PATCH] alsa: fix warning From: Filip Navara Content-Type: multipart/alternative; boundary=0016364d2c996ba4bc046c893653 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel --0016364d2c996ba4bc046c893653 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Wed, Jun 17, 2009 at 12:47 PM, Gerd Hoffmann wrote: > > Signed-off-by: Gerd Hoffmann > --- > audio/alsaaudio.c | 6 ++---- > 1 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c > index 2f6c764..f0752bc 100644 > --- a/audio/alsaaudio.c > +++ b/audio/alsaaudio.c > @@ -626,8 +626,7 @@ static int alsa_init_out (HWVoiceOut *hw, struct > audsettings *as) > req.period_size = conf.period_size_out; > req.buffer_size = conf.buffer_size_out; > req.size_in_usec = conf.size_in_usec_out; > - req.override_mask = !!conf.period_size_out_overridden > - | (!!conf.buffer_size_out_overridden << 1); > + req.override_mask = conf.period_size_out_overridden ? 0x03 : 0x00; I'm all for fixing warnings, but this changes the functionality, buffer_size_out_overridden != period_size_out_overridden. I don't think that was the intent, otherwise please state so in the patch description. > > > if (alsa_open (0, &req, &obt, &handle)) { > return -1; > @@ -706,8 +705,7 @@ static int alsa_init_in (HWVoiceIn *hw, struct > audsettings *as) > req.period_size = conf.period_size_in; > req.buffer_size = conf.buffer_size_in; > req.size_in_usec = conf.size_in_usec_in; > - req.override_mask = !!conf.period_size_in_overridden > - | (!!conf.buffer_size_in_overridden << 1); > + req.override_mask = conf.period_size_in_overridden ? 0x03 : 0x00; Same here. F. --0016364d2c996ba4bc046c893653 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On = Wed, Jun 17, 2009 at 12:47 PM, Gerd Hoffmann <kraxel@redhat.com> wrote:

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
=A0audio/alsaaudio.c | =A0 =A06 ++----
=A01 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index 2f6c764..f0752bc 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -626,8 +626,7 @@ static int alsa_init_out (HWVoiceOut *hw, struct audset= tings *as)
=A0 =A0 req.period_size =3D conf.period_size_out;
=A0 =A0 req.buffer_size =3D conf.buffer_size_out;
=A0 =A0 req.size_in_usec =3D conf.size_in_usec_out;
- =A0 =A0req.override_mask =3D !!conf.period_size_out_overridden
- =A0 =A0 =A0 =A0| (!!conf.buffer_size_out_overridden << 1);
+ =A0 =A0req.override_mask =3D conf.period_size_out_overridden ? 0x03 : 0x0= 0;

I'm all for fixing warnings, b= ut this changes the functionality,=A0buffer_size_out_overridden !=3D=A0peri= od_size_out_overridden. I don't think that was the intent, otherwise pl= ease state so in the patch description.
=A0


=A0 =A0 if (alsa_open (0, &req, &obt, &handle)) {
=A0 =A0 =A0 =A0 return -1;
@@ -706,8 +705,7 @@ static int alsa_init_in (HWVoiceIn *hw, struct audsetti= ngs *as)
=A0 =A0 req.period_size =3D conf.period_size_in;
=A0 =A0 req.buffer_size =3D conf.buffer_size_in;
=A0 =A0 req.size_in_usec =3D conf.size_in_usec_in;
- =A0 =A0req.override_mask =3D !!conf.period_size_in_overridden
- =A0 =A0 =A0 =A0| (!!conf.buffer_size_in_overridden << 1);
+ =A0 =A0req.override_mask =3D conf.period_size_in_overridden ? 0x03 : 0x00= ;

Same here.

F.

--0016364d2c996ba4bc046c893653--