From nobody Thu May 2 02:25:15 2024 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516620565326645.193692269165; Mon, 22 Jan 2018 03:29:25 -0800 (PST) Received: from localhost ([::1]:36365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaHv-0003xC-5o for importer@patchew.org; Mon, 22 Jan 2018 06:29:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaFu-0002ke-UL for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edaFr-0007ER-BQ for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55014) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edaFr-0007E2-2i for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:11 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2771C4E90E; Mon, 22 Jan 2018 11:27:10 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14D6384F2; Mon, 22 Jan 2018 11:27:08 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Date: Mon, 22 Jan 2018 12:26:58 +0100 Message-Id: <1516620426-18530-2-git-send-email-thuth@redhat.com> In-Reply-To: <1516620426-18530-1-git-send-email-thuth@redhat.com> References: <1516620426-18530-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 22 Jan 2018 11:27:10 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/9] tests: Rename pc-cpu-test.c to cpu-plug-test.c 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: Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The test will be extended to work on other architectures, too, so let's use a more generic name for the file and the functions in here first. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: David Hildenbrand Signed-off-by: Thomas Huth --- tests/Makefile.include | 4 ++-- tests/{pc-cpu-test.c =3D> cpu-plug-test.c} | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) rename tests/{pc-cpu-test.c =3D> cpu-plug-test.c} (87%) diff --git a/tests/Makefile.include b/tests/Makefile.include index 8883274..669f7f6 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -278,7 +278,7 @@ gcov-files-i386-y +=3D hw/usb/dev-hid.c gcov-files-i386-y +=3D hw/usb/dev-storage.c check-qtest-i386-y +=3D tests/usb-hcd-xhci-test$(EXESUF) gcov-files-i386-y +=3D hw/usb/hcd-xhci.c -check-qtest-i386-y +=3D tests/pc-cpu-test$(EXESUF) +check-qtest-i386-y +=3D tests/cpu-plug-test$(EXESUF) check-qtest-i386-y +=3D tests/q35-test$(EXESUF) check-qtest-i386-y +=3D tests/vmgenid-test$(EXESUF) gcov-files-i386-y +=3D hw/pci-host/q35.c @@ -795,7 +795,7 @@ tests/usb-hcd-ohci-test$(EXESUF): tests/usb-hcd-ohci-te= st.o $(libqos-usb-obj-y) tests/usb-hcd-uhci-test$(EXESUF): tests/usb-hcd-uhci-test.o $(libqos-usb-o= bj-y) tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(libqos-usb-o= bj-y) tests/usb-hcd-xhci-test$(EXESUF): tests/usb-hcd-xhci-test.o $(libqos-usb-o= bj-y) -tests/pc-cpu-test$(EXESUF): tests/pc-cpu-test.o +tests/cpu-plug-test$(EXESUF): tests/cpu-plug-test.o tests/migration-test$(EXESUF): tests/migration-test.o tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o $(test-util-obj-y)= \ $(qtest-obj-y) $(test-io-obj-y) $(libqos-virtio-obj-y) $(libqos-pc-obj-y)= \ diff --git a/tests/pc-cpu-test.c b/tests/cpu-plug-test.c similarity index 87% rename from tests/pc-cpu-test.c rename to tests/cpu-plug-test.c index 11d3e81..4579119 100644 --- a/tests/pc-cpu-test.c +++ b/tests/cpu-plug-test.c @@ -1,5 +1,5 @@ /* - * QTest testcase for PC CPUs + * QTest testcase for CPU plugging * * Copyright (c) 2015 SUSE Linux GmbH * @@ -13,7 +13,7 @@ #include "libqtest.h" #include "qapi/qmp/types.h" =20 -struct PCTestData { +struct PlugTestData { char *machine; const char *cpu_model; unsigned sockets; @@ -21,11 +21,11 @@ struct PCTestData { unsigned threads; unsigned maxcpus; }; -typedef struct PCTestData PCTestData; +typedef struct PlugTestData PlugTestData; =20 -static void test_pc_with_cpu_add(gconstpointer data) +static void test_plug_with_cpu_add(gconstpointer data) { - const PCTestData *s =3D data; + const PlugTestData *s =3D data; char *args; QDict *response; unsigned int i; @@ -48,9 +48,9 @@ static void test_pc_with_cpu_add(gconstpointer data) g_free(args); } =20 -static void test_pc_without_cpu_add(gconstpointer data) +static void test_plug_without_cpu_add(gconstpointer data) { - const PCTestData *s =3D data; + const PlugTestData *s =3D data; char *args; QDict *response; =20 @@ -73,7 +73,7 @@ static void test_pc_without_cpu_add(gconstpointer data) =20 static void test_data_free(gpointer data) { - PCTestData *pc =3D data; + PlugTestData *pc =3D data; =20 g_free(pc->machine); g_free(pc); @@ -82,12 +82,12 @@ static void test_data_free(gpointer data) static void add_pc_test_case(const char *mname) { char *path; - PCTestData *data; + PlugTestData *data; =20 if (!g_str_has_prefix(mname, "pc-")) { return; } - data =3D g_new(PCTestData, 1); + data =3D g_new(PlugTestData, 1); data->machine =3D g_strdup(mname); data->cpu_model =3D "Haswell"; /* 1.3+ theoretically */ data->sockets =3D 1; @@ -108,14 +108,14 @@ static void add_pc_test_case(const char *mname) path =3D g_strdup_printf("cpu/%s/init/%ux%ux%u&maxcpus=3D%u", mname, data->sockets, data->cores, data->threads, data->maxcpus); - qtest_add_data_func_full(path, data, test_pc_without_cpu_add, + qtest_add_data_func_full(path, data, test_plug_without_cpu_add, test_data_free); g_free(path); } else { path =3D g_strdup_printf("cpu/%s/add/%ux%ux%u&maxcpus=3D%u", mname, data->sockets, data->cores, data->threads, data->maxcpus); - qtest_add_data_func_full(path, data, test_pc_with_cpu_add, + qtest_add_data_func_full(path, data, test_plug_with_cpu_add, test_data_free); g_free(path); } --=20 1.8.3.1 From nobody Thu May 2 02:25:15 2024 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516620567146852.2474567509554; Mon, 22 Jan 2018 03:29:27 -0800 (PST) Received: from localhost ([::1]:36364 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaHt-0003wp-3p for importer@patchew.org; Mon, 22 Jan 2018 06:29:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaFu-0002kd-U2 for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edaFs-0007F7-Lk for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33528) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edaFs-0007Eb-Cg for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:12 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D8FD25C2F; Mon, 22 Jan 2018 11:27:11 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FC8C7901B; Mon, 22 Jan 2018 11:27:10 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Date: Mon, 22 Jan 2018 12:26:59 +0100 Message-Id: <1516620426-18530-3-git-send-email-thuth@redhat.com> In-Reply-To: <1516620426-18530-1-git-send-email-thuth@redhat.com> References: <1516620426-18530-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 22 Jan 2018 11:27:11 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/9] tests/cpu-plug-test: Check the CPU hot-plugging with device_add, too 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: Alistair Francis 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" Using 'device_add' instead of 'cpu-add' is the new way for hot-plugging CPUs, so we should test this regularly, too. Reviewed-by: David Hildenbrand Reviewed-by: Daniel Henrique Barboza Tested-by: Daniel Henrique Barboza Signed-off-by: Thomas Huth --- tests/cpu-plug-test.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/tests/cpu-plug-test.c b/tests/cpu-plug-test.c index 4579119..1e622cb 100644 --- a/tests/cpu-plug-test.c +++ b/tests/cpu-plug-test.c @@ -16,6 +16,7 @@ struct PlugTestData { char *machine; const char *cpu_model; + char *device_model; unsigned sockets; unsigned cores; unsigned threads; @@ -71,11 +72,40 @@ static void test_plug_without_cpu_add(gconstpointer dat= a) g_free(args); } =20 +static void test_plug_with_device_add_x86(gconstpointer data) +{ + const PlugTestData *td =3D data; + char *args; + unsigned int s, c, t; + + args =3D g_strdup_printf("-machine %s -cpu %s " + "-smp sockets=3D%u,cores=3D%u,threads=3D%u,maxc= pus=3D%u", + td->machine, td->cpu_model, + td->sockets, td->cores, td->threads, td->maxcpu= s); + qtest_start(args); + + for (s =3D td->sockets; s < td->maxcpus / td->cores / td->threads; s++= ) { + for (c =3D 0; c < td->cores; c++) { + for (t =3D 0; t < td->threads; t++) { + char *id =3D g_strdup_printf("id-%i-%i-%i", s, c, t); + qtest_qmp_device_add(td->device_model, id, "'socket-id':'%= i', " + "'core-id':'%i', 'thread-id':'%i'", + s, c, t); + g_free(id); + } + } + } + + qtest_end(); + g_free(args); +} + static void test_data_free(gpointer data) { PlugTestData *pc =3D data; =20 g_free(pc->machine); + g_free(pc->device_model); g_free(pc); } =20 @@ -90,6 +120,8 @@ static void add_pc_test_case(const char *mname) data =3D g_new(PlugTestData, 1); data->machine =3D g_strdup(mname); data->cpu_model =3D "Haswell"; /* 1.3+ theoretically */ + data->device_model =3D g_strdup_printf("%s-%s-cpu", data->cpu_model, + qtest_get_arch()); data->sockets =3D 1; data->cores =3D 3; data->threads =3D 2; @@ -105,19 +137,30 @@ static void add_pc_test_case(const char *mname) (strcmp(mname, "pc-0.12") =3D=3D 0) || (strcmp(mname, "pc-0.11") =3D=3D 0) || (strcmp(mname, "pc-0.10") =3D=3D 0)) { - path =3D g_strdup_printf("cpu/%s/init/%ux%ux%u&maxcpus=3D%u", + path =3D g_strdup_printf("cpu-plug/%s/init/%ux%ux%u&maxcpus=3D%u", mname, data->sockets, data->cores, data->threads, data->maxcpus); qtest_add_data_func_full(path, data, test_plug_without_cpu_add, test_data_free); g_free(path); } else { - path =3D g_strdup_printf("cpu/%s/add/%ux%ux%u&maxcpus=3D%u", + PlugTestData *data2 =3D g_memdup(data, sizeof(PlugTestData)); + + data2->machine =3D g_strdup(data->machine); + data2->device_model =3D g_strdup(data->device_model); + + path =3D g_strdup_printf("cpu-plug/%s/cpu-add/%ux%ux%u&maxcpus=3D%= u", mname, data->sockets, data->cores, data->threads, data->maxcpus); qtest_add_data_func_full(path, data, test_plug_with_cpu_add, test_data_free); g_free(path); + path =3D g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus= =3D%u", + mname, data2->sockets, data2->cores, + data2->threads, data2->maxcpus); + qtest_add_data_func_full(path, data2, test_plug_with_device_add_x8= 6, + test_data_free); + g_free(path); } } =20 --=20 1.8.3.1 From nobody Thu May 2 02:25:15 2024 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516620567142986.8497980852426; Mon, 22 Jan 2018 03:29:27 -0800 (PST) Received: from localhost ([::1]:36366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaHv-0003yP-3P for importer@patchew.org; Mon, 22 Jan 2018 06:29:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaFu-0002kf-VB for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edaFu-0007Ft-2r for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:18292) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edaFt-0007FL-Pw for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:13 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03B2481F0C; Mon, 22 Jan 2018 11:27:13 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA0157901B; Mon, 22 Jan 2018 11:27:11 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Date: Mon, 22 Jan 2018 12:27:00 +0100 Message-Id: <1516620426-18530-4-git-send-email-thuth@redhat.com> In-Reply-To: <1516620426-18530-1-git-send-email-thuth@redhat.com> References: <1516620426-18530-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 22 Jan 2018 11:27:13 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/9] tests/cpu-plug-test: Check CPU hot-plugging on ppc64, too 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: Alistair Francis 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" Hot plugging on ppc64 is possible via "device_add", too. Unlike x86, we must not specify a 'socket-id' and 'thread-id' here, so this needs to be done with a separate function that just specifies the 'core-id' during the "device_add". Reviewed-by: Daniel Barboza Tested-by: Daniel Barboza Signed-off-by: Thomas Huth --- tests/Makefile.include | 1 + tests/cpu-plug-test.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 51 insertions(+) diff --git a/tests/Makefile.include b/tests/Makefile.include index 669f7f6..092ad5f 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -340,6 +340,7 @@ check-qtest-ppc64-$(CONFIG_POSIX) +=3D tests/test-filte= r-redirector$(EXESUF) check-qtest-ppc64-y +=3D tests/display-vga-test$(EXESUF) check-qtest-ppc64-y +=3D tests/numa-test$(EXESUF) check-qtest-ppc64-$(CONFIG_IVSHMEM) +=3D tests/ivshmem-test$(EXESUF) +check-qtest-ppc64-y +=3D tests/cpu-plug-test$(EXESUF) =20 check-qtest-sh4-y =3D tests/endianness-test$(EXESUF) =20 diff --git a/tests/cpu-plug-test.c b/tests/cpu-plug-test.c index 1e622cb..a306340 100644 --- a/tests/cpu-plug-test.c +++ b/tests/cpu-plug-test.c @@ -100,6 +100,28 @@ static void test_plug_with_device_add_x86(gconstpointe= r data) g_free(args); } =20 +static void test_plug_with_device_add_coreid(gconstpointer data) +{ + const PlugTestData *td =3D data; + char *args; + unsigned int c; + + args =3D g_strdup_printf("-machine %s -cpu %s " + "-smp 1,sockets=3D%u,cores=3D%u,threads=3D%u,ma= xcpus=3D%u", + td->machine, td->cpu_model, + td->sockets, td->cores, td->threads, td->maxcpu= s); + qtest_start(args); + + for (c =3D td->cores; c < td->maxcpus / td->sockets / td->threads; c++= ) { + char *id =3D g_strdup_printf("id-%i", c); + qtest_qmp_device_add(td->device_model, id, "'core-id':'%i'", c); + g_free(id); + } + + qtest_end(); + g_free(args); +} + static void test_data_free(gpointer data) { PlugTestData *pc =3D data; @@ -164,6 +186,32 @@ static void add_pc_test_case(const char *mname) } } =20 +static void add_pseries_test_case(const char *mname) +{ + char *path; + PlugTestData *data; + + if (!g_str_has_prefix(mname, "pseries-") || + (g_str_has_prefix(mname, "pseries-2.") && atoi(&mname[10]) < 7)) { + return; + } + data =3D g_new(PlugTestData, 1); + data->machine =3D g_strdup(mname); + data->cpu_model =3D "power8_v2.0"; + data->device_model =3D g_strdup("power8_v2.0-spapr-cpu-core"); + data->sockets =3D 2; + data->cores =3D 3; + data->threads =3D 1; + data->maxcpus =3D data->sockets * data->cores * data->threads * 2; + + path =3D g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=3D%u= ", + mname, data->sockets, data->cores, + data->threads, data->maxcpus); + qtest_add_data_func_full(path, data, test_plug_with_device_add_coreid, + test_data_free); + g_free(path); +} + int main(int argc, char **argv) { const char *arch =3D qtest_get_arch(); @@ -172,6 +220,8 @@ int main(int argc, char **argv) =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { qtest_cb_for_every_machine(add_pc_test_case); + } else if (g_str_equal(arch, "ppc64")) { + qtest_cb_for_every_machine(add_pseries_test_case); } =20 return g_test_run(); --=20 1.8.3.1 From nobody Thu May 2 02:25:15 2024 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 151662073829273.63527179829987; Mon, 22 Jan 2018 03:32:18 -0800 (PST) Received: from localhost ([::1]:36388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaKn-0006RE-D0 for importer@patchew.org; Mon, 22 Jan 2018 06:32:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaFw-0002lB-Mf for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edaFv-0007Gq-Lj for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35646) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edaFv-0007GG-D0 for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:15 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E6FCC057EC3; Mon, 22 Jan 2018 11:27:14 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 603DB619EA; Mon, 22 Jan 2018 11:27:13 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Date: Mon, 22 Jan 2018 12:27:01 +0100 Message-Id: <1516620426-18530-5-git-send-email-thuth@redhat.com> In-Reply-To: <1516620426-18530-1-git-send-email-thuth@redhat.com> References: <1516620426-18530-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 22 Jan 2018 11:27:14 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/9] tests/cpu-plug-test: Test CPU hot-plugging on s390x 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: Alistair Francis 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" CPU hot-plugging on s390x is possible with both, "cpu-add" and "device_add", so test both. Reviewed-by: David Hildenbrand Signed-off-by: Thomas Huth --- tests/Makefile.include | 1 + tests/cpu-plug-test.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/tests/Makefile.include b/tests/Makefile.include index 092ad5f..851aafe 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -380,6 +380,7 @@ check-qtest-s390x-y +=3D tests/drive_del-test$(EXESUF) check-qtest-s390x-y +=3D tests/virtio-balloon-test$(EXESUF) check-qtest-s390x-y +=3D tests/virtio-console-test$(EXESUF) check-qtest-s390x-y +=3D tests/virtio-serial-test$(EXESUF) +check-qtest-s390x-y +=3D tests/cpu-plug-test$(EXESUF) =20 check-qtest-generic-y +=3D tests/qom-test$(EXESUF) check-qtest-generic-y +=3D tests/test-hmp$(EXESUF) diff --git a/tests/cpu-plug-test.c b/tests/cpu-plug-test.c index a306340..05d82f7 100644 --- a/tests/cpu-plug-test.c +++ b/tests/cpu-plug-test.c @@ -212,6 +212,43 @@ static void add_pseries_test_case(const char *mname) g_free(path); } =20 +static void add_s390x_test_case(const char *mname) +{ + char *path; + PlugTestData *data, *data2; + + if (!g_str_has_prefix(mname, "s390-ccw-virtio-")) { + return; + } + + data =3D g_new(PlugTestData, 1); + data->machine =3D g_strdup(mname); + data->cpu_model =3D "qemu"; + data->device_model =3D g_strdup("qemu-s390x-cpu"); + data->sockets =3D 1; + data->cores =3D 3; + data->threads =3D 1; + data->maxcpus =3D data->sockets * data->cores * data->threads * 2; + + data2 =3D g_memdup(data, sizeof(PlugTestData)); + data2->machine =3D g_strdup(data->machine); + data2->device_model =3D g_strdup(data->device_model); + + path =3D g_strdup_printf("cpu-plug/%s/cpu-add/%ux%ux%u&maxcpus=3D%u", + mname, data->sockets, data->cores, + data->threads, data->maxcpus); + qtest_add_data_func_full(path, data, test_plug_with_cpu_add, + test_data_free); + g_free(path); + + path =3D g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=3D%u= ", + mname, data2->sockets, data2->cores, + data2->threads, data2->maxcpus); + qtest_add_data_func_full(path, data2, test_plug_with_device_add_coreid, + test_data_free); + g_free(path); +} + int main(int argc, char **argv) { const char *arch =3D qtest_get_arch(); @@ -222,6 +259,8 @@ int main(int argc, char **argv) qtest_cb_for_every_machine(add_pc_test_case); } else if (g_str_equal(arch, "ppc64")) { qtest_cb_for_every_machine(add_pseries_test_case); + } else if (g_str_equal(arch, "s390x")) { + qtest_cb_for_every_machine(add_s390x_test_case); } =20 return g_test_run(); --=20 1.8.3.1 From nobody Thu May 2 02:25:15 2024 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 1516620765741490.60854302709026; Mon, 22 Jan 2018 03:32:45 -0800 (PST) Received: from localhost ([::1]:36389 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaLE-0006ky-Ql for importer@patchew.org; Mon, 22 Jan 2018 06:32:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaG7-0002vA-6Y for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edaFy-0007I6-2M for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35700) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edaFx-0007HY-BT for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:17 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84729C058ED8; Mon, 22 Jan 2018 11:27:16 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id E247B619EA; Mon, 22 Jan 2018 11:27:14 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Date: Mon, 22 Jan 2018 12:27:02 +0100 Message-Id: <1516620426-18530-6-git-send-email-thuth@redhat.com> In-Reply-To: <1516620426-18530-1-git-send-email-thuth@redhat.com> References: <1516620426-18530-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 22 Jan 2018 11:27:16 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/9] Replace all occurances of __FUNCTION__ with __func__ 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: Alistair Francis 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" From: Alistair Francis Replace all occurs of __FUNCTION__ except for the check in checkpatch with the non GCC specific __func__. One line in hcd-musb.c was manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Reviewed-by: Anthony PERARD Reviewed-by: Juan Quintela Reviewed-by: Gerd Hoffmann [THH: Removed hunks related to pxa2xx_mmci.c (fixed already)] Signed-off-by: Thomas Huth --- hw/arm/nseries.c | 2 +- hw/arm/omap1.c | 42 +++++++++++++++++++++--------------------- hw/arm/omap2.c | 12 ++++++------ hw/arm/palm.c | 14 +++++++------- hw/arm/pxa2xx.c | 46 +++++++++++++++++++++++-------------------= ---- hw/arm/pxa2xx_gpio.c | 6 +++--- hw/arm/pxa2xx_pic.c | 4 ++-- hw/arm/tosa.c | 10 +++++----- hw/audio/hda-codec.c | 10 +++++----- hw/audio/intel-hda.c | 28 ++++++++++++++-------------- hw/audio/wm8750.c | 4 ++-- hw/block/nand.c | 4 ++-- hw/block/onenand.c | 8 ++++---- hw/bt/core.c | 10 +++++----- hw/bt/hci-csr.c | 14 +++++++------- hw/bt/hci.c | 26 +++++++++++++------------- hw/bt/hid.c | 2 +- hw/bt/l2cap.c | 22 +++++++++++----------- hw/bt/sdp.c | 6 +++--- hw/display/blizzard.c | 18 +++++++++--------- hw/display/omap_dss.c | 6 +++--- hw/display/pxa2xx_lcd.c | 14 +++++++------- hw/display/qxl-render.c | 6 +++--- hw/display/qxl.h | 2 +- hw/display/tc6393xb.c | 2 +- hw/display/xenfb.c | 2 +- hw/dma/omap_dma.c | 26 +++++++++++++------------- hw/dma/pxa2xx_dma.c | 14 +++++++------- hw/gpio/max7310.c | 8 ++++---- hw/gpio/omap_gpio.c | 2 +- hw/i2c/omap_i2c.c | 6 +++--- hw/ide/ahci.c | 2 +- hw/ide/microdrive.c | 4 ++-- hw/input/lm832x.c | 6 +++--- hw/input/pxa2xx_keypad.c | 6 +++--- hw/input/tsc2005.c | 8 ++++---- hw/input/tsc210x.c | 4 ++-- hw/intc/omap_intc.c | 2 +- hw/isa/vt82c686.c | 2 +- hw/mips/gt64xxx_pci.c | 2 +- hw/misc/cbus.c | 12 ++++++------ hw/misc/omap_clk.c | 4 ++-- hw/misc/omap_gpmc.c | 6 +++--- hw/misc/omap_l4.c | 4 ++-- hw/misc/omap_sdrc.c | 2 +- hw/misc/omap_tap.c | 6 +++--- hw/misc/tmp105.c | 2 +- hw/pci-host/bonito.c | 2 +- hw/ssi/omap_spi.c | 6 +++--- hw/timer/omap_gptimer.c | 6 +++--- hw/timer/twl92230.c | 6 +++--- hw/usb/desc.c | 2 +- hw/usb/dev-bluetooth.c | 4 ++-- hw/usb/hcd-musb.c | 4 ++-- hw/usb/tusb6010.c | 14 +++++++------- hw/xenpv/xen_domainbuild.c | 16 ++++++++-------- hw/xenpv/xen_machine_pv.c | 2 +- include/hw/arm/omap.h | 10 +++++----- include/hw/arm/sharpsl.h | 2 +- memory_mapping.c | 2 +- migration/block.c | 4 ++-- ui/cursor.c | 6 +++--- ui/spice-display.c | 4 ++-- 63 files changed, 269 insertions(+), 269 deletions(-) diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index 58005b6..32687af 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -463,7 +463,7 @@ static uint32_t mipid_txrx(void *opaque, uint32_t cmd, = int len) uint8_t ret; =20 if (len > 9) { - hw_error("%s: FIXME: bad SPI word width %i\n", __FUNCTION__, len); + hw_error("%s: FIXME: bad SPI word width %i\n", __func__, len); } =20 if (s->p >=3D ARRAY_SIZE(s->resp)) { diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index b3e7625..1388200 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -999,7 +999,7 @@ static uint64_t omap_id_read(void *opaque, hwaddr addr, case omap1510: return 0x03310115; default: - hw_error("%s: bad mpu model\n", __FUNCTION__); + hw_error("%s: bad mpu model\n", __func__); } break; =20 @@ -1010,7 +1010,7 @@ static uint64_t omap_id_read(void *opaque, hwaddr add= r, case omap1510: return 0xfb47002f; default: - hw_error("%s: bad mpu model\n", __FUNCTION__); + hw_error("%s: bad mpu model\n", __func__); } break; } @@ -1716,7 +1716,7 @@ static void omap_clkm_write(void *opaque, hwaddr addr, case 0x18: /* ARM_SYSST */ if ((s->clkm.clocking_scheme ^ (value >> 11)) & 7) { s->clkm.clocking_scheme =3D (value >> 11) & 7; - printf("%s: clocking scheme set to %s\n", __FUNCTION__, + printf("%s: clocking scheme set to %s\n", __func__, clkschemename[s->clkm.clocking_scheme]); } s->clkm.cold_start &=3D value & 0x3f; @@ -2129,14 +2129,14 @@ qemu_irq *omap_mpuio_in_get(struct omap_mpuio_s *s) void omap_mpuio_out_set(struct omap_mpuio_s *s, int line, qemu_irq handler) { if (line >=3D 16 || line < 0) - hw_error("%s: No GPIO line %i\n", __FUNCTION__, line); + hw_error("%s: No GPIO line %i\n", __func__, line); s->handler[line] =3D handler; } =20 void omap_mpuio_key(struct omap_mpuio_s *s, int row, int col, int down) { if (row >=3D 5 || row < 0) - hw_error("%s: No key %i-%i\n", __FUNCTION__, col, row); + hw_error("%s: No key %i-%i\n", __func__, col, row); =20 if (down) s->buttons[row] |=3D 1 << col; @@ -2313,7 +2313,7 @@ void omap_uwire_attach(struct omap_uwire_s *s, uWireSlave *slave, int chipselect) { if (chipselect < 0 || chipselect > 3) { - fprintf(stderr, "%s: Bad chipselect %i\n", __FUNCTION__, chipselec= t); + fprintf(stderr, "%s: Bad chipselect %i\n", __func__, chipselect); exit(-1); } =20 @@ -2335,7 +2335,7 @@ static void omap_pwl_update(struct omap_pwl_s *s) =20 if (output !=3D s->output) { s->output =3D output; - printf("%s: Backlight now at %i/256\n", __FUNCTION__, output); + printf("%s: Backlight now at %i/256\n", __func__, output); } } =20 @@ -2473,7 +2473,7 @@ static void omap_pwt_write(void *opaque, hwaddr addr, case 0x04: /* VRC */ if ((value ^ s->vrc) & 1) { if (value & 1) - printf("%s: %iHz buzz on\n", __FUNCTION__, (int) + printf("%s: %iHz buzz on\n", __func__, (int) /* 1.5 MHz from a 12-MHz or 13-MHz PWT_CLK= */ ((omap_clk_getrate(s->clk) >> 3) / /* Pre-multiplexer divider */ @@ -2490,7 +2490,7 @@ static void omap_pwt_write(void *opaque, hwaddr addr, ((value & (1 << 5)) ? 80 : 127) / (107 * 55 * 63 * 127))); else - printf("%s: silence!\n", __FUNCTION__); + printf("%s: silence!\n", __func__); } s->vrc =3D value & 0x7f; break; @@ -2562,7 +2562,7 @@ static void omap_rtc_alarm_update(struct omap_rtc_s *= s) { s->alarm_ti =3D mktimegm(&s->alarm_tm); if (s->alarm_ti =3D=3D -1) - printf("%s: conversion failed\n", __FUNCTION__); + printf("%s: conversion failed\n", __func__); } =20 static uint64_t omap_rtc_read(void *opaque, hwaddr addr, @@ -3028,7 +3028,7 @@ static void omap_mcbsp_source_tick(void *opaque) if (!s->rx_rate) return; if (s->rx_req) - printf("%s: Rx FIFO overrun\n", __FUNCTION__); + printf("%s: Rx FIFO overrun\n", __func__); =20 s->rx_req =3D s->rx_rate << bps[(s->rcr[0] >> 5) & 7]; =20 @@ -3074,7 +3074,7 @@ static void omap_mcbsp_sink_tick(void *opaque) if (!s->tx_rate) return; if (s->tx_req) - printf("%s: Tx FIFO underrun\n", __FUNCTION__); + printf("%s: Tx FIFO underrun\n", __func__); =20 s->tx_req =3D s->tx_rate << bps[(s->xcr[0] >> 5) & 7]; =20 @@ -3176,7 +3176,7 @@ static uint64_t omap_mcbsp_read(void *opaque, hwaddr = addr, /* Fall through. */ case 0x02: /* DRR1 */ if (s->rx_req < 2) { - printf("%s: Rx FIFO underrun\n", __FUNCTION__); + printf("%s: Rx FIFO underrun\n", __func__); omap_mcbsp_rx_done(s); } else { s->tx_req -=3D 2; @@ -3282,7 +3282,7 @@ static void omap_mcbsp_writeh(void *opaque, hwaddr ad= dr, if (s->tx_req < 2) omap_mcbsp_tx_done(s); } else - printf("%s: Tx FIFO overrun\n", __FUNCTION__); + printf("%s: Tx FIFO overrun\n", __func__); return; =20 case 0x08: /* SPCR2 */ @@ -3297,7 +3297,7 @@ static void omap_mcbsp_writeh(void *opaque, hwaddr ad= dr, s->spcr[0] &=3D 0x0006; s->spcr[0] |=3D 0xf8f9 & value; if (value & (1 << 15)) /* DLB */ - printf("%s: Digital Loopback mode enable attempt\n", __FUNCTIO= N__); + printf("%s: Digital Loopback mode enable attempt\n", __func__); if (~value & 1) { /* RRST */ s->spcr[0] &=3D ~6; s->rx_req =3D 0; @@ -3330,13 +3330,13 @@ static void omap_mcbsp_writeh(void *opaque, hwaddr = addr, s->mcr[1] =3D value & 0x03e3; if (value & 3) /* XMCM */ printf("%s: Tx channel selection mode enable attempt\n", - __FUNCTION__); + __func__); return; case 0x1a: /* MCR1 */ s->mcr[0] =3D value & 0x03e1; if (value & 1) /* RMCM */ printf("%s: Rx channel selection mode enable attempt\n", - __FUNCTION__); + __func__); return; case 0x1c: /* RCERA */ s->rcer[0] =3D value & 0xffff; @@ -3418,7 +3418,7 @@ static void omap_mcbsp_writew(void *opaque, hwaddr ad= dr, if (s->tx_req < 4) omap_mcbsp_tx_done(s); } else - printf("%s: Tx FIFO overrun\n", __FUNCTION__); + printf("%s: Tx FIFO overrun\n", __func__); return; } =20 @@ -3536,7 +3536,7 @@ static void omap_lpg_tick(void *opaque) timer_mod(s->tm, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + s->on); =20 s->cycle =3D !s->cycle; - printf("%s: LED is %s\n", __FUNCTION__, s->cycle ? "on" : "off"); + printf("%s: LED is %s\n", __func__, s->cycle ? "on" : "off"); } =20 static void omap_lpg_update(struct omap_lpg_s *s) @@ -3557,9 +3557,9 @@ static void omap_lpg_update(struct omap_lpg_s *s) =20 timer_del(s->tm); if (on =3D=3D period && s->on < s->period) - printf("%s: LED is on\n", __FUNCTION__); + printf("%s: LED is on\n", __func__); else if (on =3D=3D 0 && s->on) - printf("%s: LED is off\n", __FUNCTION__); + printf("%s: LED is off\n", __func__); else if (on && (on !=3D s->on || period !=3D s->period)) { s->cycle =3D 0; s->on =3D on; diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index f5b1488..b53878b 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -1312,7 +1312,7 @@ static void omap_prcm_apll_update(struct omap_prcm_s = *s) =20 if (mode[0] =3D=3D 1 || mode[0] =3D=3D 2 || mode[1] =3D=3D 1 || mode[1= ] =3D=3D 2) fprintf(stderr, "%s: bad EN_54M_PLL or bad EN_96M_PLL\n", - __FUNCTION__); + __func__); } =20 static void omap_prcm_dpll_update(struct omap_prcm_s *s) @@ -1331,7 +1331,7 @@ static void omap_prcm_dpll_update(struct omap_prcm_s = *s) s->dpll_lock =3D 0; switch (mode) { case 0: - fprintf(stderr, "%s: bad EN_DPLL\n", __FUNCTION__); + fprintf(stderr, "%s: bad EN_DPLL\n", __func__); break; case 1: /* Low-power bypass mode (Default) */ case 2: /* Fast-relock bypass mode */ @@ -1358,7 +1358,7 @@ static void omap_prcm_dpll_update(struct omap_prcm_s = *s) omap_clk_reparent(core, dpll_x2); break; case 3: - fprintf(stderr, "%s: bad CORE_CLK_SRC\n", __FUNCTION__); + fprintf(stderr, "%s: bad CORE_CLK_SRC\n", __func__); break; } } @@ -1628,7 +1628,7 @@ static void omap_prcm_write(void *opaque, hwaddr addr, case 0x500: /* CM_CLKEN_PLL */ if (value & 0xffffff30) fprintf(stderr, "%s: write 0s in CM_CLKEN_PLL for " - "future compatibility\n", __FUNCTION__); + "future compatibility\n", __func__); if ((s->clken[9] ^ value) & 0xcc) { s->clken[9] &=3D ~0xcc; s->clken[9] |=3D value & 0xcc; @@ -1647,7 +1647,7 @@ static void omap_prcm_write(void *opaque, hwaddr addr, case 0x540: /* CM_CLKSEL1_PLL */ if (value & 0xfc4000d7) fprintf(stderr, "%s: write 0s in CM_CLKSEL1_PLL for " - "future compatibility\n", __FUNCTION__); + "future compatibility\n", __func__); if ((s->clksel[5] ^ value) & 0x003fff00) { s->clksel[5] =3D value & 0x03bfff28; omap_prcm_dpll_update(s); @@ -1659,7 +1659,7 @@ static void omap_prcm_write(void *opaque, hwaddr addr, case 0x544: /* CM_CLKSEL2_PLL */ if (value & ~3) fprintf(stderr, "%s: write 0s in CM_CLKSEL2_PLL[31:2] for " - "future compatibility\n", __FUNCTION__); + "future compatibility\n", __func__); if (s->clksel[6] !=3D (value & 3)) { s->clksel[6] =3D value & 3; omap_prcm_dpll_update(s); diff --git a/hw/arm/palm.c b/hw/arm/palm.c index a1f55d7..285f437 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -44,7 +44,7 @@ static void static_write(void *opaque, hwaddr offset, uin= t64_t value, { #ifdef SPY printf("%s: value %08lx written at " PA_FMT "\n", - __FUNCTION__, value, offset); + __func__, value, offset); #endif } =20 @@ -127,11 +127,11 @@ static void palmte_onoff_gpios(void *opaque, int line= , int level) switch (line) { case 0: printf("%s: current to MMC/SD card %sabled.\n", - __FUNCTION__, level ? "dis" : "en"); + __func__, level ? "dis" : "en"); break; case 1: printf("%s: internal speaker amplifier %s.\n", - __FUNCTION__, level ? "down" : "on"); + __func__, level ? "down" : "on"); break; =20 /* These LCD & Audio output signals have not been identified yet. */ @@ -139,12 +139,12 @@ static void palmte_onoff_gpios(void *opaque, int line= , int level) case 3: case 4: printf("%s: LCD GPIO%i %s.\n", - __FUNCTION__, line - 1, level ? "high" : "low"); + __func__, line - 1, level ? "high" : "low"); break; case 5: case 6: printf("%s: Audio GPIO%i %s.\n", - __FUNCTION__, line - 4, level ? "high" : "low"); + __func__, line - 4, level ? "high" : "low"); break; } } @@ -234,7 +234,7 @@ static void palmte_init(MachineState *machine) rom_size =3D get_image_size(option_rom[0].name); if (rom_size > flash_size) { fprintf(stderr, "%s: ROM image too big (%x > %x)\n", - __FUNCTION__, rom_size, flash_size); + __func__, rom_size, flash_size); rom_size =3D 0; } if (rom_size > 0) { @@ -244,7 +244,7 @@ static void palmte_init(MachineState *machine) } if (rom_size < 0) { fprintf(stderr, "%s: error loading '%s'\n", - __FUNCTION__, option_rom[0].name); + __func__, option_rom[0].name); } } =20 diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index ab691a7..db860c2 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -107,7 +107,7 @@ static uint64_t pxa2xx_pm_read(void *opaque, hwaddr add= r, return s->pm_regs[addr >> 2]; default: fail: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -139,7 +139,7 @@ static void pxa2xx_pm_write(void *opaque, hwaddr addr, break; } =20 - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } } @@ -180,7 +180,7 @@ static uint64_t pxa2xx_cm_read(void *opaque, hwaddr add= r, return s->cm_regs[CCCR >> 2] | (3 << 28); =20 default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -205,7 +205,7 @@ static void pxa2xx_cm_write(void *opaque, hwaddr addr, break; =20 default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } } @@ -410,7 +410,7 @@ static uint64_t pxa2xx_mm_read(void *opaque, hwaddr add= r, return s->mm_regs[addr >> 2]; =20 default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -429,7 +429,7 @@ static void pxa2xx_mm_write(void *opaque, hwaddr addr, } =20 default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } } @@ -619,7 +619,7 @@ static uint64_t pxa2xx_ssp_read(void *opaque, hwaddr ad= dr, if (!s->enable) return 0xffffffff; if (s->rx_level < 1) { - printf("%s: SSP Rx Underrun\n", __FUNCTION__); + printf("%s: SSP Rx Underrun\n", __func__); return 0xffffffff; } s->rx_level --; @@ -636,7 +636,7 @@ static uint64_t pxa2xx_ssp_read(void *opaque, hwaddr ad= dr, case SSACD: return s->ssacd; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -653,9 +653,9 @@ static void pxa2xx_ssp_write(void *opaque, hwaddr addr, s->sscr[0] =3D value & 0xc7ffffff; s->enable =3D value & SSCR0_SSE; if (value & SSCR0_MOD) - printf("%s: Attempt to use network mode\n", __FUNCTION__); + printf("%s: Attempt to use network mode\n", __func__); if (s->enable && SSCR0_DSS(value) < 4) - printf("%s: Wrong data size: %i bits\n", __FUNCTION__, + printf("%s: Wrong data size: %i bits\n", __func__, SSCR0_DSS(value)); if (!(value & SSCR0_SSE)) { s->sssr =3D 0; @@ -668,7 +668,7 @@ static void pxa2xx_ssp_write(void *opaque, hwaddr addr, case SSCR1: s->sscr[1] =3D value; if (value & (SSCR1_LBM | SSCR1_EFWR)) - printf("%s: Attempt to use SSP test mode\n", __FUNCTION__); + printf("%s: Attempt to use SSP test mode\n", __func__); pxa2xx_ssp_fifo_update(s); break; =20 @@ -728,7 +728,7 @@ static void pxa2xx_ssp_write(void *opaque, hwaddr addr, break; =20 default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } } @@ -990,7 +990,7 @@ static uint64_t pxa2xx_rtc_read(void *opaque, hwaddr ad= dr, else return s->last_swcr; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -1096,7 +1096,7 @@ static void pxa2xx_rtc_write(void *opaque, hwaddr add= r, break; =20 default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); } } =20 @@ -1344,7 +1344,7 @@ static uint64_t pxa2xx_i2c_read(void *opaque, hwaddr = addr, s->ibmr =3D 0; return s->ibmr; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -1417,7 +1417,7 @@ static void pxa2xx_i2c_write(void *opaque, hwaddr add= r, break; =20 default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); } } =20 @@ -1618,7 +1618,7 @@ static uint64_t pxa2xx_i2s_read(void *opaque, hwaddr = addr, } return 0; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -1641,14 +1641,14 @@ static void pxa2xx_i2s_write(void *opaque, hwaddr a= ddr, s->status &=3D ~(1 << 7); /* I2SOFF */ } if (value & (1 << 4)) /* EFWR */ - printf("%s: Attempt to use special function\n", __FUNCTION__); + printf("%s: Attempt to use special function\n", __func__); s->enable =3D (value & 9) =3D=3D 1; /* ENB && !RST*/ pxa2xx_i2s_update(s); break; case SACR1: s->control[1] =3D value & 0x0039; if (value & (1 << 5)) /* ENLBF */ - printf("%s: Attempt to use loopback function\n", __FUNCTION__); + printf("%s: Attempt to use loopback function\n", __func__); if (value & (1 << 4)) /* DPRL */ s->fifo_len =3D 0; pxa2xx_i2s_update(s); @@ -1675,7 +1675,7 @@ static void pxa2xx_i2s_write(void *opaque, hwaddr add= r, } break; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); } } =20 @@ -1851,7 +1851,7 @@ static uint64_t pxa2xx_fir_read(void *opaque, hwaddr = addr, pxa2xx_fir_update(s); return ret; } - printf("%s: Rx FIFO underrun.\n", __FUNCTION__); + printf("%s: Rx FIFO underrun.\n", __func__); break; case ICSR0: return s->status[0]; @@ -1860,7 +1860,7 @@ static uint64_t pxa2xx_fir_read(void *opaque, hwaddr = addr, case ICFOR: return s->rx_len; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -1912,7 +1912,7 @@ static void pxa2xx_fir_write(void *opaque, hwaddr add= r, case ICFOR: break; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); } } =20 diff --git a/hw/arm/pxa2xx_gpio.c b/hw/arm/pxa2xx_gpio.c index 521dbad..e150701 100644 --- a/hw/arm/pxa2xx_gpio.c +++ b/hw/arm/pxa2xx_gpio.c @@ -107,7 +107,7 @@ static void pxa2xx_gpio_set(void *opaque, int line, int= level) uint32_t mask; =20 if (line >=3D s->lines) { - printf("%s: No GPIO pin %i\n", __FUNCTION__, line); + printf("%s: No GPIO pin %i\n", __func__, line); return; } =20 @@ -195,7 +195,7 @@ static uint64_t pxa2xx_gpio_read(void *opaque, hwaddr o= ffset, return s->status[bank]; =20 default: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } =20 return 0; @@ -248,7 +248,7 @@ static void pxa2xx_gpio_write(void *opaque, hwaddr offs= et, break; =20 default: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } } =20 diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index b516ced..61275fa 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -165,7 +165,7 @@ static uint64_t pxa2xx_pic_mem_read(void *opaque, hwadd= r offset, case ICHP: /* Highest Priority register */ return pxa2xx_pic_highest(s); default: - printf("%s: Bad register offset " REG_FMT "\n", __FUNCTION__, offs= et); + printf("%s: Bad register offset " REG_FMT "\n", __func__, offset); return 0; } } @@ -198,7 +198,7 @@ static void pxa2xx_pic_mem_write(void *opaque, hwaddr o= ffset, s->priority[32 + ((offset - IPR32) >> 2)] =3D value & 0x8000003f; break; default: - printf("%s: Bad register offset " REG_FMT "\n", __FUNCTION__, offs= et); + printf("%s: Bad register offset " REG_FMT "\n", __func__, offset); return; } pxa2xx_pic_update(opaque); diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index 0447963..a55b1a3 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -159,7 +159,7 @@ static int tosa_dac_send(I2CSlave *i2c, uint8_t data) s->buf[s->len] =3D data; if (s->len ++ > 2) { #ifdef VERBOSE - fprintf(stderr, "%s: message too long (%i bytes)\n", __FUNCTION__,= s->len); + fprintf(stderr, "%s: message too long (%i bytes)\n", __func__, s->= len); #endif return 1; } @@ -181,14 +181,14 @@ static int tosa_dac_event(I2CSlave *i2c, enum i2c_eve= nt event) case I2C_START_SEND: break; case I2C_START_RECV: - printf("%s: recv not supported!!!\n", __FUNCTION__); + printf("%s: recv not supported!!!\n", __func__); break; case I2C_FINISH: #ifdef VERBOSE if (s->len < 2) - printf("%s: message too short (%i bytes)\n", __FUNCTION__, s->= len); + printf("%s: message too short (%i bytes)\n", __func__, s->len); if (s->len > 2) - printf("%s: message too long\n", __FUNCTION__); + printf("%s: message too long\n", __func__); #endif break; default: @@ -200,7 +200,7 @@ static int tosa_dac_event(I2CSlave *i2c, enum i2c_event= event) =20 static int tosa_dac_recv(I2CSlave *s) { - printf("%s: recv not supported!!!\n", __FUNCTION__); + printf("%s: recv not supported!!!\n", __func__); return -1; } =20 diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index 5402cd1..e8aa784 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -316,7 +316,7 @@ static void hda_audio_command(HDACodecDevice *hda, uint= 32_t nid, uint32_t data) goto fail; } dprint(a, 2, "%s: nid %d (%s), verb 0x%x, payload 0x%x\n", - __FUNCTION__, nid, node->name, verb, payload); + __func__, nid, node->name, verb, payload); =20 switch (verb) { /* all nodes */ @@ -449,7 +449,7 @@ static void hda_audio_command(HDACodecDevice *hda, uint= 32_t nid, uint32_t data) =20 fail: dprint(a, 1, "%s: not handled: nid %d (%s), verb 0x%x, payload 0x%x\n", - __FUNCTION__, nid, node ? node->name : "?", verb, payload); + __func__, nid, node ? node->name : "?", verb, payload); hda_codec_response(hda, true, 0); } =20 @@ -484,7 +484,7 @@ static int hda_audio_init(HDACodecDevice *hda, const st= ruct desc_codec *desc) =20 a->desc =3D desc; a->name =3D object_get_typename(OBJECT(a)); - dprint(a, 1, "%s: cad %d\n", __FUNCTION__, a->hda.cad); + dprint(a, 1, "%s: cad %d\n", __func__, a->hda.cad); =20 AUD_register_card("hda", &a->card); for (i =3D 0; i < a->desc->nnodes; i++) { @@ -526,7 +526,7 @@ static void hda_audio_exit(HDACodecDevice *hda) HDAAudioStream *st; int i; =20 - dprint(a, 1, "%s\n", __FUNCTION__); + dprint(a, 1, "%s\n", __func__); for (i =3D 0; i < ARRAY_SIZE(a->st); i++) { st =3D a->st + i; if (st->node =3D=3D NULL) { @@ -547,7 +547,7 @@ static int hda_audio_post_load(void *opaque, int versio= n) HDAAudioStream *st; int i; =20 - dprint(a, 1, "%s\n", __FUNCTION__); + dprint(a, 1, "%s\n", __func__); if (version =3D=3D 1) { /* assume running_compat[] is for output streams */ for (i =3D 0; i < ARRAY_SIZE(a->running_compat); i++) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index a3e670c..948268a 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -265,7 +265,7 @@ static void intel_hda_update_irq(IntelHDAState *d) } else { level =3D 0; } - dprint(d, 2, "%s: level %d [%s]\n", __FUNCTION__, + dprint(d, 2, "%s: level %d [%s]\n", __func__, level, msi ? "msi" : "intx"); if (msi) { if (level) { @@ -285,7 +285,7 @@ static int intel_hda_send_command(IntelHDAState *d, uin= t32_t verb) cad =3D (verb >> 28) & 0x0f; if (verb & (1 << 27)) { /* indirect node addressing, not specified in HDA 1.0 */ - dprint(d, 1, "%s: indirect node addressing (guest bug?)\n", __FUNC= TION__); + dprint(d, 1, "%s: indirect node addressing (guest bug?)\n", __func= __); return -1; } nid =3D (verb >> 20) & 0x7f; @@ -293,7 +293,7 @@ static int intel_hda_send_command(IntelHDAState *d, uin= t32_t verb) =20 codec =3D hda_codec_find(&d->codecs, cad); if (codec =3D=3D NULL) { - dprint(d, 1, "%s: addressed non-existing codec\n", __FUNCTION__); + dprint(d, 1, "%s: addressed non-existing codec\n", __func__); return -1; } cdc =3D HDA_CODEC_DEVICE_GET_CLASS(codec); @@ -307,22 +307,22 @@ static void intel_hda_corb_run(IntelHDAState *d) uint32_t rp, verb; =20 if (d->ics & ICH6_IRS_BUSY) { - dprint(d, 2, "%s: [icw] verb 0x%08x\n", __FUNCTION__, d->icw); + dprint(d, 2, "%s: [icw] verb 0x%08x\n", __func__, d->icw); intel_hda_send_command(d, d->icw); return; } =20 for (;;) { if (!(d->corb_ctl & ICH6_CORBCTL_RUN)) { - dprint(d, 2, "%s: !run\n", __FUNCTION__); + dprint(d, 2, "%s: !run\n", __func__); return; } if ((d->corb_rp & 0xff) =3D=3D d->corb_wp) { - dprint(d, 2, "%s: corb ring empty\n", __FUNCTION__); + dprint(d, 2, "%s: corb ring empty\n", __func__); return; } if (d->rirb_count =3D=3D d->rirb_cnt) { - dprint(d, 2, "%s: rirb count reached\n", __FUNCTION__); + dprint(d, 2, "%s: rirb count reached\n", __func__); return; } =20 @@ -331,7 +331,7 @@ static void intel_hda_corb_run(IntelHDAState *d) verb =3D ldl_le_pci_dma(&d->pci, addr + 4*rp); d->corb_rp =3D rp; =20 - dprint(d, 2, "%s: [rp 0x%x] verb 0x%08x\n", __FUNCTION__, rp, verb= ); + dprint(d, 2, "%s: [rp 0x%x] verb 0x%08x\n", __func__, rp, verb); intel_hda_send_command(d, verb); } } @@ -345,7 +345,7 @@ static void intel_hda_response(HDACodecDevice *dev, boo= l solicited, uint32_t res =20 if (d->ics & ICH6_IRS_BUSY) { dprint(d, 2, "%s: [irr] response 0x%x, cad 0x%x\n", - __FUNCTION__, response, dev->cad); + __func__, response, dev->cad); d->irr =3D response; d->ics &=3D ~(ICH6_IRS_BUSY | 0xf0); d->ics |=3D (ICH6_IRS_VALID | (dev->cad << 4)); @@ -353,7 +353,7 @@ static void intel_hda_response(HDACodecDevice *dev, boo= l solicited, uint32_t res } =20 if (!(d->rirb_ctl & ICH6_RBCTL_DMA_EN)) { - dprint(d, 1, "%s: rirb dma disabled, drop codec response\n", __FUN= CTION__); + dprint(d, 1, "%s: rirb dma disabled, drop codec response\n", __fun= c__); return; } =20 @@ -365,17 +365,17 @@ static void intel_hda_response(HDACodecDevice *dev, b= ool solicited, uint32_t res d->rirb_wp =3D wp; =20 dprint(d, 2, "%s: [wp 0x%x] response 0x%x, extra 0x%x\n", - __FUNCTION__, wp, response, ex); + __func__, wp, response, ex); =20 d->rirb_count++; if (d->rirb_count =3D=3D d->rirb_cnt) { - dprint(d, 2, "%s: rirb count reached (%d)\n", __FUNCTION__, d->rir= b_count); + dprint(d, 2, "%s: rirb count reached (%d)\n", __func__, d->rirb_co= unt); if (d->rirb_ctl & ICH6_RBCTL_IRQ_EN) { d->rirb_sts |=3D ICH6_RBSTS_IRQ; intel_hda_update_irq(d); } } else if ((d->corb_rp & 0xff) =3D=3D d->corb_wp) { - dprint(d, 2, "%s: corb ring empty (%d/%d)\n", __FUNCTION__, + dprint(d, 2, "%s: corb ring empty (%d/%d)\n", __func__, d->rirb_count, d->rirb_cnt); if (d->rirb_ctl & ICH6_RBCTL_IRQ_EN) { d->rirb_sts |=3D ICH6_RBSTS_IRQ; @@ -1144,7 +1144,7 @@ static int intel_hda_post_load(void *opaque, int vers= ion) IntelHDAState* d =3D opaque; int i; =20 - dprint(d, 1, "%s\n", __FUNCTION__); + dprint(d, 1, "%s\n", __func__); for (i =3D 0; i < ARRAY_SIZE(d->st); i++) { if (d->st[i].ctl & 0x02) { intel_hda_parse_bdl(d, &d->st[i]); diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c index 8bb44a7..6d8b728 100644 --- a/hw/audio/wm8750.c +++ b/hw/audio/wm8750.c @@ -315,7 +315,7 @@ static int wm8750_event(I2CSlave *i2c, enum i2c_event e= vent) #ifdef VERBOSE if (s->i2c_len < 2) printf("%s: message too short (%i bytes)\n", - __FUNCTION__, s->i2c_len); + __func__, s->i2c_len); #endif break; default: @@ -555,7 +555,7 @@ static int wm8750_tx(I2CSlave *i2c, uint8_t data) =20 #ifdef VERBOSE default: - printf("%s: unknown register %02x\n", __FUNCTION__, cmd); + printf("%s: unknown register %02x\n", __func__, cmd); #endif } =20 diff --git a/hw/block/nand.c b/hw/block/nand.c index 76dcd3f..919cb9b 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -321,7 +321,7 @@ static void nand_command(NANDFlashState *s) break; =20 default: - printf("%s: Unknown NAND command 0x%02x\n", __FUNCTION__, s->cmd); + printf("%s: Unknown NAND command 0x%02x\n", __func__, s->cmd); } } =20 @@ -640,7 +640,7 @@ DeviceState *nand_init(BlockBackend *blk, int manf_id, = int chip_id) DeviceState *dev; =20 if (nand_flash_ids[chip_id].size =3D=3D 0) { - hw_error("%s: Unsupported NAND chip ID.\n", __FUNCTION__); + hw_error("%s: Unsupported NAND chip ID.\n", __func__); } dev =3D DEVICE(object_new(TYPE_NAND)); qdev_prop_set_uint8(dev, "manufacturer_id", manf_id); diff --git a/hw/block/onenand.c b/hw/block/onenand.c index de65c9e..e243182 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -659,12 +659,12 @@ static uint64_t onenand_read(void *opaque, hwaddr add= r, case 0xff02: /* ECC Result of spare area data */ case 0xff03: /* ECC Result of main area data */ case 0xff04: /* ECC Result of spare area data */ - hw_error("%s: imeplement ECC\n", __FUNCTION__); + hw_error("%s: imeplement ECC\n", __func__); return 0x0000; } =20 fprintf(stderr, "%s: unknown OneNAND register %x\n", - __FUNCTION__, offset); + __func__, offset); return 0; } =20 @@ -709,7 +709,7 @@ static void onenand_write(void *opaque, hwaddr addr, =20 default: fprintf(stderr, "%s: unknown OneNAND boot command %"PRIx64"\n", - __FUNCTION__, value); + __func__, value); } break; =20 @@ -760,7 +760,7 @@ static void onenand_write(void *opaque, hwaddr addr, =20 default: fprintf(stderr, "%s: unknown OneNAND register %x\n", - __FUNCTION__, offset); + __func__, offset); } } =20 diff --git a/hw/bt/core.c b/hw/bt/core.c index 615f0af..c1806b7 100644 --- a/hw/bt/core.c +++ b/hw/bt/core.c @@ -32,23 +32,23 @@ static void bt_dummy_lmp_connection_complete(struct bt_= link_s *link) { if (link->slave->reject_reason) fprintf(stderr, "%s: stray LMP_not_accepted received, fixme\n", - __FUNCTION__); + __func__); else fprintf(stderr, "%s: stray LMP_accepted received, fixme\n", - __FUNCTION__); + __func__); exit(-1); } =20 static void bt_dummy_lmp_disconnect_master(struct bt_link_s *link) { - fprintf(stderr, "%s: stray LMP_detach received, fixme\n", __FUNCTION__= ); + fprintf(stderr, "%s: stray LMP_detach received, fixme\n", __func__); exit(-1); } =20 static void bt_dummy_lmp_acl_resp(struct bt_link_s *link, const uint8_t *data, int start, int len) { - fprintf(stderr, "%s: stray ACL response PDU, fixme\n", __FUNCTION__); + fprintf(stderr, "%s: stray ACL response PDU, fixme\n", __func__); exit(-1); } =20 @@ -113,7 +113,7 @@ void bt_device_done(struct bt_device_s *dev) while (*p && *p !=3D dev) p =3D &(*p)->next; if (*p !=3D dev) { - fprintf(stderr, "%s: bad bt device \"%s\"\n", __FUNCTION__, + fprintf(stderr, "%s: bad bt device \"%s\"\n", __func__, dev->lmp_name ?: "(null)"); exit(-1); } diff --git a/hw/bt/hci-csr.c b/hw/bt/hci-csr.c index d13192b..ac067b8 100644 --- a/hw/bt/hci-csr.c +++ b/hw/bt/hci-csr.c @@ -111,14 +111,14 @@ static uint8_t *csrhci_out_packet(struct csrhci_s *s,= int len) =20 if (off < FIFO_LEN) { if (off + len > FIFO_LEN && (s->out_size =3D off + len) > FIFO_LEN= * 2) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __FUNCTION__, le= n); + fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); exit(-1); } return s->outfifo + off; } =20 if (s->out_len > s->out_size) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __FUNCTION__, len); + fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); exit(-1); } =20 @@ -169,7 +169,7 @@ static void csrhci_in_packet_vendor(struct csrhci_s *s,= int ocf, =20 s->hci->bdaddr_set(s->hci, s->bd_addr.b); fprintf(stderr, "%s: bd_address loaded from firmware: " - "%02x:%02x:%02x:%02x:%02x:%02x\n", __FUNCTION_= _, + "%02x:%02x:%02x:%02x:%02x:%02x\n", __func__, s->bd_addr.b[0], s->bd_addr.b[1], s->bd_addr.b= [2], s->bd_addr.b[3], s->bd_addr.b[4], s->bd_addr.b= [5]); } @@ -181,7 +181,7 @@ static void csrhci_in_packet_vendor(struct csrhci_s *s,= int ocf, break; =20 default: - fprintf(stderr, "%s: got a bad CMD packet\n", __FUNCTION__); + fprintf(stderr, "%s: got a bad CMD packet\n", __func__); return; } =20 @@ -226,7 +226,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_= t *pkt) case H4_NEG_PKT: if (s->in_hdr !=3D sizeof(csrhci_neg_packet) || memcmp(pkt - 1, csrhci_neg_packet, s->in_hdr)) { - fprintf(stderr, "%s: got a bad NEG packet\n", __FUNCTION__); + fprintf(stderr, "%s: got a bad NEG packet\n", __func__); return; } pkt +=3D 2; @@ -241,7 +241,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_= t *pkt) =20 case H4_ALIVE_PKT: if (s->in_hdr !=3D 4 || pkt[1] !=3D 0x55 || pkt[2] !=3D 0x00) { - fprintf(stderr, "%s: got a bad ALIVE packet\n", __FUNCTION__); + fprintf(stderr, "%s: got a bad ALIVE packet\n", __func__); return; } =20 @@ -254,7 +254,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_= t *pkt) default: bad_pkt: /* TODO: error out */ - fprintf(stderr, "%s: got a bad packet\n", __FUNCTION__); + fprintf(stderr, "%s: got a bad packet\n", __func__); break; } =20 diff --git a/hw/bt/hci.c b/hw/bt/hci.c index 476ebec..df05f07 100644 --- a/hw/bt/hci.c +++ b/hw/bt/hci.c @@ -458,7 +458,7 @@ static inline uint8_t *bt_hci_event_start(struct bt_hci= _s *hci, =20 if (len > 255) { fprintf(stderr, "%s: HCI event params too long (%ib)\n", - __FUNCTION__, len); + __func__, len); exit(-1); } =20 @@ -589,7 +589,7 @@ static void bt_hci_inquiry_result(struct bt_hci_s *hci, bt_hci_inquiry_result_with_rssi(hci, slave); return; default: - fprintf(stderr, "%s: bad inquiry mode %02x\n", __FUNCTION__, + fprintf(stderr, "%s: bad inquiry mode %02x\n", __func__, hci->lm.inquiry_mode); exit(-1); } @@ -1528,7 +1528,7 @@ static void bt_submit_hci(struct HCIInfo *info, "the Inquiry command has been issued, a Comman= d " "Status event has been received for the Inquir= y " "command, and before the Inquiry Complete even= t " - "occurs", __FUNCTION__); + "occurs", __func__); bt_hci_event_complete_status(hci, HCI_COMMAND_DISALLOWED); break; } @@ -1567,7 +1567,7 @@ static void bt_submit_hci(struct HCIInfo *info, "the Inquiry command has been issued, a Comman= d " "Status event has been received for the Inquir= y " "command, and before the Inquiry Complete even= t " - "occurs", __FUNCTION__); + "occurs", __func__); bt_hci_event_complete_status(hci, HCI_COMMAND_DISALLOWED); break; } @@ -1972,7 +1972,7 @@ static void bt_submit_hci(struct HCIInfo *info, =20 short_hci: fprintf(stderr, "%s: HCI packet too short (%iB)\n", - __FUNCTION__, length); + __func__, length); bt_hci_event_status(hci, HCI_INVALID_PARAMETERS); break; } @@ -1992,7 +1992,7 @@ static inline void bt_hci_lmp_acl_data(struct bt_hci_= s *hci, uint16_t handle, =20 if (len + HCI_ACL_HDR_SIZE > sizeof(hci->acl_buf)) { fprintf(stderr, "%s: can't take ACL packets %i bytes long\n", - __FUNCTION__, len); + __func__, len); return; } memcpy(hci->acl_buf + HCI_ACL_HDR_SIZE, data, len); @@ -2030,7 +2030,7 @@ static void bt_submit_acl(struct HCIInfo *info, =20 if (length < HCI_ACL_HDR_SIZE) { fprintf(stderr, "%s: ACL packet too short (%iB)\n", - __FUNCTION__, length); + __func__, length); return; } =20 @@ -2042,7 +2042,7 @@ static void bt_submit_acl(struct HCIInfo *info, =20 if (bt_hci_handle_bad(hci, handle)) { fprintf(stderr, "%s: invalid ACL handle %03x\n", - __FUNCTION__, handle); + __func__, handle); /* TODO: signal an error */ return; } @@ -2050,7 +2050,7 @@ static void bt_submit_acl(struct HCIInfo *info, =20 if (datalen > length) { fprintf(stderr, "%s: ACL packet too short (%iB < %iB)\n", - __FUNCTION__, length, datalen); + __func__, length, datalen); return; } =20 @@ -2061,7 +2061,7 @@ static void bt_submit_acl(struct HCIInfo *info, hci->asb_handle =3D handle; else if (handle !=3D hci->asb_handle) { fprintf(stderr, "%s: Bad handle %03x in Active Slave Broadcast= \n", - __FUNCTION__, handle); + __func__, handle); /* TODO: signal an error */ return; } @@ -2074,7 +2074,7 @@ static void bt_submit_acl(struct HCIInfo *info, hci->psb_handle =3D handle; else if (handle !=3D hci->psb_handle) { fprintf(stderr, "%s: Bad handle %03x in Parked Slave Broadcast= \n", - __FUNCTION__, handle); + __func__, handle); /* TODO: signal an error */ return; } @@ -2106,13 +2106,13 @@ static void bt_submit_sco(struct HCIInfo *info, =20 if (bt_hci_handle_bad(hci, handle)) { fprintf(stderr, "%s: invalid SCO handle %03x\n", - __FUNCTION__, handle); + __func__, handle); return; } =20 if (datalen > length) { fprintf(stderr, "%s: SCO packet too short (%iB < %iB)\n", - __FUNCTION__, length, datalen); + __func__, length, datalen); return; } =20 diff --git a/hw/bt/hid.c b/hw/bt/hid.c index f6affbb..09d1732 100644 --- a/hw/bt/hid.c +++ b/hw/bt/hid.c @@ -420,7 +420,7 @@ static void bt_hid_interrupt_sdu(void *opaque, const ui= nt8_t *data, int len) return; bad: fprintf(stderr, "%s: bad transaction on Interrupt channel.\n", - __FUNCTION__); + __func__); } =20 /* "Virtual cable" plug/unplug event. */ diff --git a/hw/bt/l2cap.c b/hw/bt/l2cap.c index e342045..3e53dd0 100644 --- a/hw/bt/l2cap.c +++ b/hw/bt/l2cap.c @@ -468,7 +468,7 @@ static void l2cap_channel_close(struct l2cap_instance_s= *l2cap, if (likely(ch)) { if (ch->remote_cid !=3D source_cid) { fprintf(stderr, "%s: Ignoring a Disconnection Request with the= " - "invalid SCID %04x.\n", __FUNCTION__, source_c= id); + "invalid SCID %04x.\n", __func__, source_cid); return; } =20 @@ -791,7 +791,7 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, /* TODO: do the IDs really have to be in sequence? */ if (!id || (id !=3D l2cap->last_id && id !=3D l2cap->next_id)) { fprintf(stderr, "%s: out of sequence command packet ignored.\n", - __FUNCTION__); + __func__); return; } #else @@ -814,7 +814,7 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, =20 /* We never issue commands other than Command Reject currently. */ fprintf(stderr, "%s: stray Command Reject (%02x, %04x) " - "packet, ignoring.\n", __FUNCTION__, id, + "packet, ignoring.\n", __func__, id, le16_to_cpu(((l2cap_cmd_rej *) params)->reason)); break; =20 @@ -837,7 +837,7 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, =20 /* We never issue Connection Requests currently. TODO */ fprintf(stderr, "%s: unexpected Connection Response (%02x) " - "packet, ignoring.\n", __FUNCTION__, id); + "packet, ignoring.\n", __func__, id); break; =20 case L2CAP_CONF_REQ: @@ -866,7 +866,7 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, ((l2cap_conf_rsp *) params)->data, len - L2CAP_CONF_RSP_SIZE(0))) fprintf(stderr, "%s: unexpected Configure Response (%02x) " - "packet, ignoring.\n", __FUNCTION__, id); + "packet, ignoring.\n", __func__, id); break; =20 case L2CAP_DISCONN_REQ: @@ -888,7 +888,7 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, =20 /* We never issue Disconnection Requests currently. TODO */ fprintf(stderr, "%s: unexpected Disconnection Response (%02x) " - "packet, ignoring.\n", __FUNCTION__, id); + "packet, ignoring.\n", __func__, id); break; =20 case L2CAP_ECHO_REQ: @@ -898,7 +898,7 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, case L2CAP_ECHO_RSP: /* We never issue Echo Requests currently. TODO */ fprintf(stderr, "%s: unexpected Echo Response (%02x) " - "packet, ignoring.\n", __FUNCTION__, id); + "packet, ignoring.\n", __func__, id); break; =20 case L2CAP_INFO_REQ: @@ -918,7 +918,7 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, =20 /* We never issue Information Requests currently. TODO */ fprintf(stderr, "%s: unexpected Information Response (%02x) " - "packet, ignoring.\n", __FUNCTION__, id); + "packet, ignoring.\n", __func__, id); break; =20 default: @@ -1067,7 +1067,7 @@ static void l2cap_frame_in(struct l2cap_instance_s *l= 2cap, =20 if (unlikely(cid >=3D L2CAP_CID_MAX || !l2cap->cid[cid])) { fprintf(stderr, "%s: frame addressed to a non-existent L2CAP " - "channel %04x received.\n", __FUNCTION__, cid); + "channel %04x received.\n", __func__, cid); return; } =20 @@ -1129,7 +1129,7 @@ static uint8_t *l2cap_bframe_out(struct bt_l2cap_conn= _params_s *parm, int len) =20 if (len > chan->params.remote_mtu) { fprintf(stderr, "%s: B-Frame for CID %04x longer than %i octets.\n= ", - __FUNCTION__, + __func__, chan->remote_cid, chan->params.remote_mtu); exit(-1); } @@ -1354,7 +1354,7 @@ void bt_l2cap_psm_register(struct bt_l2cap_device_s *= dev, int psm, int min_mtu, =20 if (new_psm) { fprintf(stderr, "%s: PSM %04x already registered for device `%s'.\= n", - __FUNCTION__, psm, dev->device.lmp_name); + __func__, psm, dev->device.lmp_name); exit(-1); } =20 diff --git a/hw/bt/sdp.c b/hw/bt/sdp.c index 3cb60b9..7c0d38b 100644 --- a/hw/bt/sdp.c +++ b/hw/bt/sdp.c @@ -506,7 +506,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uin= t8_t *data, int len) int rsp_len =3D 0; =20 if (len < 5) { - fprintf(stderr, "%s: short SDP PDU (%iB).\n", __FUNCTION__, len); + fprintf(stderr, "%s: short SDP PDU (%iB).\n", __func__, len); return; } =20 @@ -518,7 +518,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uin= t8_t *data, int len) =20 if (len !=3D plen) { fprintf(stderr, "%s: wrong SDP PDU length (%iB !=3D %iB).\n", - __FUNCTION__, plen, len); + __func__, plen, len); err =3D SDP_INVALID_PDU_SIZE; goto respond; } @@ -545,7 +545,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uin= t8_t *data, int len) case SDP_SVC_SEARCH_ATTR_RSP: default: fprintf(stderr, "%s: unexpected SDP PDU ID %02x.\n", - __FUNCTION__, pdu_id); + __func__, pdu_id); err =3D SDP_INVALID_SYNTAX; break; } diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c index cbf07d1..291abe6 100644 --- a/hw/display/blizzard.c +++ b/hw/display/blizzard.c @@ -474,7 +474,7 @@ static uint16_t blizzard_reg_read(void *opaque, uint8_t= reg) return s->gpio_pdown; =20 default: - fprintf(stderr, "%s: unknown register %02x\n", __FUNCTION__, reg); + fprintf(stderr, "%s: unknown register %02x\n", __func__, reg); return 0; } } @@ -502,7 +502,7 @@ static void blizzard_reg_write(void *opaque, uint8_t re= g, uint16_t value) s->pll_mode =3D value & 0x77; if ((value & 3) =3D=3D 0 || (value & 3) =3D=3D 3) fprintf(stderr, "%s: wrong PLL Control bits (%i)\n", - __FUNCTION__, value & 3); + __func__, value & 3); break; =20 case 0x0e: /* Clock-Source Select */ @@ -541,7 +541,7 @@ static void blizzard_reg_write(void *opaque, uint8_t re= g, uint16_t value) case 0x28: /* LCD Panel Configuration */ s->lcd_config =3D value & 0xff; if (value & (1 << 7)) - fprintf(stderr, "%s: data swap not supported!\n", __FUNCTION__= ); + fprintf(stderr, "%s: data swap not supported!\n", __func__); break; =20 case 0x2a: /* LCD Horizontal Display Width */ @@ -586,7 +586,7 @@ static void blizzard_reg_write(void *opaque, uint8_t re= g, uint16_t value) s->hssi_config[1] =3D value; if (((value >> 4) & 3) =3D=3D 3) fprintf(stderr, "%s: Illegal active-data-links value\n", - __FUNCTION__); + __func__); break; case 0x42: /* High-speed Serial Interface Tx Mode */ s->hssi_config[2] =3D value & 0xbd; @@ -641,7 +641,7 @@ static void blizzard_reg_write(void *opaque, uint8_t re= g, uint16_t value) s->enable =3D value & 1; s->blank =3D (value >> 1) & 1; if (value & (1 << 4)) - fprintf(stderr, "%s: Macrovision enable attempt!\n", __FUNCTIO= N__); + fprintf(stderr, "%s: Macrovision enable attempt!\n", __func__); break; =20 case 0x6a: /* Special Effects */ @@ -718,7 +718,7 @@ static void blizzard_reg_write(void *opaque, uint8_t re= g, uint16_t value) s->bpp =3D blizzard_iformat_bpp[s->iformat]; if (!s->bpp) fprintf(stderr, "%s: Illegal or unsupported input format %x\n", - __FUNCTION__, s->iformat); + __func__, s->iformat); break; case 0x8e: /* Data Source Select */ s->source =3D value & 7; @@ -730,7 +730,7 @@ static void blizzard_reg_write(void *opaque, uint8_t re= g, uint16_t value) !((s->ix[1] - s->ix[0]) & (s->iy[1] - s->iy[0]) & (s->ox[1] - s->ox[0]) & (s->oy[1] - s->oy[0]) & = 1)) fprintf(stderr, "%s: Illegal input/output window positions\n", - __FUNCTION__); + __func__); =20 blizzard_transfer_setup(s); break; @@ -784,7 +784,7 @@ static void blizzard_reg_write(void *opaque, uint8_t re= g, uint16_t value) s->pm =3D value & 0x83; if (value & s->mode & 1) fprintf(stderr, "%s: The display must be disabled before enter= ing " - "Standby Mode\n", __FUNCTION__); + "Standby Mode\n", __func__); break; case 0xe8: /* Non-display Period Control / Status */ s->status =3D value & 0x1b; @@ -815,7 +815,7 @@ static void blizzard_reg_write(void *opaque, uint8_t re= g, uint16_t value) break; =20 default: - fprintf(stderr, "%s: unknown register %02x\n", __FUNCTION__, reg); + fprintf(stderr, "%s: unknown register %02x\n", __func__, reg); break; } } diff --git a/hw/display/omap_dss.c b/hw/display/omap_dss.c index 783e9e1..601f178 100644 --- a/hw/display/omap_dss.c +++ b/hw/display/omap_dss.c @@ -526,7 +526,7 @@ static void omap_disc_write(void *opaque, hwaddr addr, s->dispc.l[0].attr =3D value & 0x7ff; if (value & (3 << 9)) fprintf(stderr, "%s: Big-endian pixel format not supported\n", - __FUNCTION__); + __func__); s->dispc.l[0].enable =3D value & 1; s->dispc.l[0].bpp =3D (value >> 1) & 0xf; s->dispc.invalidate =3D 1; @@ -617,7 +617,7 @@ static void omap_rfbi_transfer_start(struct omap_dss_s = *s) if (s->rfbi.control & (1 << 1)) { /* BYPASS */ /* TODO: in non-Bypass mode we probably need to just assert the * DRQ and wait for DMA to write the pixels. */ - fprintf(stderr, "%s: Bypass mode unimplemented\n", __FUNCTION__); + fprintf(stderr, "%s: Bypass mode unimplemented\n", __func__); return; } =20 @@ -1086,6 +1086,6 @@ struct omap_dss_s *omap_dss_init(struct omap_target_a= gent_s *ta, void omap_rfbi_attach(struct omap_dss_s *s, int cs, struct rfbi_chip_s *ch= ip) { if (cs < 0 || cs > 1) - hw_error("%s: wrong CS %i\n", __FUNCTION__, cs); + hw_error("%s: wrong CS %i\n", __func__, cs); s->rfbi.chip[cs] =3D chip; } diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c index 845521c..b83f807 100644 --- a/hw/display/pxa2xx_lcd.c +++ b/hw/display/pxa2xx_lcd.c @@ -405,7 +405,7 @@ static uint64_t pxa2xx_lcdc_read(void *opaque, hwaddr o= ffset, =20 default: fail: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } =20 return 0; @@ -424,7 +424,7 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offs= et, s->status[0] |=3D LCSR0_QD; =20 if (!(s->control[0] & LCCR0_LCDT) && (value & LCCR0_LCDT)) - printf("%s: internal frame buffer unsupported\n", __FUNCTION__= ); + printf("%s: internal frame buffer unsupported\n", __func__); =20 if ((s->control[3] & LCCR3_API) && (value & LCCR0_ENB) && !(value & LCCR0_LCDT)) @@ -460,7 +460,7 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offs= et, =20 case OVL1C1: if (!(s->ovl1c[0] & OVLC1_EN) && (value & OVLC1_EN)) - printf("%s: Overlay 1 not supported\n", __FUNCTION__); + printf("%s: Overlay 1 not supported\n", __func__); =20 s->ovl1c[0] =3D value & 0x80ffffff; s->dma_ch[1].up =3D (value & OVLC1_EN) || (s->control[0] & LCCR0_S= DS); @@ -472,7 +472,7 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offs= et, =20 case OVL2C1: if (!(s->ovl2c[0] & OVLC1_EN) && (value & OVLC1_EN)) - printf("%s: Overlay 2 not supported\n", __FUNCTION__); + printf("%s: Overlay 2 not supported\n", __func__); =20 s->ovl2c[0] =3D value & 0x80ffffff; s->dma_ch[2].up =3D !!(value & OVLC1_EN); @@ -486,7 +486,7 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offs= et, =20 case CCR: if (!(s->ccr & CCR_CEN) && (value & CCR_CEN)) - printf("%s: Hardware cursor unimplemented\n", __FUNCTION__); + printf("%s: Hardware cursor unimplemented\n", __func__); =20 s->ccr =3D value & 0x81ffffe7; s->dma_ch[5].up =3D !!(value & CCR_CEN); @@ -560,7 +560,7 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offs= et, =20 default: fail: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } } =20 @@ -1050,7 +1050,7 @@ PXA2xxLCDState *pxa2xx_lcdc_init(MemoryRegion *sysmem, s->dest_width =3D 4; break; default: - fprintf(stderr, "%s: Bad color depth\n", __FUNCTION__); + fprintf(stderr, "%s: Bad color depth\n", __func__); exit(1); } =20 diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c index 90e0865..e7ac4f8 100644 --- a/hw/display/qxl-render.c +++ b/hw/display/qxl-render.c @@ -78,7 +78,7 @@ void qxl_render_resize(PCIQXLDevice *qxl) qxl->guest_primary.bits_pp =3D 32; break; default: - fprintf(stderr, "%s: unhandled format: %x\n", __FUNCTION__, + fprintf(stderr, "%s: unhandled format: %x\n", __func__, qxl->guest_primary.surface.format); qxl->guest_primary.bytes_pp =3D 4; qxl->guest_primary.bits_pp =3D 32; @@ -248,7 +248,7 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCur= sor *cursor, break; default: fprintf(stderr, "%s: not implemented: type %d\n", - __FUNCTION__, cursor->header.type); + __func__, cursor->header.type); goto fail; } return c; @@ -275,7 +275,7 @@ int qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt = *ext) } =20 if (qxl->debug > 1 && cmd->type !=3D QXL_CURSOR_MOVE) { - fprintf(stderr, "%s", __FUNCTION__); + fprintf(stderr, "%s", __func__); qxl_log_cmd_cursor(qxl, cmd, ext->group_id); fprintf(stderr, "\n"); } diff --git a/hw/display/qxl.h b/hw/display/qxl.h index 8668a8e..089696e 100644 --- a/hw/display/qxl.h +++ b/hw/display/qxl.h @@ -132,7 +132,7 @@ typedef struct PCIQXLDevice { #define PCI_QXL(obj) OBJECT_CHECK(PCIQXLDevice, (obj), TYPE_PCI_QXL) =20 #define PANIC_ON(x) if ((x)) { \ - printf("%s: PANIC %s failed\n", __FUNCTION__, #x); \ + printf("%s: PANIC %s failed\n", __func__, #x); \ abort(); \ } =20 diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c index 0ae6360..464465b 100644 --- a/hw/display/tc6393xb.c +++ b/hw/display/tc6393xb.c @@ -148,7 +148,7 @@ static void tc6393xb_gpio_set(void *opaque, int line, i= nt level) // TC6393xbState *s =3D opaque; =20 if (line > TC6393XB_GPIOS) { - printf("%s: No GPIO pin %i\n", __FUNCTION__, line); + printf("%s: No GPIO pin %i\n", __func__, line); return; } =20 diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index d4fc0fa..f5afcc0 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -662,7 +662,7 @@ static void xenfb_guest_copy(struct XenFB *xenfb, int x= , int y, int w, int h) } if (oops) /* should not happen */ xen_pv_printf(&xenfb->c.xendev, 0, "%s: oops: convert %d -> %d bpp= ?\n", - __FUNCTION__, xenfb->depth, bpp); + __func__, xenfb->depth, bpp); =20 dpy_gfx_update(xenfb->con, x, y, w, h); } diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 45dfe7a..abd18c6 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -161,7 +161,7 @@ static void omap_dma_channel_load(struct omap_dma_chann= el_s *ch) a->pck_element =3D 0; =20 if (unlikely(!ch->elements || !ch->frames)) { - printf("%s: bad DMA request\n", __FUNCTION__); + printf("%s: bad DMA request\n", __func__); return; } =20 @@ -519,7 +519,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s= *dma) continue; #endif printf("%s: Bus time-out in DMA%i operation\n", - __FUNCTION__, dma->num); + __func__, dma->num); } =20 min_elems =3D INT_MAX; @@ -879,14 +879,14 @@ static int omap_dma_ch_reg_write(struct omap_dma_s *s, ch->pack[0] =3D (value & 0x0040) >> 6; ch->port[0] =3D (enum omap_dma_port) ((value & 0x003c) >> 2); if (ch->port[0] >=3D __omap_dma_port_last) - printf("%s: invalid DMA port %i\n", __FUNCTION__, + printf("%s: invalid DMA port %i\n", __func__, ch->port[0]); if (ch->port[1] >=3D __omap_dma_port_last) - printf("%s: invalid DMA port %i\n", __FUNCTION__, + printf("%s: invalid DMA port %i\n", __func__, ch->port[1]); ch->data_type =3D 1 << (value & 3); if ((value & 3) =3D=3D 3) { - printf("%s: bad data_type for DMA channel\n", __FUNCTION__); + printf("%s: bad data_type for DMA channel\n", __func__); ch->data_type >>=3D 1; } break; @@ -1440,7 +1440,7 @@ static int omap_dma_sys_read(struct omap_dma_s *s, in= t offset, case 0x482: /* DMA_PCh1_SR */ case 0x4c0: /* DMA_PChD_SR_0 */ printf("%s: Physical Channel Status Registers not implemented.\n", - __FUNCTION__); + __func__); *ret =3D 0xff; break; =20 @@ -1898,13 +1898,13 @@ static void omap_dma4_write(void *opaque, hwaddr ad= dr, omap_dma_reset(s->dma); s->ocp =3D value & 0x3321; if (((s->ocp >> 12) & 3) =3D=3D 3) /* MIDLEMODE */ - fprintf(stderr, "%s: invalid DMA power mode\n", __FUNCTION__); + fprintf(stderr, "%s: invalid DMA power mode\n", __func__); return; =20 case 0x78: /* DMA4_GCR */ s->gcr =3D value & 0x00ff00ff; if ((value & 0xff) =3D=3D 0x00) /* MAX_CHANNEL_FIFO_DEPTH */ - fprintf(stderr, "%s: wrong FIFO depth in GCR\n", __FUNCTION__); + fprintf(stderr, "%s: wrong FIFO depth in GCR\n", __func__); return; =20 case 0x80 ... 0xfff: @@ -1935,7 +1935,7 @@ static void omap_dma4_write(void *opaque, hwaddr addr, ch->src_sync =3D (value >> 24) & 1; /* XXX For CamDMA must be 1 */ if (ch->buf_disable && !ch->src_sync) fprintf(stderr, "%s: Buffering disable is not allowed in " - "destination synchronised mode\n", __FUNCTION_= _); + "destination synchronised mode\n", __func__); ch->prefetch =3D (value >> 23) & 1; ch->bs =3D (value >> 18) & 1; ch->transparent_copy =3D (value >> 17) & 1; @@ -1947,7 +1947,7 @@ static void omap_dma4_write(void *opaque, hwaddr addr, ch->fs =3D (value & 0x0020) >> 5; if (ch->fs && ch->bs && ch->mode[0] && ch->mode[1]) fprintf(stderr, "%s: For a packet transfer at least one port " - "must be constant-addressed\n", __FUNCTION__); + "must be constant-addressed\n", __func__); ch->sync =3D (value & 0x001f) | ((value >> 14) & 0x0060); /* XXX must be 0x01 for CamDMA */ =20 @@ -1978,7 +1978,7 @@ static void omap_dma4_write(void *opaque, hwaddr addr, ch->endian_lock[1] =3D(value >> 18) & 1; if (ch->endian[0] !=3D ch->endian[1]) fprintf(stderr, "%s: DMA endianness conversion enable attempt\= n", - __FUNCTION__); + __func__); ch->write_mode =3D (value >> 16) & 3; ch->burst[1] =3D (value & 0xc000) >> 14; ch->pack[1] =3D (value & 0x2000) >> 13; @@ -1988,10 +1988,10 @@ static void omap_dma4_write(void *opaque, hwaddr ad= dr, ch->translate[0] =3D (value & 0x003c) >> 2; if (ch->translate[0] | ch->translate[1]) fprintf(stderr, "%s: bad MReqAddressTranslate sideband signal\= n", - __FUNCTION__); + __func__); ch->data_type =3D 1 << (value & 3); if ((value & 3) =3D=3D 3) { - printf("%s: bad data_type for DMA channel\n", __FUNCTION__); + printf("%s: bad data_type for DMA channel\n", __func__); ch->data_type >>=3D 1; } break; diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c index 634a432..f4eb26c 100644 --- a/hw/dma/pxa2xx_dma.c +++ b/hw/dma/pxa2xx_dma.c @@ -169,7 +169,7 @@ static inline void pxa2xx_dma_descriptor_fetch( s->chan[ch].dest &=3D ~3; =20 if (s->chan[ch].cmd & (DCMD_CMPEN | DCMD_FLYBYS | DCMD_FLYBYT)) - printf("%s: unsupported mode in channel %i\n", __FUNCTION__, ch); + printf("%s: unsupported mode in channel %i\n", __func__, ch); =20 if (s->chan[ch].cmd & DCMD_STARTIRQEN) s->chan[ch].state |=3D DCSR_STARTINTR; @@ -264,7 +264,7 @@ static uint64_t pxa2xx_dma_read(void *opaque, hwaddr of= fset, unsigned int channel; =20 if (size !=3D 4) { - hw_error("%s: Bad access width\n", __FUNCTION__); + hw_error("%s: Bad access width\n", __func__); return 5; } =20 @@ -312,7 +312,7 @@ static uint64_t pxa2xx_dma_read(void *opaque, hwaddr of= fset, } } =20 - hw_error("%s: Bad offset 0x" TARGET_FMT_plx "\n", __FUNCTION__, offset= ); + hw_error("%s: Bad offset 0x" TARGET_FMT_plx "\n", __func__, offset); return 7; } =20 @@ -323,7 +323,7 @@ static void pxa2xx_dma_write(void *opaque, hwaddr offse= t, unsigned int channel; =20 if (size !=3D 4) { - hw_error("%s: Bad access width\n", __FUNCTION__); + hw_error("%s: Bad access width\n", __func__); return; } =20 @@ -337,7 +337,7 @@ static void pxa2xx_dma_write(void *opaque, hwaddr offse= t, if (value & DRCMR_MAPVLD) if ((value & DRCMR_CHLNUM) > s->channels) hw_error("%s: Bad DMA channel %i\n", - __FUNCTION__, (unsigned)value & DRCMR_CHLNUM); + __func__, (unsigned)value & DRCMR_CHLNUM); =20 s->req[channel] =3D value; break; @@ -416,7 +416,7 @@ static void pxa2xx_dma_write(void *opaque, hwaddr offse= t, break; } fail: - hw_error("%s: Bad offset " TARGET_FMT_plx "\n", __FUNCTION__, offs= et); + hw_error("%s: Bad offset " TARGET_FMT_plx "\n", __func__, offset); } } =20 @@ -431,7 +431,7 @@ static void pxa2xx_dma_request(void *opaque, int req_nu= m, int on) PXA2xxDMAState *s =3D opaque; int ch; if (req_num < 0 || req_num >=3D PXA2XX_DMA_NUM_REQUESTS) - hw_error("%s: Bad DMA request %i\n", __FUNCTION__, req_num); + hw_error("%s: Bad DMA request %i\n", __func__, req_num); =20 if (!(s->req[req_num] & DRCMR_MAPVLD)) return; diff --git a/hw/gpio/max7310.c b/hw/gpio/max7310.c index f82e3e6..4c203ef 100644 --- a/hw/gpio/max7310.c +++ b/hw/gpio/max7310.c @@ -67,7 +67,7 @@ static int max7310_rx(I2CSlave *i2c) =20 default: #ifdef VERBOSE - printf("%s: unknown register %02x\n", __FUNCTION__, s->command); + printf("%s: unknown register %02x\n", __func__, s->command); #endif break; } @@ -82,7 +82,7 @@ static int max7310_tx(I2CSlave *i2c, uint8_t data) =20 if (s->len ++ > 1) { #ifdef VERBOSE - printf("%s: message too long (%i bytes)\n", __FUNCTION__, s->len); + printf("%s: message too long (%i bytes)\n", __func__, s->len); #endif return 1; } @@ -121,7 +121,7 @@ static int max7310_tx(I2CSlave *i2c, uint8_t data) break; default: #ifdef VERBOSE - printf("%s: unknown register %02x\n", __FUNCTION__, s->command); + printf("%s: unknown register %02x\n", __func__, s->command); #endif return 1; } @@ -141,7 +141,7 @@ static int max7310_event(I2CSlave *i2c, enum i2c_event = event) case I2C_FINISH: #ifdef VERBOSE if (s->len =3D=3D 1) - printf("%s: message too short (%i bytes)\n", __FUNCTION__, s->= len); + printf("%s: message too short (%i bytes)\n", __func__, s->len); #endif break; default: diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c index 17891e2..0847219 100644 --- a/hw/gpio/omap_gpio.c +++ b/hw/gpio/omap_gpio.c @@ -399,7 +399,7 @@ static void omap2_gpio_module_write(void *opaque, hwadd= r addr, =20 case 0x10: /* GPIO_SYSCONFIG */ if (((value >> 3) & 3) =3D=3D 3) - fprintf(stderr, "%s: bad IDLEMODE value\n", __FUNCTION__); + fprintf(stderr, "%s: bad IDLEMODE value\n", __func__); if (value & 2) omap2_gpio_module_reset(s); s->config[0] =3D value & 0x1d; diff --git a/hw/i2c/omap_i2c.c b/hw/i2c/omap_i2c.c index 12264ee..26e3e5e 100644 --- a/hw/i2c/omap_i2c.c +++ b/hw/i2c/omap_i2c.c @@ -341,12 +341,12 @@ static void omap_i2c_write(void *opaque, hwaddr addr, } if ((value & (1 << 15)) && !(value & (1 << 10))) { /* MST */ fprintf(stderr, "%s: I^2C slave mode not supported\n", - __FUNCTION__); + __func__); break; } if ((value & (1 << 15)) && value & (1 << 8)) { /* XA */ fprintf(stderr, "%s: 10-bit addressing mode not supported\n", - __FUNCTION__); + __func__); break; } if ((value & (1 << 15)) && value & (1 << 0)) { /* STT */ @@ -393,7 +393,7 @@ static void omap_i2c_write(void *opaque, hwaddr addr, omap_i2c_interrupts_update(s); } if (value & (1 << 15)) /* ST_EN */ - fprintf(stderr, "%s: System Test not supported\n", __FUNCTION_= _); + fprintf(stderr, "%s: System Test not supported\n", __func__); break; =20 default: diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 451b18b..e22d7be 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1052,7 +1052,7 @@ static void process_ncq_command(AHCIState *s, int por= t, uint8_t *cmd_fis, g_assert(is_ncq(ncq_fis->command)); if (ncq_tfs->used) { /* error - already in use */ - fprintf(stderr, "%s: tag %d already used\n", __FUNCTION__, tag); + fprintf(stderr, "%s: tag %d already used\n", __func__, tag); return; } =20 diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c index fde4d46..58e4f52 100644 --- a/hw/ide/microdrive.c +++ b/hw/ide/microdrive.c @@ -155,7 +155,7 @@ static uint8_t md_attr_read(PCMCIACardState *card, uint= 32_t at) return 0x00; #ifdef VERBOSE default: - printf("%s: Bad attribute space register %02x\n", __FUNCTION__, at= ); + printf("%s: Bad attribute space register %02x\n", __func__, at); #endif } =20 @@ -192,7 +192,7 @@ static void md_attr_write(PCMCIACardState *card, uint32= _t at, uint8_t value) case 0x06: /* Socket and Copy Register */ break; default: - printf("%s: Bad attribute space register %02x\n", __FUNCTION__, at= ); + printf("%s: Bad attribute space register %02x\n", __func__, at); } } =20 diff --git a/hw/input/lm832x.c b/hw/input/lm832x.c index 2340523..d399531 100644 --- a/hw/input/lm832x.c +++ b/hw/input/lm832x.c @@ -239,7 +239,7 @@ static uint8_t lm_kbd_read(LM823KbdState *s, int reg, i= nt byte) =20 default: lm_kbd_error(s, ERR_CMDUNK); - fprintf(stderr, "%s: unknown command %02x\n", __FUNCTION__, reg); + fprintf(stderr, "%s: unknown command %02x\n", __func__, reg); return 0x00; } =20 @@ -331,7 +331,7 @@ static void lm_kbd_write(LM823KbdState *s, int reg, int= byte, uint8_t value) if ((value & 3) && (value & 3) !=3D 3) { lm_kbd_error(s, ERR_BADPAR); fprintf(stderr, "%s: invalid clock setting in RCPWM\n", - __FUNCTION__); + __func__); } /* TODO: Validate that the command is only issued once */ break; @@ -378,7 +378,7 @@ static void lm_kbd_write(LM823KbdState *s, int reg, int= byte, uint8_t value) break; default: lm_kbd_error(s, ERR_CMDUNK); - fprintf(stderr, "%s: unknown command %02x\n", __FUNCTION__, reg); + fprintf(stderr, "%s: unknown command %02x\n", __func__, reg); break; } } diff --git a/hw/input/pxa2xx_keypad.c b/hw/input/pxa2xx_keypad.c index 2b70bbb..93db9ed 100644 --- a/hw/input/pxa2xx_keypad.c +++ b/hw/input/pxa2xx_keypad.c @@ -231,7 +231,7 @@ static uint64_t pxa2xx_keypad_read(void *opaque, hwaddr= offset, return s->kpkdi; break; default: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } =20 return 0; @@ -278,7 +278,7 @@ static void pxa2xx_keypad_write(void *opaque, hwaddr of= fset, break; =20 default: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } } =20 @@ -326,7 +326,7 @@ void pxa27x_register_keypad(PXA2xxKeyPadState *kp, const struct keymap *map, int size) { if(!map || size < 0x80) { - fprintf(stderr, "%s - No PXA keypad map defined\n", __FUNCTION__); + fprintf(stderr, "%s - No PXA keypad map defined\n", __func__); exit(-1); } =20 diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c index eb5320a..7990954 100644 --- a/hw/input/tsc2005.c +++ b/hw/input/tsc2005.c @@ -201,7 +201,7 @@ static void tsc2005_write(TSC2005State *s, int reg, uin= t16_t data) if (s->enabled !=3D !(data & 0x4000)) { s->enabled =3D !(data & 0x4000); fprintf(stderr, "%s: touchscreen sense %sabled\n", - __FUNCTION__, s->enabled ? "en" : "dis"); + __func__, s->enabled ? "en" : "dis"); if (s->busy && !s->enabled) timer_del(s->timer); s->busy =3D s->busy && s->enabled; @@ -210,7 +210,7 @@ static void tsc2005_write(TSC2005State *s, int reg, uin= t16_t data) s->timing[0] =3D data & 0x1fff; if ((s->timing[0] >> 11) =3D=3D 3) fprintf(stderr, "%s: illegal conversion clock setting\n", - __FUNCTION__); + __func__); break; case 0xd: /* CFR1 */ s->timing[1] =3D data & 0xf07; @@ -222,7 +222,7 @@ static void tsc2005_write(TSC2005State *s, int reg, uin= t16_t data) =20 default: fprintf(stderr, "%s: write into read-only register %x\n", - __FUNCTION__, reg); + __func__, reg); } } =20 @@ -338,7 +338,7 @@ static uint8_t tsc2005_txrx_word(void *opaque, uint8_t = value) if (s->enabled !=3D !(value & 1)) { s->enabled =3D !(value & 1); fprintf(stderr, "%s: touchscreen sense %sabled\n", - __FUNCTION__, s->enabled ? "en" : "dis= "); + __func__, s->enabled ? "en" : "dis"); if (s->busy && !s->enabled) timer_del(s->timer); s->busy =3D s->busy && s->enabled; diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c index 75ac8c2..1cad57f 100644 --- a/hw/input/tsc210x.c +++ b/hw/input/tsc210x.c @@ -287,7 +287,7 @@ static void tsc2102_audio_rate_update(TSC210xState *s) rate->fsref =3D=3D ((s->audio_ctrl3 >> 13) & 1))/*= REFFS */ break; if (!rate->rate) { - printf("%s: unknown sampling rate configured\n", __FUNCTION__); + printf("%s: unknown sampling rate configured\n", __func__); return; } =20 @@ -913,7 +913,7 @@ uint32_t tsc210x_txrx(void *opaque, uint32_t value, int= len) uint32_t ret =3D 0; =20 if (len !=3D 16) - hw_error("%s: FIXME: bad SPI word width %i\n", __FUNCTION__, len); + hw_error("%s: FIXME: bad SPI word width %i\n", __func__, len); =20 /* TODO: sequential reads etc - how do we make sure the host doesn't * unintentionally read out a conversion result from a register while diff --git a/hw/intc/omap_intc.c b/hw/intc/omap_intc.c index ccdda89..6844c1a 100644 --- a/hw/intc/omap_intc.c +++ b/hw/intc/omap_intc.c @@ -540,7 +540,7 @@ static void omap2_inth_write(void *opaque, hwaddr addr, * for every register, see Chapter 3 and 4 for privileged mode. */ if (value & 1) fprintf(stderr, "%s: protection mode enable attempt\n", - __FUNCTION__); + __func__); return; =20 case 0x50: /* INTC_IDLE */ diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 4084b32..070cc18 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -29,7 +29,7 @@ //#define DEBUG_VT82C686B =20 #ifdef DEBUG_VT82C686B -#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA= _ARGS__) +#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __func__, ##__VA_ARG= S__) #else #define DPRINTF(fmt, ...) #endif diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c index a9c222a..24ad0ad 100644 --- a/hw/mips/gt64xxx_pci.c +++ b/hw/mips/gt64xxx_pci.c @@ -33,7 +33,7 @@ //#define DEBUG =20 #ifdef DEBUG -#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA= _ARGS__) +#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __func__, ##__VA_ARG= S__) #else #define DPRINTF(fmt, ...) #endif diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c index 677274c..25e337e 100644 --- a/hw/misc/cbus.c +++ b/hw/misc/cbus.c @@ -62,7 +62,7 @@ static void cbus_io(CBusPriv *s) s->slave[s->addr]->io(s->slave[s->addr]->opaque, s->rw, s->reg, &s->val); else - hw_error("%s: bad slave address %i\n", __FUNCTION__, s->addr); + hw_error("%s: bad slave address %i\n", __func__, s->addr); } =20 static void cbus_cycle(CBusPriv *s) @@ -299,7 +299,7 @@ static inline uint16_t retu_read(CBusRetu *s, int reg) return 0x0000; =20 default: - hw_error("%s: bad register %02x\n", __FUNCTION__, reg); + hw_error("%s: bad register %02x\n", __func__, reg); } } =20 @@ -372,7 +372,7 @@ static inline void retu_write(CBusRetu *s, int reg, uin= t16_t val) break; =20 default: - hw_error("%s: bad register %02x\n", __FUNCTION__, reg); + hw_error("%s: bad register %02x\n", __func__, reg); } } =20 @@ -538,7 +538,7 @@ static inline uint16_t tahvo_read(CBusTahvo *s, int reg) return 0x0000; =20 default: - hw_error("%s: bad register %02x\n", __FUNCTION__, reg); + hw_error("%s: bad register %02x\n", __func__, reg); } } =20 @@ -567,7 +567,7 @@ static inline void tahvo_write(CBusTahvo *s, int reg, u= int16_t val) if (s->backlight !=3D (val & 0x7f)) { s->backlight =3D val & 0x7f; printf("%s: LCD backlight now at %i / 127\n", - __FUNCTION__, s->backlight); + __func__, s->backlight); } break; =20 @@ -588,7 +588,7 @@ static inline void tahvo_write(CBusTahvo *s, int reg, u= int16_t val) break; =20 default: - hw_error("%s: bad register %02x\n", __FUNCTION__, reg); + hw_error("%s: bad register %02x\n", __func__, reg); } } =20 diff --git a/hw/misc/omap_clk.c b/hw/misc/omap_clk.c index 19151d0..9ea1418 100644 --- a/hw/misc/omap_clk.c +++ b/hw/misc/omap_clk.c @@ -1109,7 +1109,7 @@ struct clk *omap_findclk(struct omap_mpu_state_s *mpu= , const char *name) for (i =3D mpu->clks; i->name; i ++) if (!strcmp(i->name, name) || (i->alias && !strcmp(i->alias, name)= )) return i; - hw_error("%s: %s not found\n", __FUNCTION__, name); + hw_error("%s: %s not found\n", __func__, name); } =20 void omap_clk_get(struct clk *clk) @@ -1120,7 +1120,7 @@ void omap_clk_get(struct clk *clk) void omap_clk_put(struct clk *clk) { if (!(clk->usecount --)) - hw_error("%s: %s is not in use\n", __FUNCTION__, clk->name); + hw_error("%s: %s is not in use\n", __func__, clk->name); } =20 static void omap_clk_update(struct clk *clk) diff --git a/hw/misc/omap_gpmc.c b/hw/misc/omap_gpmc.c index 67d8e2f..84f9e4c 100644 --- a/hw/misc/omap_gpmc.c +++ b/hw/misc/omap_gpmc.c @@ -643,7 +643,7 @@ static void omap_gpmc_write(void *opaque, hwaddr addr, case 0x010: /* GPMC_SYSCONFIG */ if ((value >> 3) =3D=3D 0x3) fprintf(stderr, "%s: bad SDRAM idle mode %"PRIi64"\n", - __FUNCTION__, value >> 3); + __func__, value >> 3); if (value & 2) omap_gpmc_reset(s); s->sysconfig =3D value & 0x19; @@ -806,7 +806,7 @@ static void omap_gpmc_write(void *opaque, hwaddr addr, break; case 0x230: /* GPMC_TESTMODE_CTRL */ if (value & 7) - fprintf(stderr, "%s: test mode enable attempt\n", __FUNCTION__= ); + fprintf(stderr, "%s: test mode enable attempt\n", __func__); break; =20 default: @@ -864,7 +864,7 @@ void omap_gpmc_attach(struct omap_gpmc_s *s, int cs, Me= moryRegion *iomem) assert(iomem); =20 if (cs < 0 || cs >=3D 8) { - fprintf(stderr, "%s: bad chip-select %i\n", __FUNCTION__, cs); + fprintf(stderr, "%s: bad chip-select %i\n", __func__, cs); exit(-1); } f =3D &s->cs_file[cs]; diff --git a/hw/misc/omap_l4.c b/hw/misc/omap_l4.c index 88c533a..96fc057 100644 --- a/hw/misc/omap_l4.c +++ b/hw/misc/omap_l4.c @@ -126,7 +126,7 @@ struct omap_target_agent_s *omap_l4ta_get(struct omap_l= 4_s *bus, break; } if (!ta) { - fprintf(stderr, "%s: bad target agent (%i)\n", __FUNCTION__, cs); + fprintf(stderr, "%s: bad target agent (%i)\n", __func__, cs); exit(-1); } =20 @@ -151,7 +151,7 @@ hwaddr omap_l4_attach(struct omap_target_agent_s *ta, hwaddr base; =20 if (region < 0 || region >=3D ta->regions) { - fprintf(stderr, "%s: bad io region (%i)\n", __FUNCTION__, region); + fprintf(stderr, "%s: bad io region (%i)\n", __func__, region); exit(-1); } =20 diff --git a/hw/misc/omap_sdrc.c b/hw/misc/omap_sdrc.c index dff37ec..7b38c55 100644 --- a/hw/misc/omap_sdrc.c +++ b/hw/misc/omap_sdrc.c @@ -109,7 +109,7 @@ static void omap_sdrc_write(void *opaque, hwaddr addr, case 0x10: /* SDRC_SYSCONFIG */ if ((value >> 3) !=3D 0x2) fprintf(stderr, "%s: bad SDRAM idle mode %i\n", - __FUNCTION__, (unsigned)value >> 3); + __func__, (unsigned)value >> 3); if (value & 2) omap_sdrc_reset(s); s->config =3D value & 0x18; diff --git a/hw/misc/omap_tap.c b/hw/misc/omap_tap.c index e6ea8ee..3f595e8 100644 --- a/hw/misc/omap_tap.c +++ b/hw/misc/omap_tap.c @@ -44,7 +44,7 @@ static uint64_t omap_tap_read(void *opaque, hwaddr addr, case omap3430: return 0x1b7ae02f; /* ES 2 */ default: - hw_error("%s: Bad mpu model\n", __FUNCTION__); + hw_error("%s: Bad mpu model\n", __func__); } =20 case 0x208: /* PRODUCTION_ID_reg for OMAP2 */ @@ -61,7 +61,7 @@ static uint64_t omap_tap_read(void *opaque, hwaddr addr, case omap3430: return 0x000000f0; default: - hw_error("%s: Bad mpu model\n", __FUNCTION__); + hw_error("%s: Bad mpu model\n", __func__); } =20 case 0x20c: @@ -75,7 +75,7 @@ static uint64_t omap_tap_read(void *opaque, hwaddr addr, case omap3430: return 0xcafeb7ae; /* ES 2 */ default: - hw_error("%s: Bad mpu model\n", __FUNCTION__); + hw_error("%s: Bad mpu model\n", __func__); } =20 case 0x218: /* DIE_ID_reg */ diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c index 04e8378..9e22d64 100644 --- a/hw/misc/tmp105.c +++ b/hw/misc/tmp105.c @@ -131,7 +131,7 @@ static void tmp105_write(TMP105State *s) =20 case TMP105_REG_CONFIG: if (s->buf[0] & ~s->config & (1 << 0)) /* SD */ - printf("%s: TMP105 shutdown\n", __FUNCTION__); + printf("%s: TMP105 shutdown\n", __func__); s->config =3D s->buf[0]; s->faults =3D tmp105_faultq[(s->config >> 3) & 3]; /* F */ tmp105_alarm_update(s); diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index f08593f..0d8cacb 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -50,7 +50,7 @@ //#define DEBUG_BONITO =20 #ifdef DEBUG_BONITO -#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA= _ARGS__) +#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __func__, ##__VA_ARG= S__) #else #define DPRINTF(fmt, ...) #endif diff --git a/hw/ssi/omap_spi.c b/hw/ssi/omap_spi.c index 2203465..34163e5 100644 --- a/hw/ssi/omap_spi.c +++ b/hw/ssi/omap_spi.c @@ -295,10 +295,10 @@ static void omap_mcspi_write(void *opaque, hwaddr add= r, if ((value ^ s->ch[ch].config) & (3 << 14)) /* DMAR | DMAW */ omap_mcspi_dmarequest_update(s->ch + ch); if (((value >> 12) & 3) =3D=3D 3) /* TRM */ - fprintf(stderr, "%s: invalid TRM value (3)\n", __FUNCTION__); + fprintf(stderr, "%s: invalid TRM value (3)\n", __func__); if (((value >> 7) & 0x1f) < 3) /* WL */ fprintf(stderr, "%s: invalid WL value (%" PRIx64 ")\n", - __FUNCTION__, (value >> 7) & 0x1f); + __func__, (value >> 7) & 0x1f); s->ch[ch].config =3D value & 0x7fffff; break; =20 @@ -367,7 +367,7 @@ void omap_mcspi_attach(struct omap_mcspi_s *s, int chipselect) { if (chipselect < 0 || chipselect >=3D s->chnum) - hw_error("%s: Bad chipselect %i\n", __FUNCTION__, chipselect); + hw_error("%s: Bad chipselect %i\n", __func__, chipselect); =20 s->ch[chipselect].txrx =3D txrx; s->ch[chipselect].opaque =3D opaque; diff --git a/hw/timer/omap_gptimer.c b/hw/timer/omap_gptimer.c index 6d7c8a3..ae2dc99 100644 --- a/hw/timer/omap_gptimer.c +++ b/hw/timer/omap_gptimer.c @@ -357,7 +357,7 @@ static void omap_gp_timer_write(void *opaque, hwaddr ad= dr, s->config =3D value & 0x33d; if (((value >> 3) & 3) =3D=3D 3) /* IDLEMODE */ fprintf(stderr, "%s: illegal IDLEMODE value in TIOCP_CFG\n", - __FUNCTION__); + __func__); if (value & 2) /* SOFTRESET */ omap_gp_timer_reset(s); break; @@ -395,10 +395,10 @@ static void omap_gp_timer_write(void *opaque, hwaddr = addr, s->st =3D (value >> 0) & 1; if (s->inout && s->trigger !=3D gpt_trigger_none) fprintf(stderr, "%s: GP timer pin must be an output " - "for this trigger mode\n", __FUNCTION__); + "for this trigger mode\n", __func__); if (!s->inout && s->capture !=3D gpt_capture_none) fprintf(stderr, "%s: GP timer pin must be an input " - "for this capture mode\n", __FUNCTION__); + "for this capture mode\n", __func__); if (s->trigger =3D=3D gpt_trigger_none) omap_gp_timer_out(s, s->scpwm); /* TODO: make sure this doesn't overflow 32-bits */ diff --git a/hw/timer/twl92230.c b/hw/timer/twl92230.c index eb58c37..ef116c6 100644 --- a/hw/timer/twl92230.c +++ b/hw/timer/twl92230.c @@ -403,7 +403,7 @@ static uint8_t menelaus_read(void *opaque, uint8_t addr) =20 default: #ifdef VERBOSE - printf("%s: unknown register %02x\n", __FUNCTION__, addr); + printf("%s: unknown register %02x\n", __func__, addr); #endif break; } @@ -615,7 +615,7 @@ static void menelaus_write(void *opaque, uint8_t addr, = uint8_t value) rtc_badness: default: fprintf(stderr, "%s: bad RTC_UPDATE value %02x\n", - __FUNCTION__, value); + __func__, value); s->status |=3D 1 << 10; /* RTCERR */ menelaus_update(s); } @@ -708,7 +708,7 @@ static void menelaus_write(void *opaque, uint8_t addr, = uint8_t value) =20 default: #ifdef VERBOSE - printf("%s: unknown register %02x\n", __FUNCTION__, addr); + printf("%s: unknown register %02x\n", __func__, addr); #endif } } diff --git a/hw/usb/desc.c b/hw/usb/desc.c index c36bf30..85c15ad 100644 --- a/hw/usb/desc.c +++ b/hw/usb/desc.c @@ -688,7 +688,7 @@ int usb_desc_get_descriptor(USBDevice *dev, USBPacket *= p, break; =20 default: - fprintf(stderr, "%s: %d unknown type %d (len %zd)\n", __FUNCTION__, + fprintf(stderr, "%s: %d unknown type %d (len %zd)\n", __func__, dev->addr, type, len); break; } diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c index 443e3c3..0bbceae 100644 --- a/hw/usb/dev-bluetooth.c +++ b/hw/usb/dev-bluetooth.c @@ -274,13 +274,13 @@ static void usb_bt_fifo_enqueue(struct usb_hci_in_fif= o_s *fifo, if (off <=3D DFIFO_LEN_MASK) { if (off + len > DFIFO_LEN_MASK + 1 && (fifo->dsize =3D off + len) > (DFIFO_LEN_MASK + 1)= * 2) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __FUNCTION__, le= n); + fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); exit(-1); } buf =3D fifo->data + off; } else { if (fifo->dlen > fifo->dsize) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __FUNCTION__, le= n); + fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); exit(-1); } buf =3D fifo->data + off - fifo->dsize; diff --git a/hw/usb/hcd-musb.c b/hw/usb/hcd-musb.c index 27d9d0b..d70a91a 100644 --- a/hw/usb/hcd-musb.c +++ b/hw/usb/hcd-musb.c @@ -253,8 +253,8 @@ /* #define MUSB_DEBUG */ =20 #ifdef MUSB_DEBUG -#define TRACE(fmt,...) fprintf(stderr, "%s@%d: " fmt "\n", __FUNCTION__, \ - __LINE__, ##__VA_ARGS__) +#define TRACE(fmt, ...) fprintf(stderr, "%s@%d: " fmt "\n", __func__, \ + __LINE__, ##__VA_ARGS__) #else #define TRACE(...) #endif diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c index 8f593a6..2662c06 100644 --- a/hw/usb/tusb6010.c +++ b/hw/usb/tusb6010.c @@ -296,7 +296,7 @@ static uint32_t tusb_async_readb(void *opaque, hwaddr a= ddr) } =20 printf("%s: unknown register at %03x\n", - __FUNCTION__, (int) (addr & 0xfff)); + __func__, (int) (addr & 0xfff)); return 0; } =20 @@ -313,7 +313,7 @@ static uint32_t tusb_async_readh(void *opaque, hwaddr a= ddr) } =20 printf("%s: unknown register at %03x\n", - __FUNCTION__, (int) (addr & 0xfff)); + __func__, (int) (addr & 0xfff)); return 0; } =20 @@ -436,7 +436,7 @@ static uint32_t tusb_async_readw(void *opaque, hwaddr a= ddr) return 0x54059adf; } =20 - printf("%s: unknown register at %03x\n", __FUNCTION__, offset); + printf("%s: unknown register at %03x\n", __func__, offset); return 0; } =20 @@ -456,7 +456,7 @@ static void tusb_async_writeb(void *opaque, hwaddr addr, =20 default: printf("%s: unknown register at %03x\n", - __FUNCTION__, (int) (addr & 0xfff)); + __func__, (int) (addr & 0xfff)); return; } } @@ -477,7 +477,7 @@ static void tusb_async_writeh(void *opaque, hwaddr addr, =20 default: printf("%s: unknown register at %03x\n", - __FUNCTION__, (int) (addr & 0xfff)); + __func__, (int) (addr & 0xfff)); return; } } @@ -505,7 +505,7 @@ static void tusb_async_writew(void *opaque, hwaddr addr, s->dev_config =3D value; s->host_mode =3D (value & TUSB_DEV_CONF_USB_HOST_MODE); if (value & TUSB_DEV_CONF_PROD_TEST_MODE) - hw_error("%s: Product Test mode not allowed\n", __FUNCTION__); + hw_error("%s: Product Test mode not allowed\n", __func__); break; =20 case TUSB_PHY_OTG_CTRL_ENABLE: @@ -636,7 +636,7 @@ static void tusb_async_writew(void *opaque, hwaddr addr, break; =20 default: - printf("%s: unknown register at %03x\n", __FUNCTION__, offset); + printf("%s: unknown register at %03x\n", __func__, offset); return; } } diff --git a/hw/xenpv/xen_domainbuild.c b/hw/xenpv/xen_domainbuild.c index c89ced2..027f76f 100644 --- a/hw/xenpv/xen_domainbuild.c +++ b/hw/xenpv/xen_domainbuild.c @@ -25,22 +25,22 @@ static int xenstore_domain_mkdir(char *path) int i; =20 if (!xs_mkdir(xenstore, 0, path)) { - fprintf(stderr, "%s: xs_mkdir %s: failed\n", __FUNCTION__, path); + fprintf(stderr, "%s: xs_mkdir %s: failed\n", __func__, path); return -1; } if (!xs_set_permissions(xenstore, 0, path, perms_ro, 2)) { - fprintf(stderr, "%s: xs_set_permissions failed\n", __FUNCTION__); + fprintf(stderr, "%s: xs_set_permissions failed\n", __func__); return -1; } =20 for (i =3D 0; writable[i]; i++) { snprintf(subpath, sizeof(subpath), "%s/%s", path, writable[i]); if (!xs_mkdir(xenstore, 0, subpath)) { - fprintf(stderr, "%s: xs_mkdir %s: failed\n", __FUNCTION__, sub= path); + fprintf(stderr, "%s: xs_mkdir %s: failed\n", __func__, subpath= ); return -1; } if (!xs_set_permissions(xenstore, 0, subpath, perms_rw, 2)) { - fprintf(stderr, "%s: xs_set_permissions failed\n", __FUNCTION_= _); + fprintf(stderr, "%s: xs_set_permissions failed\n", __func__); return -1; } } @@ -158,7 +158,7 @@ static int xen_domain_watcher(void) char byte; =20 if (pipe(fd) !=3D 0) { - qemu_log("%s: Huh? pipe error: %s\n", __FUNCTION__, strerror(errno= )); + qemu_log("%s: Huh? pipe error: %s\n", __func__, strerror(errno)); return -1; } if (fork() !=3D 0) @@ -190,7 +190,7 @@ static int xen_domain_watcher(void) case -1: if (errno =3D=3D EINTR) continue; - qemu_log("%s: Huh? read error: %s\n", __FUNCTION__, strerror(e= rrno)); + qemu_log("%s: Huh? read error: %s\n", __func__, strerror(errno= )); qemu_running =3D 0; break; case 0: @@ -198,13 +198,13 @@ static int xen_domain_watcher(void) qemu_running =3D 0; break; default: - qemu_log("%s: Huh? data on the watch pipe?\n", __FUNCTION__); + qemu_log("%s: Huh? data on the watch pipe?\n", __func__); break; } } =20 /* cleanup */ - qemu_log("%s: destroy domain %d\n", __FUNCTION__, xen_domid); + qemu_log("%s: destroy domain %d\n", __func__, xen_domid); xc_domain_destroy(xen_xc, xen_domid); _exit(0); } diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index 31d2f25..69a52a9 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -36,7 +36,7 @@ static void xen_init_pv(MachineState *machine) =20 /* Initialize backend core & drivers */ if (xen_be_init() !=3D 0) { - fprintf(stderr, "%s: xen backend core setup failed\n", __FUNCTION_= _); + fprintf(stderr, "%s: xen backend core setup failed\n", __func__); exit(1); } =20 diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index cac1b2b..b398607 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -960,10 +960,10 @@ void omap_mpu_wakeup(void *opaque, int irq, int req); =20 # define OMAP_BAD_REG(paddr) \ fprintf(stderr, "%s: Bad register " OMAP_FMT_plx "\n", \ - __FUNCTION__, paddr) + __func__, paddr) # define OMAP_RO_REG(paddr) \ fprintf(stderr, "%s: Read-only register " OMAP_FMT_plx "\n", \ - __FUNCTION__, paddr) + __func__, paddr) =20 /* OMAP-specific Linux bootloader tags for the ATAG_BOARD area (Board-specifc tags are not here) */ @@ -998,13 +998,13 @@ enum { # ifdef TCMI_VERBOSE # define OMAP_8B_REG(paddr) \ fprintf(stderr, "%s: 8-bit register " OMAP_FMT_plx "\n", \ - __FUNCTION__, paddr) + __func__, paddr) # define OMAP_16B_REG(paddr) \ fprintf(stderr, "%s: 16-bit register " OMAP_FMT_plx "\n", \ - __FUNCTION__, paddr) + __func__, paddr) # define OMAP_32B_REG(paddr) \ fprintf(stderr, "%s: 32-bit register " OMAP_FMT_plx "\n", \ - __FUNCTION__, paddr) + __func__, paddr) # else # define OMAP_8B_REG(paddr) # define OMAP_16B_REG(paddr) diff --git a/include/hw/arm/sharpsl.h b/include/hw/arm/sharpsl.h index 13981a6..5bf6db1 100644 --- a/include/hw/arm/sharpsl.h +++ b/include/hw/arm/sharpsl.h @@ -7,7 +7,7 @@ #define QEMU_SHARPSL_H =20 #define zaurus_printf(format, ...) \ - fprintf(stderr, "%s: " format, __FUNCTION__, ##__VA_ARGS__) + fprintf(stderr, "%s: " format, __func__, ##__VA_ARGS__) =20 /* zaurus.c */ =20 diff --git a/memory_mapping.c b/memory_mapping.c index a5d3855..775466f 100644 --- a/memory_mapping.c +++ b/memory_mapping.c @@ -256,7 +256,7 @@ static void guest_phys_blocks_region_add(MemoryListener= *listener, =20 #ifdef DEBUG_GUEST_PHYS_REGION_ADD fprintf(stderr, "%s: target_start=3D" TARGET_FMT_plx " target_end=3D" - TARGET_FMT_plx ": %s (count: %u)\n", __FUNCTION__, target_star= t, + TARGET_FMT_plx ": %s (count: %u)\n", __func__, target_start, target_end, predecessor ? "joined" : "added", g->list->num); #endif } diff --git a/migration/block.c b/migration/block.c index e68e090..1f03946 100644 --- a/migration/block.c +++ b/migration/block.c @@ -631,7 +631,7 @@ static int flush_blks(QEMUFile *f) int ret =3D 0; =20 DPRINTF("%s Enter submitted %d read_done %d transferred %d\n", - __FUNCTION__, block_mig_state.submitted, block_mig_state.read_= done, + __func__, block_mig_state.submitted, block_mig_state.read_done, block_mig_state.transferred); =20 blk_mig_lock(); @@ -658,7 +658,7 @@ static int flush_blks(QEMUFile *f) } blk_mig_unlock(); =20 - DPRINTF("%s Exit submitted %d read_done %d transferred %d\n", __FUNCTI= ON__, + DPRINTF("%s Exit submitted %d read_done %d transferred %d\n", __func__, block_mig_state.submitted, block_mig_state.read_done, block_mig_state.transferred); return ret; diff --git a/ui/cursor.c b/ui/cursor.c index 2e2fe13..f3da0ce 100644 --- a/ui/cursor.c +++ b/ui/cursor.c @@ -19,11 +19,11 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[]) if (sscanf(xpm[line], "%u %u %u %u", &width, &height, &colors, &chars) !=3D 4) { fprintf(stderr, "%s: header parse error: \"%s\"\n", - __FUNCTION__, xpm[line]); + __func__, xpm[line]); return NULL; } if (chars !=3D 1) { - fprintf(stderr, "%s: chars !=3D 1 not supported\n", __FUNCTION__); + fprintf(stderr, "%s: chars !=3D 1 not supported\n", __func__); return NULL; } line++; @@ -41,7 +41,7 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[]) } } fprintf(stderr, "%s: color parse error: \"%s\"\n", - __FUNCTION__, xpm[line]); + __func__, xpm[line]); return NULL; } =20 diff --git a/ui/spice-display.c b/ui/spice-display.c index 85a72fe..efe9c57 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -629,13 +629,13 @@ static int interface_req_cursor_notification(QXLInsta= nce *sin) =20 static void interface_notify_update(QXLInstance *sin, uint32_t update_id) { - fprintf(stderr, "%s: abort()\n", __FUNCTION__); + fprintf(stderr, "%s: abort()\n", __func__); abort(); } =20 static int interface_flush_resources(QXLInstance *sin) { - fprintf(stderr, "%s: abort()\n", __FUNCTION__); + fprintf(stderr, "%s: abort()\n", __func__); abort(); return 0; } --=20 1.8.3.1 From nobody Thu May 2 02:25:15 2024 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 15166207362091009.7903785598129; Mon, 22 Jan 2018 03:32:16 -0800 (PST) Received: from localhost ([::1]:36386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaKl-0006Pc-F6 for importer@patchew.org; Mon, 22 Jan 2018 06:32:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaFz-0002o3-O9 for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edaFy-0007IS-TK for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52066) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edaFy-0007IA-No for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:18 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1A7E7D0E4; Mon, 22 Jan 2018 11:27:17 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id D511F60C9E; Mon, 22 Jan 2018 11:27:16 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Date: Mon, 22 Jan 2018 12:27:03 +0100 Message-Id: <1516620426-18530-7-git-send-email-thuth@redhat.com> In-Reply-To: <1516620426-18530-1-git-send-email-thuth@redhat.com> References: <1516620426-18530-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 22 Jan 2018 11:27:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 6/9] Fixes after renaming __FUNCTION__ to __func__ 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: Alistair Francis 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" From: Alistair Francis Signed-off-by: Alistair Francis Cc: Eric Blake Reviewed-by: Eric Blake Signed-off-by: Thomas Huth --- hw/arm/omap1.c | 8 +++----- hw/block/onenand.c | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 1388200..92e58f0 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -1717,7 +1717,7 @@ static void omap_clkm_write(void *opaque, hwaddr addr, if ((s->clkm.clocking_scheme ^ (value >> 11)) & 7) { s->clkm.clocking_scheme =3D (value >> 11) & 7; printf("%s: clocking scheme set to %s\n", __func__, - clkschemename[s->clkm.clocking_scheme]); + clkschemename[s->clkm.clocking_scheme]); } s->clkm.cold_start &=3D value & 0x3f; return; @@ -3329,14 +3329,12 @@ static void omap_mcbsp_writeh(void *opaque, hwaddr = addr, case 0x18: /* MCR2 */ s->mcr[1] =3D value & 0x03e3; if (value & 3) /* XMCM */ - printf("%s: Tx channel selection mode enable attempt\n", - __func__); + printf("%s: Tx channel selection mode enable attempt\n", __fun= c__); return; case 0x1a: /* MCR1 */ s->mcr[0] =3D value & 0x03e1; if (value & 1) /* RMCM */ - printf("%s: Rx channel selection mode enable attempt\n", - __func__); + printf("%s: Rx channel selection mode enable attempt\n", __fun= c__); return; case 0x1c: /* RCERA */ s->rcer[0] =3D value & 0xffff; diff --git a/hw/block/onenand.c b/hw/block/onenand.c index e243182..ed77f85 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -659,7 +659,7 @@ static uint64_t onenand_read(void *opaque, hwaddr addr, case 0xff02: /* ECC Result of spare area data */ case 0xff03: /* ECC Result of main area data */ case 0xff04: /* ECC Result of spare area data */ - hw_error("%s: imeplement ECC\n", __func__); + hw_error("%s: implement ECC\n", __func__); return 0x0000; } =20 --=20 1.8.3.1 From nobody Thu May 2 02:25:15 2024 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 1516620964843610.4359581637199; Mon, 22 Jan 2018 03:36:04 -0800 (PST) Received: from localhost ([::1]:36707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaOS-0000vy-37 for importer@patchew.org; Mon, 22 Jan 2018 06:36:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaG5-0002tW-E1 for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edaG0-0007JJ-Eu for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33624) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edaG0-0007Io-59 for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:20 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C7BE4666C; Mon, 22 Jan 2018 11:27:19 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A94B7901B; Mon, 22 Jan 2018 11:27:18 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Date: Mon, 22 Jan 2018 12:27:04 +0100 Message-Id: <1516620426-18530-8-git-send-email-thuth@redhat.com> In-Reply-To: <1516620426-18530-1-git-send-email-thuth@redhat.com> References: <1516620426-18530-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 22 Jan 2018 11:27:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 7/9] hw/bt: Replace fprintf(stderr, "*\n" with error_report() 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: Alistair Francis 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" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Reviewed-by: Thomas Huth [THH: Changed one missing fprintf into an error_report, too] Signed-off-by: Thomas Huth --- hw/bt/core.c | 15 +++++++-------- hw/bt/hci-csr.c | 21 +++++++++++---------- hw/bt/hci.c | 40 ++++++++++++++++++---------------------- hw/bt/hid.c | 2 +- hw/bt/l2cap.c | 47 ++++++++++++++++++++++++----------------------- hw/bt/sdp.c | 7 ++++--- 6 files changed, 65 insertions(+), 67 deletions(-) diff --git a/hw/bt/core.c b/hw/bt/core.c index c1806b7..78370e6 100644 --- a/hw/bt/core.c +++ b/hw/bt/core.c @@ -18,6 +18,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "sysemu/bt.h" #include "hw/bt.h" @@ -31,24 +32,22 @@ static void bt_dummy_lmp_mode_change(struct bt_link_s *= link) static void bt_dummy_lmp_connection_complete(struct bt_link_s *link) { if (link->slave->reject_reason) - fprintf(stderr, "%s: stray LMP_not_accepted received, fixme\n", - __func__); + error_report("%s: stray LMP_not_accepted received, fixme", __func_= _); else - fprintf(stderr, "%s: stray LMP_accepted received, fixme\n", - __func__); + error_report("%s: stray LMP_accepted received, fixme", __func__); exit(-1); } =20 static void bt_dummy_lmp_disconnect_master(struct bt_link_s *link) { - fprintf(stderr, "%s: stray LMP_detach received, fixme\n", __func__); + error_report("%s: stray LMP_detach received, fixme", __func__); exit(-1); } =20 static void bt_dummy_lmp_acl_resp(struct bt_link_s *link, const uint8_t *data, int start, int len) { - fprintf(stderr, "%s: stray ACL response PDU, fixme\n", __func__); + error_report("%s: stray ACL response PDU, fixme", __func__); exit(-1); } =20 @@ -113,8 +112,8 @@ void bt_device_done(struct bt_device_s *dev) while (*p && *p !=3D dev) p =3D &(*p)->next; if (*p !=3D dev) { - fprintf(stderr, "%s: bad bt device \"%s\"\n", __func__, - dev->lmp_name ?: "(null)"); + error_report("%s: bad bt device \"%s\"", __func__, + dev->lmp_name ?: "(null)"); exit(-1); } =20 diff --git a/hw/bt/hci-csr.c b/hw/bt/hci-csr.c index ac067b8..0341ded 100644 --- a/hw/bt/hci-csr.c +++ b/hw/bt/hci-csr.c @@ -19,6 +19,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "chardev/char-serial.h" #include "qemu/timer.h" @@ -111,14 +112,14 @@ static uint8_t *csrhci_out_packet(struct csrhci_s *s,= int len) =20 if (off < FIFO_LEN) { if (off + len > FIFO_LEN && (s->out_size =3D off + len) > FIFO_LEN= * 2) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); + error_report("%s: can't alloc %i bytes", __func__, len); exit(-1); } return s->outfifo + off; } =20 if (s->out_len > s->out_size) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); + error_report("%s: can't alloc %i bytes", __func__, len); exit(-1); } =20 @@ -168,10 +169,10 @@ static void csrhci_in_packet_vendor(struct csrhci_s *= s, int ocf, s->bd_addr.b[5] =3D data[offset + 2]; =20 s->hci->bdaddr_set(s->hci, s->bd_addr.b); - fprintf(stderr, "%s: bd_address loaded from firmware: " - "%02x:%02x:%02x:%02x:%02x:%02x\n", __func__, - s->bd_addr.b[0], s->bd_addr.b[1], s->bd_addr.b= [2], - s->bd_addr.b[3], s->bd_addr.b[4], s->bd_addr.b= [5]); + error_report("%s: bd_address loaded from firmware: " + "%02x:%02x:%02x:%02x:%02x:%02x", __func__, + s->bd_addr.b[0], s->bd_addr.b[1], s->bd_addr.b[2], + s->bd_addr.b[3], s->bd_addr.b[4], s->bd_addr.b[5]= ); } =20 rpkt =3D csrhci_out_packet_event(s, EVT_VENDOR, 11); @@ -181,7 +182,7 @@ static void csrhci_in_packet_vendor(struct csrhci_s *s,= int ocf, break; =20 default: - fprintf(stderr, "%s: got a bad CMD packet\n", __func__); + error_report("%s: got a bad CMD packet", __func__); return; } =20 @@ -226,7 +227,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_= t *pkt) case H4_NEG_PKT: if (s->in_hdr !=3D sizeof(csrhci_neg_packet) || memcmp(pkt - 1, csrhci_neg_packet, s->in_hdr)) { - fprintf(stderr, "%s: got a bad NEG packet\n", __func__); + error_report("%s: got a bad NEG packet", __func__); return; } pkt +=3D 2; @@ -241,7 +242,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_= t *pkt) =20 case H4_ALIVE_PKT: if (s->in_hdr !=3D 4 || pkt[1] !=3D 0x55 || pkt[2] !=3D 0x00) { - fprintf(stderr, "%s: got a bad ALIVE packet\n", __func__); + error_report("%s: got a bad ALIVE packet", __func__); return; } =20 @@ -254,7 +255,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_= t *pkt) default: bad_pkt: /* TODO: error out */ - fprintf(stderr, "%s: got a bad packet\n", __func__); + error_report("%s: got a bad packet", __func__); break; } =20 diff --git a/hw/bt/hci.c b/hw/bt/hci.c index df05f07..c6b2cc1 100644 --- a/hw/bt/hci.c +++ b/hw/bt/hci.c @@ -19,6 +19,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "qemu/timer.h" @@ -457,8 +458,7 @@ static inline uint8_t *bt_hci_event_start(struct bt_hci= _s *hci, int mask_byte; =20 if (len > 255) { - fprintf(stderr, "%s: HCI event params too long (%ib)\n", - __func__, len); + error_report("%s: HCI event params too long (%ib)", __func__, len); exit(-1); } =20 @@ -589,8 +589,8 @@ static void bt_hci_inquiry_result(struct bt_hci_s *hci, bt_hci_inquiry_result_with_rssi(hci, slave); return; default: - fprintf(stderr, "%s: bad inquiry mode %02x\n", __func__, - hci->lm.inquiry_mode); + error_report("%s: bad inquiry mode %02x", __func__, + hci->lm.inquiry_mode); exit(-1); } } @@ -1971,8 +1971,7 @@ static void bt_submit_hci(struct HCIInfo *info, break; =20 short_hci: - fprintf(stderr, "%s: HCI packet too short (%iB)\n", - __func__, length); + error_report("%s: HCI packet too short (%iB)", __func__, length); bt_hci_event_status(hci, HCI_INVALID_PARAMETERS); break; } @@ -1991,8 +1990,8 @@ static inline void bt_hci_lmp_acl_data(struct bt_hci_= s *hci, uint16_t handle, /* TODO: avoid memcpy'ing */ =20 if (len + HCI_ACL_HDR_SIZE > sizeof(hci->acl_buf)) { - fprintf(stderr, "%s: can't take ACL packets %i bytes long\n", - __func__, len); + error_report("%s: can't take ACL packets %i bytes long", + __func__, len); return; } memcpy(hci->acl_buf + HCI_ACL_HDR_SIZE, data, len); @@ -2029,8 +2028,7 @@ static void bt_submit_acl(struct HCIInfo *info, struct bt_link_s *link; =20 if (length < HCI_ACL_HDR_SIZE) { - fprintf(stderr, "%s: ACL packet too short (%iB)\n", - __func__, length); + error_report("%s: ACL packet too short (%iB)", __func__, length); return; } =20 @@ -2041,16 +2039,15 @@ static void bt_submit_acl(struct HCIInfo *info, length -=3D HCI_ACL_HDR_SIZE; =20 if (bt_hci_handle_bad(hci, handle)) { - fprintf(stderr, "%s: invalid ACL handle %03x\n", - __func__, handle); + error_report("%s: invalid ACL handle %03x", __func__, handle); /* TODO: signal an error */ return; } handle &=3D ~HCI_HANDLE_OFFSET; =20 if (datalen > length) { - fprintf(stderr, "%s: ACL packet too short (%iB < %iB)\n", - __func__, length, datalen); + error_report("%s: ACL packet too short (%iB < %iB)", + __func__, length, datalen); return; } =20 @@ -2060,8 +2057,8 @@ static void bt_submit_acl(struct HCIInfo *info, if (!hci->asb_handle) hci->asb_handle =3D handle; else if (handle !=3D hci->asb_handle) { - fprintf(stderr, "%s: Bad handle %03x in Active Slave Broadcast= \n", - __func__, handle); + error_report("%s: Bad handle %03x in Active Slave Broadcast", + __func__, handle); /* TODO: signal an error */ return; } @@ -2073,7 +2070,7 @@ static void bt_submit_acl(struct HCIInfo *info, if (!hci->psb_handle) hci->psb_handle =3D handle; else if (handle !=3D hci->psb_handle) { - fprintf(stderr, "%s: Bad handle %03x in Parked Slave Broadcast= \n", + error_report("%s: Bad handle %03x in Parked Slave Broadcast", __func__, handle); /* TODO: signal an error */ return; @@ -2105,14 +2102,13 @@ static void bt_submit_sco(struct HCIInfo *info, length -=3D 3; =20 if (bt_hci_handle_bad(hci, handle)) { - fprintf(stderr, "%s: invalid SCO handle %03x\n", - __func__, handle); + error_report("%s: invalid SCO handle %03x", __func__, handle); return; } =20 if (datalen > length) { - fprintf(stderr, "%s: SCO packet too short (%iB < %iB)\n", - __func__, length, datalen); + error_report("%s: SCO packet too short (%iB < %iB)", + __func__, length, datalen); return; } =20 @@ -2223,7 +2219,7 @@ struct HCIInfo *hci_init(const char *str) return bt_new_hci(vlan); } =20 - fprintf(stderr, "qemu: Unknown bluetooth HCI `%s'.\n", str); + error_report("Unknown bluetooth HCI `%s'.", str); =20 return 0; } diff --git a/hw/bt/hid.c b/hw/bt/hid.c index 09d1732..056291f 100644 --- a/hw/bt/hid.c +++ b/hw/bt/hid.c @@ -419,7 +419,7 @@ static void bt_hid_interrupt_sdu(void *opaque, const ui= nt8_t *data, int len) =20 return; bad: - fprintf(stderr, "%s: bad transaction on Interrupt channel.\n", + error_report("%s: bad transaction on Interrupt channel.", __func__); } =20 diff --git a/hw/bt/l2cap.c b/hw/bt/l2cap.c index 3e53dd0..9cf27f0 100644 --- a/hw/bt/l2cap.c +++ b/hw/bt/l2cap.c @@ -18,6 +18,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "qemu/timer.h" #include "qemu/bswap.h" @@ -467,8 +468,8 @@ static void l2cap_channel_close(struct l2cap_instance_s= *l2cap, =20 if (likely(ch)) { if (ch->remote_cid !=3D source_cid) { - fprintf(stderr, "%s: Ignoring a Disconnection Request with the= " - "invalid SCID %04x.\n", __func__, source_cid); + error_report("%s: Ignoring a Disconnection Request with the " + "invalid SCID %04x.", __func__, source_cid); return; } =20 @@ -790,7 +791,7 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, #if 0 /* TODO: do the IDs really have to be in sequence? */ if (!id || (id !=3D l2cap->last_id && id !=3D l2cap->next_id)) { - fprintf(stderr, "%s: out of sequence command packet ignored.\n", + error_report("%s: out of sequence command packet ignored.", __func__); return; } @@ -813,9 +814,9 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, } =20 /* We never issue commands other than Command Reject currently. */ - fprintf(stderr, "%s: stray Command Reject (%02x, %04x) " - "packet, ignoring.\n", __func__, id, - le16_to_cpu(((l2cap_cmd_rej *) params)->reason)); + error_report("%s: stray Command Reject (%02x, %04x) " + "packet, ignoring.", __func__, id, + le16_to_cpu(((l2cap_cmd_rej *) params)->reason)); break; =20 case L2CAP_CONN_REQ: @@ -836,8 +837,8 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, } =20 /* We never issue Connection Requests currently. TODO */ - fprintf(stderr, "%s: unexpected Connection Response (%02x) " - "packet, ignoring.\n", __func__, id); + error_report("%s: unexpected Connection Response (%02x) " + "packet, ignoring.", __func__, id); break; =20 case L2CAP_CONF_REQ: @@ -865,8 +866,8 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, le16_to_cpu(((l2cap_conf_rsp *) params)->scid), ((l2cap_conf_rsp *) params)->data, len - L2CAP_CONF_RSP_SIZE(0))) - fprintf(stderr, "%s: unexpected Configure Response (%02x) " - "packet, ignoring.\n", __func__, id); + error_report("%s: unexpected Configure Response (%02x) " + "packet, ignoring.", __func__, id); break; =20 case L2CAP_DISCONN_REQ: @@ -887,8 +888,8 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, } =20 /* We never issue Disconnection Requests currently. TODO */ - fprintf(stderr, "%s: unexpected Disconnection Response (%02x) " - "packet, ignoring.\n", __func__, id); + error_report("%s: unexpected Disconnection Response (%02x) " + "packet, ignoring.", __func__, id); break; =20 case L2CAP_ECHO_REQ: @@ -897,8 +898,8 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, =20 case L2CAP_ECHO_RSP: /* We never issue Echo Requests currently. TODO */ - fprintf(stderr, "%s: unexpected Echo Response (%02x) " - "packet, ignoring.\n", __func__, id); + error_report("%s: unexpected Echo Response (%02x) " + "packet, ignoring.", __func__, id); break; =20 case L2CAP_INFO_REQ: @@ -917,8 +918,8 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, } =20 /* We never issue Information Requests currently. TODO */ - fprintf(stderr, "%s: unexpected Information Response (%02x) " - "packet, ignoring.\n", __func__, id); + error_report("%s: unexpected Information Response (%02x) " + "packet, ignoring.", __func__, id); break; =20 default: @@ -1066,8 +1067,8 @@ static void l2cap_frame_in(struct l2cap_instance_s *l= 2cap, uint16_t len =3D le16_to_cpu(frame->len); =20 if (unlikely(cid >=3D L2CAP_CID_MAX || !l2cap->cid[cid])) { - fprintf(stderr, "%s: frame addressed to a non-existent L2CAP " - "channel %04x received.\n", __func__, cid); + error_report("%s: frame addressed to a non-existent L2CAP " + "channel %04x received.", __func__, cid); return; } =20 @@ -1128,9 +1129,9 @@ static uint8_t *l2cap_bframe_out(struct bt_l2cap_conn= _params_s *parm, int len) struct l2cap_chan_s *chan =3D (struct l2cap_chan_s *) parm; =20 if (len > chan->params.remote_mtu) { - fprintf(stderr, "%s: B-Frame for CID %04x longer than %i octets.\n= ", - __func__, - chan->remote_cid, chan->params.remote_mtu); + error_report("%s: B-Frame for CID %04x longer than %i octets.", + __func__, + chan->remote_cid, chan->params.remote_mtu); exit(-1); } =20 @@ -1353,8 +1354,8 @@ void bt_l2cap_psm_register(struct bt_l2cap_device_s *= dev, int psm, int min_mtu, struct bt_l2cap_psm_s *new_psm =3D l2cap_psm(dev, psm); =20 if (new_psm) { - fprintf(stderr, "%s: PSM %04x already registered for device `%s'.\= n", - __func__, psm, dev->device.lmp_name); + error_report("%s: PSM %04x already registered for device `%s'.", + __func__, psm, dev->device.lmp_name); exit(-1); } =20 diff --git a/hw/bt/sdp.c b/hw/bt/sdp.c index 7c0d38b..f4aba9d 100644 --- a/hw/bt/sdp.c +++ b/hw/bt/sdp.c @@ -18,6 +18,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "qemu/host-utils.h" #include "hw/bt.h" @@ -506,7 +507,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uin= t8_t *data, int len) int rsp_len =3D 0; =20 if (len < 5) { - fprintf(stderr, "%s: short SDP PDU (%iB).\n", __func__, len); + error_report("%s: short SDP PDU (%iB).", __func__, len); return; } =20 @@ -517,7 +518,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uin= t8_t *data, int len) len -=3D 5; =20 if (len !=3D plen) { - fprintf(stderr, "%s: wrong SDP PDU length (%iB !=3D %iB).\n", + error_report("%s: wrong SDP PDU length (%iB !=3D %iB).", __func__, plen, len); err =3D SDP_INVALID_PDU_SIZE; goto respond; @@ -544,7 +545,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uin= t8_t *data, int len) case SDP_SVC_SEARCH_RSP: case SDP_SVC_SEARCH_ATTR_RSP: default: - fprintf(stderr, "%s: unexpected SDP PDU ID %02x.\n", + error_report("%s: unexpected SDP PDU ID %02x.", __func__, pdu_id); err =3D SDP_INVALID_SYNTAX; break; --=20 1.8.3.1 From nobody Thu May 2 02:25:15 2024 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516620891658542.0618329121573; Mon, 22 Jan 2018 03:34:51 -0800 (PST) Received: from localhost ([::1]:36633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaN8-00005R-0h for importer@patchew.org; Mon, 22 Jan 2018 06:34:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaG5-0002tw-Ui for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edaG1-0007K6-Om for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42270) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edaG1-0007Ji-It for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:21 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C265BC07012C; Mon, 22 Jan 2018 11:27:20 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id B48F560C9E; Mon, 22 Jan 2018 11:27:19 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Date: Mon, 22 Jan 2018 12:27:05 +0100 Message-Id: <1516620426-18530-9-git-send-email-thuth@redhat.com> In-Reply-To: <1516620426-18530-1-git-send-email-thuth@redhat.com> References: <1516620426-18530-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 22 Jan 2018 11:27:20 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 8/9] hw/ipmi: Replace fprintf(stderr, "*\n" with error_report() 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: Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/ipmi/ipmi_bmc_extern.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index abab3bb..8c0535d 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -28,6 +28,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu/timer.h" #include "chardev/char-fe.h" @@ -194,8 +195,8 @@ static void ipmi_bmc_extern_handle_command(IPMIBmc *b, =20 if (ibe->outlen) { /* We already have a command queued. Shouldn't ever happen. */ - fprintf(stderr, "IPMI KCS: Got command when not finished with the" - " previous command\n"); + error_report("IPMI KCS: Got command when not finished with the" + " previous command"); abort(); } =20 --=20 1.8.3.1 From nobody Thu May 2 02:25:15 2024 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516620571436924.8061564512126; Mon, 22 Jan 2018 03:29:31 -0800 (PST) Received: from localhost ([::1]:36367 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaI6-0004Ag-NN for importer@patchew.org; Mon, 22 Jan 2018 06:29:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaG5-0002tU-DD for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edaG3-0007L1-BF for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5593) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edaG3-0007KQ-31 for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:23 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39D87793E8; Mon, 22 Jan 2018 11:27:22 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A2CD84F2; Mon, 22 Jan 2018 11:27:20 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Date: Mon, 22 Jan 2018 12:27:06 +0100 Message-Id: <1516620426-18530-10-git-send-email-thuth@redhat.com> In-Reply-To: <1516620426-18530-1-git-send-email-thuth@redhat.com> References: <1516620426-18530-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 22 Jan 2018 11:27:22 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 9/9] hw/isa: Replace fprintf(stderr, "*\n" with error_report() 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: Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/isa/isa-bus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 348e0ea..0f2e426 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -17,6 +17,7 @@ * License along with this library; if not, see . */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "hw/hw.h" #include "monitor/monitor.h" @@ -186,15 +187,15 @@ ISADevice *isa_vga_init(ISABus *bus) case VGA_CIRRUS: return isa_create_simple(bus, "isa-cirrus-vga"); case VGA_QXL: - fprintf(stderr, "%s: qxl: no PCI bus\n", __func__); + error_report("%s: qxl: no PCI bus", __func__); return NULL; case VGA_STD: return isa_create_simple(bus, "isa-vga"); case VGA_VMWARE: - fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __func__); + error_report("%s: vmware_vga: no PCI bus", __func__); return NULL; case VGA_VIRTIO: - fprintf(stderr, "%s: virtio-vga: no PCI bus\n", __func__); + error_report("%s: virtio-vga: no PCI bus", __func__); return NULL; case VGA_NONE: default: --=20 1.8.3.1