From patchwork Tue Mar 15 15:03:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 8589761 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9E40AC0553 for ; Tue, 15 Mar 2016 15:36:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECA42202E5 for ; Tue, 15 Mar 2016 15:36:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3AC7D20259 for ; Tue, 15 Mar 2016 15:36:23 +0000 (UTC) Received: from localhost ([::1]:49230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afr1C-0004T3-Kq for patchwork-qemu-devel@patchwork.kernel.org; Tue, 15 Mar 2016 11:36:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afqVm-0004ML-Bd for qemu-devel@nongnu.org; Tue, 15 Mar 2016 11:03:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afqVh-0007cg-9d for qemu-devel@nongnu.org; Tue, 15 Mar 2016 11:03:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afqVh-0007cS-4L for qemu-devel@nongnu.org; Tue, 15 Mar 2016 11:03:49 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id BDF64C049D7F; Tue, 15 Mar 2016 15:03:48 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-46.ams2.redhat.com [10.36.116.46]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2FF3jVO030316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 15 Mar 2016 11:03:47 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A637D3011FA0; Tue, 15 Mar 2016 16:03:41 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 15 Mar 2016 16:03:33 +0100 Message-Id: <1458054221-16923-8-git-send-email-armbru@redhat.com> In-Reply-To: <1458054221-16923-1-git-send-email-armbru@redhat.com> References: <1458054221-16923-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: peter.maydell@linaro.org, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH 07/15] include/hw/hw.h: Don't include qemu-common.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP qemu-common.h should only be included by .c files. Its file comment explains why: "No header file should depend on qemu-common.h, as this would easily lead to circular header dependencies." hw/hw.h includes qemu-common.h, but its users generally need only hw_error() and qemu/module.h from it. Move the former to hw/hw.h, include the latter there, and drop the ill-advised include. hw/misc/cbus.c now misses hw_error(), so include hw/hw.h there. Signed-off-by: Markus Armbruster --- hw/misc/cbus.c | 2 +- include/hw/hw.h | 4 +++- include/qemu-common.h | 4 ---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c index fafe070..0c207e3 100644 --- a/hw/misc/cbus.c +++ b/hw/misc/cbus.c @@ -21,7 +21,7 @@ */ #include "qemu/osdep.h" -#include "qemu-common.h" +#include "hw/hw.h" #include "hw/irq.h" #include "hw/devices.h" #include "sysemu/sysemu.h" diff --git a/include/hw/hw.h b/include/hw/hw.h index cd3d410..2cb69d5 100644 --- a/include/hw/hw.h +++ b/include/hw/hw.h @@ -2,7 +2,6 @@ #ifndef QEMU_HW_H #define QEMU_HW_H -#include "qemu-common.h" #if !defined(CONFIG_USER_ONLY) && !defined(NEED_CPU_H) #include "exec/cpu-common.h" @@ -13,6 +12,7 @@ #include "block/aio.h" #include "migration/vmstate.h" #include "qemu/log.h" +#include "qemu/module.h" #ifdef NEED_CPU_H #if TARGET_LONG_BITS == 64 @@ -41,6 +41,8 @@ typedef void QEMUResetHandler(void *opaque); void qemu_register_reset(QEMUResetHandler *func, void *opaque); void qemu_unregister_reset(QEMUResetHandler *func, void *opaque); +void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2); + #ifdef NEED_CPU_H #if TARGET_LONG_BITS == 64 #define VMSTATE_UINTTL_V(_f, _s, _v) \ diff --git a/include/qemu-common.h b/include/qemu-common.h index b8fbd9e..ba37968 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -303,10 +303,6 @@ int qemu_openpty_raw(int *aslave, char *pty_name); sendto(sockfd, buf, len, flags, destaddr, addrlen) #endif -/* Error handling. */ - -void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2); - struct ParallelIOArg { void *buffer; int count;