[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 14/63] i8254: Rename TYPE_I8254 to TYPE_PIT
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 14/63] i8254: Rename TYPE_I8254 to TYPE_PIT |
Date: |
Thu, 3 Sep 2020 21:26:16 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 9/3/20 6:55 PM, Eduardo Habkost wrote:
> On Thu, Sep 03, 2020 at 05:44:29PM +0100, Daniel P. Berrangé wrote:
>> On Thu, Sep 03, 2020 at 12:18:09PM -0400, Eduardo Habkost wrote:
>>> On Thu, Sep 03, 2020 at 02:47:03PM +0200, Philippe Mathieu-Daudé
>>> wrote:
>>>> On 9/3/20 12:42 AM, Eduardo Habkost wrote:
>>>>> This will make the type name constant consistent with the name of
>>>>> the type checking macro.
>>>>>
>>>>> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
>>>>> ---
>>>>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>>>>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>>>>> Cc: qemu-devel@nongnu.org
>>>>> ---
>>>>> include/hw/timer/i8254.h | 4 ++--
>>>>> hw/timer/i8254.c | 4 ++--
>>>>> 2 files changed, 4 insertions(+), 4 deletions(-)
>>>>>
>>>>> diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h
>>>>> index 1a522a2457..ddd925074f 100644
>>>>> --- a/include/hw/timer/i8254.h
>>>>> +++ b/include/hw/timer/i8254.h
>>>>> @@ -45,7 +45,7 @@ typedef struct PITCommonClass PITCommonClass;
>>>>> DECLARE_OBJ_CHECKERS(PITCommonState, PITCommonClass,
>>>>> PIT_COMMON, TYPE_PIT_COMMON)
>>>>>
>>>>> -#define TYPE_I8254 "isa-pit"
>>>>> +#define TYPE_PIT "isa-pit"
>>>>
>>>> I disagree with this patch, as we have various PIT and only one I8254.
>>>
>>> I was unsure about this, and I agree with your point. I will
>>> suggest renaming the PIT macro to I8254 instead.
>>
>> IMHO the macro name should be directly related to the object name
>> string with non-alnum characters replaced by underscore.
>>
>> ie since the object type is "isa-pit", then the macro should be
>> TYPE_ISA_PIT
>
> I think that's a good idea in this specific case because it's a
> short name (I will do it). But I don't think we'll be able to
> always follow that rule, as the QOM type name is user-visible.
Only user-visible if user-creatable, right?
- [PATCH 10/63] vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID, (continued)
- [PATCH 10/63] vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID, Eduardo Habkost, 2020/09/02
- [PATCH 11/63] edu: Rename TYPE_PCI_EDU_DEVICE to TYPE_EDU, Eduardo Habkost, 2020/09/02
- [PATCH 12/63] etrax: Rename TYPE_ETRAX_FS_SERIAL to TYPE_ETRAX_SERIAL, Eduardo Habkost, 2020/09/02
- [PATCH 13/63] etrax: Rename TYPE_ETRAX_FS_TIMER to TYPE_ETRAX_TIMER, Eduardo Habkost, 2020/09/02
- [PATCH 14/63] i8254: Rename TYPE_I8254 to TYPE_PIT, Eduardo Habkost, 2020/09/02
[PATCH 15/63] i8259: Rename TYPE_I8259 to TYPE_PIC, Eduardo Habkost, 2020/09/02
[PATCH 16/63] i8259: Rename TYPE_KVM_I8259 to TYPE_KVM_PIC, Eduardo Habkost, 2020/09/02
[PATCH 17/63] intel-hda: Rename TYPE_INTEL_HDA_GENERIC to TYPE_INTEL_HDA, Eduardo Habkost, 2020/09/02
[PATCH 20/63] pc87312: Rename TYPE_PC87312_SUPERIO to TYPE_PC87312, Eduardo Habkost, 2020/09/02