qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH 1/2] Emulated CCID card: QOMify


From: Cao jin
Subject: Re: [Qemu-trivial] [PATCH 1/2] Emulated CCID card: QOMify
Date: Tue, 2 Feb 2016 16:25:48 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0



On 02/02/2016 04:15 PM, Michael Tokarev wrote:
01.02.2016 09:53, Cao jin wrote:
Signed-off-by: Cao jin <address@hidden>
---
  hw/usb/ccid-card-emulated.c | 20 +++++++++-----------
  hw/usb/ccid.h               |  4 ++++
  2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index 869a63c..0b05260 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -42,8 +42,6 @@ do {\
      } \
  } while (0)

-#define EMULATED_DEV_NAME "ccid-card-emulated"


--- a/hw/usb/ccid.h
+++ b/hw/usb/ccid.h
+#define TYPE_EMULATED_CCID "ccid-card-emulated"
+#define EMULATED_CCID_CARD(obj) \
+     OBJECT_CHECK(EmulatedState, (obj), TYPE_EMULATED_CCID)

Why did you move the type definition from .c to .h file?
It is only referenced in .c, no?

Ditto for the second patch in this series.

Thanks,

/mjt


Yes, that type definition is referred only in .c for now, but we are not sure about it in the future, for better flexibility, I think put it into .h is better. http://wiki.qemu.org/QOMConventions also says:

DO use TYPE_FOO constants, defined in a header if used in other parts of code

--
Yours Sincerely,

Cao jin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]