Received: from eggs.gnu.org ([2001:4830:134:3::10]:59382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHwu6-0000OG-CL for qemu-devel@nongnu.org; Tue, 28 Jun 2016 13:34:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHwu0-000313-W5 for qemu-devel@nongnu.org; Tue, 28 Jun 2016 13:34:30 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:34505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHwu0-00030w-PZ for qemu-devel@nongnu.org; Tue, 28 Jun 2016 13:34:24 -0400 Received: by mail-wm0-x243.google.com with SMTP id 187so7676616wmz.1 for ; Tue, 28 Jun 2016 10:34:24 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 28 Jun 2016 19:33:34 +0200 Message-Id: <1467135242-874-5-git-send-email-pbonzini@redhat.com> In-Reply-To: <1467135242-874-1-git-send-email-pbonzini@redhat.com> References: <1467135242-874-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 04/32] pflash: make TYPE_CFI_PFLASH0{1, 2} macros public List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Efimov Vasily From: Efimov Vasily qdev API can be used to create CFI pflash devices despite existance of helper functions. The type name is needed in course of such creation. Using the preprocessor alias instead of the string literal itself is preferable. The patch makes the aliases accessible through the header. Signed-off-by: Efimov Vasily Reviewed-by: Paolo Bonzini Signed-off-by: Paolo Bonzini --- hw/block/pflash_cfi01.c | 1 - hw/block/pflash_cfi02.c | 1 - include/hw/block/flash.h | 3 +++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c index 31585e3..62d7a56 100644 --- a/hw/block/pflash_cfi01.c +++ b/hw/block/pflash_cfi01.c @@ -65,7 +65,6 @@ do { \ #define DPRINTF(fmt, ...) do { } while (0) #endif -#define TYPE_CFI_PFLASH01 "cfi.pflash01" #define CFI_PFLASH01(obj) OBJECT_CHECK(pflash_t, (obj), TYPE_CFI_PFLASH01) #define PFLASH_BE 0 diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c index 5f10610..4f6105c 100644 --- a/hw/block/pflash_cfi02.c +++ b/hw/block/pflash_cfi02.c @@ -57,7 +57,6 @@ do { \ #define PFLASH_LAZY_ROMD_THRESHOLD 42 -#define TYPE_CFI_PFLASH02 "cfi.pflash02" #define CFI_PFLASH02(obj) OBJECT_CHECK(pflash_t, (obj), TYPE_CFI_PFLASH02) struct pflash_t { diff --git a/include/hw/block/flash.h b/include/hw/block/flash.h index 50ccbbc..a088baa 100644 --- a/include/hw/block/flash.h +++ b/include/hw/block/flash.h @@ -5,6 +5,9 @@ #include "exec/memory.h" +#define TYPE_CFI_PFLASH01 "cfi.pflash01" +#define TYPE_CFI_PFLASH02 "cfi.pflash02" + typedef struct pflash_t pflash_t; /* pflash_cfi01.c */ -- 2.7.4