From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsxFC-0007II-3w for qemu-devel@nongnu.org; Fri, 06 Jun 2014 12:43:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsxF7-0006ja-5v for qemu-devel@nongnu.org; Fri, 06 Jun 2014 12:43:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsxF6-0006jS-Tu for qemu-devel@nongnu.org; Fri, 06 Jun 2014 12:43:49 -0400 Message-ID: <5391EFAA.6020602@redhat.com> Date: Fri, 06 Jun 2014 10:43:22 -0600 From: Eric Blake MIME-Version: 1.0 References: <1402072513-7001-1-git-send-email-armbru@redhat.com> In-Reply-To: <1402072513-7001-1-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bRlQuKebl5rxcs9BrToTR4KvEkJBLnPMf" Subject: Re: [Qemu-devel] [PATCH] audio: Drop superfluous conditionals around g_free() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: av1474@comtv.ru, kraxel@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bRlQuKebl5rxcs9BrToTR4KvEkJBLnPMf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/06/2014 10:35 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > audio/alsaaudio.c | 12 ++++-------- > audio/audio_template.h | 15 ++++----------- > audio/ossaudio.c | 6 ++---- > hw/audio/adlib.c | 4 +--- > 4 files changed, 11 insertions(+), 26 deletions(-) >=20 > +++ b/audio/audio_template.h > @@ -71,10 +71,7 @@ static void glue (audio_init_nb_voices_, TYPE) (stru= ct audio_driver *drv) > =20 > static void glue (audio_pcm_hw_free_resources_, TYPE) (HW *hw) > { > - if (HWBUF) { > - g_free (HWBUF); > - } > - > + g_free (HWBUF); While touching this, you may want to drop the space. > @@ -92,9 +89,7 @@ static int glue (audio_pcm_hw_alloc_resources_, TYPE)= (HW *hw) > =20 > static void glue (audio_pcm_sw_free_resources_, TYPE) (SW *sw) > { > - if (sw->buf) { > - g_free (sw->buf); > - } > + g_free (sw->buf); here too. > @@ -172,10 +167,8 @@ static int glue (audio_pcm_sw_init_, TYPE) ( > static void glue (audio_pcm_sw_fini_, TYPE) (SW *sw) > { > glue (audio_pcm_sw_free_resources_, TYPE) (sw); > - if (sw->name) { > - g_free (sw->name); > - sw->name =3D NULL; > - } > + g_free (sw->name); > + sw->name =3D NULL; hmm, it looks like that style is pervasive in this file. > +++ b/audio/ossaudio.c > @@ -736,10 +736,8 @@ static void oss_fini_in (HWVoiceIn *hw) > =20 > oss_anal_close (&oss->fd); > =20 > - if (oss->pcm_buf) { > - g_free (oss->pcm_buf); > - oss->pcm_buf =3D NULL; > - } > + g_free(oss->pcm_buf); > + oss->pcm_buf =3D NULL; Here, you DID trim the space. Be consistent - either preserve the original spacing, or clean it up everywhere. At any rate, whitespace is trivial, so either way: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --bRlQuKebl5rxcs9BrToTR4KvEkJBLnPMf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTke+qAAoJEKeha0olJ0NqZy4H/0L+3L+hlC78yfzJJsrh2f4g KYzIMlLqQPIOQ3f7h+OGZg8uHDe00ZRhYhHtu0/XQNTCOpQGVVbIONtDtMWwu020 66Q5OrCsL1iqn+TJ065iWkzyVX1SBbdEtYhXuLJy9oXhPHJTfnvWED5gRbifIsrz JYP5q6pnJO5eT2p9TPqbqo3PuaDVTe+2iqXRR45/8WUXTtKTKohCXW9wE5+OqtWk 5X7HqbsLQVQBWb8nDqNqHloJ0Sfe/5EsmQI70Q286ALxfdZgj81fHmTVzHLZUhtq TIwBMDku18/oAdjFfwJ+otwgebWdKE4b4Pn25554ceqQhpEN2W8X87gh9W+rb90= =FA6i -----END PGP SIGNATURE----- --bRlQuKebl5rxcs9BrToTR4KvEkJBLnPMf--