From patchwork Fri Jun 17 13:11:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Efimov Vasily X-Patchwork-Id: 9183971 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DF12D601C0 for ; Fri, 17 Jun 2016 13:30:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB60728386 for ; Fri, 17 Jun 2016 13:30:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE0A82835E; Fri, 17 Jun 2016 13:30:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 6125E2835E for ; Fri, 17 Jun 2016 13:30:01 +0000 (UTC) Received: from localhost ([::1]:57503 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDtqS-0007Gu-4H for patchwork-qemu-devel@patchwork.kernel.org; Fri, 17 Jun 2016 09:30:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDtYx-0004G5-Lt for qemu-devel@nongnu.org; Fri, 17 Jun 2016 09:12:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDtYs-0000pX-UM for qemu-devel@nongnu.org; Fri, 17 Jun 2016 09:11:55 -0400 Received: from smtp.ispras.ru ([83.149.199.79]:53682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDtYX-0000fZ-Ms; Fri, 17 Jun 2016 09:11:29 -0400 Received: from real.intra.ispras.ru (unknown [83.149.199.91]) by smtp.ispras.ru (Postfix) with ESMTP id E4E5D2041C; Fri, 17 Jun 2016 16:11:12 +0300 (MSK) From: Efimov Vasily To: qemu-devel@nongnu.org Date: Fri, 17 Jun 2016 16:11:00 +0300 Message-Id: <1466169069-29375-5-git-send-email-real@ispras.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466169069-29375-1-git-send-email-real@ispras.ru> References: <1466169069-29375-1-git-send-email-real@ispras.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 83.149.199.79 Subject: [Qemu-devel] [PATCH 04/13] pflash: make TYPE_CFI_PFLASH0{1, 2} macros public 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: Kevin Wolf , Peter Maydell , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Efimov Vasily , Max Reitz , Gerd Hoffmann , Paolo Bonzini , Kirill Batuzov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 */