From nobody Tue Feb 10 17:14:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 153924858742525.24676237304209; Thu, 11 Oct 2018 02:03:07 -0700 (PDT) Received: from localhost ([::1]:33044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAWs4-0000Gm-OB for importer@patchew.org; Thu, 11 Oct 2018 05:03:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAWpw-0007kh-7S for qemu-devel@nongnu.org; Thu, 11 Oct 2018 05:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAWpg-0005bB-Md for qemu-devel@nongnu.org; Thu, 11 Oct 2018 05:00:52 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:15207) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAWpd-0005Xn-3T for qemu-devel@nongnu.org; Thu, 11 Oct 2018 05:00:34 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.13]) by rmmx-syy-dmz-app06-12006 (RichMail) with SMTP id 2ee65bbf1129d91-01ec7; Thu, 11 Oct 2018 17:00:26 +0800 (CST) Received: from maozy-host.lan (unknown[112.25.154.149]) by rmsmtp-syy-appsvr07-12007 (RichMail) with SMTP id 2ee75bbf111afd5-16a4c; Thu, 11 Oct 2018 17:00:26 +0800 (CST) X-RM-TRANSID: 2ee65bbf1129d91-01ec7 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee75bbf111afd5-16a4c From: Mao Zhongyi To: qemu-devel@nongnu.org Date: Thu, 11 Oct 2018 17:00:04 +0800 Message-Id: <20181011090007.1103-2-maozhongyi@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181011090007.1103-1-maozhongyi@cmss.chinamobile.com> References: <20181011090007.1103-1-maozhongyi@cmss.chinamobile.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 221.176.66.80 Subject: [Qemu-devel] [PATCH 1/4] wm8750: remove duplicate macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , Mao Zhongyi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The header file wm8750.h contains '#define TYPE_WM8750 "wm8750"' macro, but '#define CODEC "wm8750"' macro is redefined in wm8750.c, just remove the local CODEC macro and replace it with TYPE_WM8750. Cc: Gerd Hoffmann Signed-off-by: Mao Zhongyi --- hw/audio/wm8750.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c index f4aa838f62..4be3602079 100644 --- a/hw/audio/wm8750.c +++ b/hw/audio/wm8750.c @@ -15,8 +15,6 @@ #define IN_PORT_N 3 #define OUT_PORT_N 3 =20 -#define CODEC "wm8750" - typedef struct { int adc; int adc_hz; @@ -204,11 +202,11 @@ static void wm8750_set_format(WM8750State *s) in_fmt.fmt =3D AUD_FMT_S16; =20 s->adc_voice[0] =3D AUD_open_in(&s->card, s->adc_voice[0], - CODEC ".input1", s, wm8750_audio_in_cb, &in_fmt); + TYPE_WM8750 ".input1", s, wm8750_audio_in_cb, &in_fmt); s->adc_voice[1] =3D AUD_open_in(&s->card, s->adc_voice[1], - CODEC ".input2", s, wm8750_audio_in_cb, &in_fmt); + TYPE_WM8750 ".input2", s, wm8750_audio_in_cb, &in_fmt); s->adc_voice[2] =3D AUD_open_in(&s->card, s->adc_voice[2], - CODEC ".input3", s, wm8750_audio_in_cb, &in_fmt); + TYPE_WM8750 ".input3", s, wm8750_audio_in_cb, &in_fmt); =20 /* Setup output */ out_fmt.endianness =3D 0; @@ -217,12 +215,12 @@ static void wm8750_set_format(WM8750State *s) out_fmt.fmt =3D AUD_FMT_S16; =20 s->dac_voice[0] =3D AUD_open_out(&s->card, s->dac_voice[0], - CODEC ".speaker", s, wm8750_audio_out_cb, &out_fmt); + TYPE_WM8750 ".speaker", s, wm8750_audio_out_cb, &out_f= mt); s->dac_voice[1] =3D AUD_open_out(&s->card, s->dac_voice[1], - CODEC ".headphone", s, wm8750_audio_out_cb, &out_fmt); + TYPE_WM8750 ".headphone", s, wm8750_audio_out_cb, &out= _fmt); /* MONOMIX is also in stereo for simplicity */ s->dac_voice[2] =3D AUD_open_out(&s->card, s->dac_voice[2], - CODEC ".monomix", s, wm8750_audio_out_cb, &out_fmt); + TYPE_WM8750 ".monomix", s, wm8750_audio_out_cb, &out_f= mt); /* no sense emulating OUT3 which is a mix of other outputs */ =20 wm8750_vol_update(s); @@ -584,7 +582,7 @@ static int wm8750_post_load(void *opaque, int version_i= d) } =20 static const VMStateDescription vmstate_wm8750 =3D { - .name =3D CODEC, + .name =3D TYPE_WM8750, .version_id =3D 0, .minimum_version_id =3D 0, .pre_save =3D wm8750_pre_save, @@ -621,7 +619,7 @@ static void wm8750_realize(DeviceState *dev, Error **er= rp) { WM8750State *s =3D WM8750(dev); =20 - AUD_register_card(CODEC, &s->card); + AUD_register_card(TYPE_WM8750, &s->card); wm8750_reset(I2C_SLAVE(s)); } =20 --=20 2.17.1