diff mbox series

[PATCH-for-9.1,02/18] hw/usb/hcd-xhci: Enumerate xhci_flags setting values

Message ID 20240305134221.30924-3-philmd@linaro.org (mailing list archive)
State New, archived
Headers show
Series hw/i386: Remove deprecated pc-i440fx-2.0 -> 2.3 machines | expand

Commit Message

Philippe Mathieu-Daudé March 5, 2024, 1:42 p.m. UTC
xhci_flags are used as bits for QOM properties,
expected to be somehow stable (external interface).

Explicit their values so removing any enum doesn't
modify the other ones.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/usb/hcd-xhci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Zhao Liu March 6, 2024, 1:27 p.m. UTC | #1
Hi Philippe,

On Tue, Mar 05, 2024 at 02:42:04PM +0100, Philippe Mathieu-Daudé wrote:
> Date: Tue,  5 Mar 2024 14:42:04 +0100
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH-for-9.1 02/18] hw/usb/hcd-xhci: Enumerate xhci_flags
>  setting values
> X-Mailer: git-send-email 2.41.0
> 
> xhci_flags are used as bits for QOM properties,
> expected to be somehow stable (external interface).
> 
> Explicit their values so removing any enum doesn't
> modify the other ones.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/usb/hcd-xhci.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
> index 98f598382a..37f0d2e43b 100644
> --- a/hw/usb/hcd-xhci.h
> +++ b/hw/usb/hcd-xhci.h
> @@ -37,8 +37,8 @@ typedef struct XHCIEPContext XHCIEPContext;
>  
>  enum xhci_flags {
>      XHCI_FLAG_SS_FIRST = 1,
> -    XHCI_FLAG_FORCE_PCIE_ENDCAP,
> -    XHCI_FLAG_ENABLE_STREAMS,
> +    XHCI_FLAG_FORCE_PCIE_ENDCAP = 2,
> +    XHCI_FLAG_ENABLE_STREAMS = 3,
>  };
>

From the commit 290fd20db6e0 ("usb xhci: change msi/msix property
type"), the enum values were modified directly.

So it seems not necessary to bind enum type with specific value,
right?

Thanks,
Zhao
Philippe Mathieu-Daudé March 6, 2024, 4:09 p.m. UTC | #2
Hi Zhao,

On 6/3/24 14:27, Zhao Liu wrote:
> Hi Philippe,
> 
> On Tue, Mar 05, 2024 at 02:42:04PM +0100, Philippe Mathieu-Daudé wrote:
>> Date: Tue,  5 Mar 2024 14:42:04 +0100
>> From: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Subject: [PATCH-for-9.1 02/18] hw/usb/hcd-xhci: Enumerate xhci_flags
>>   setting values
>> X-Mailer: git-send-email 2.41.0
>>
>> xhci_flags are used as bits for QOM properties,
>> expected to be somehow stable (external interface).
>>
>> Explicit their values so removing any enum doesn't
>> modify the other ones.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   hw/usb/hcd-xhci.h | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
>> index 98f598382a..37f0d2e43b 100644
>> --- a/hw/usb/hcd-xhci.h
>> +++ b/hw/usb/hcd-xhci.h
>> @@ -37,8 +37,8 @@ typedef struct XHCIEPContext XHCIEPContext;
>>   
>>   enum xhci_flags {
>>       XHCI_FLAG_SS_FIRST = 1,
>> -    XHCI_FLAG_FORCE_PCIE_ENDCAP,
>> -    XHCI_FLAG_ENABLE_STREAMS,
>> +    XHCI_FLAG_FORCE_PCIE_ENDCAP = 2,
>> +    XHCI_FLAG_ENABLE_STREAMS = 3,
>>   };
>>
> 
>  From the commit 290fd20db6e0 ("usb xhci: change msi/msix property
> type"), the enum values were modified directly.
> 
> So it seems not necessary to bind enum type with specific value,
> right?

Indeed! Let's drop this patch then.

Thanks for referencing the commit,

Phil.

> Thanks,
> Zhao
> 
>
diff mbox series

Patch

diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
index 98f598382a..37f0d2e43b 100644
--- a/hw/usb/hcd-xhci.h
+++ b/hw/usb/hcd-xhci.h
@@ -37,8 +37,8 @@  typedef struct XHCIEPContext XHCIEPContext;
 
 enum xhci_flags {
     XHCI_FLAG_SS_FIRST = 1,
-    XHCI_FLAG_FORCE_PCIE_ENDCAP,
-    XHCI_FLAG_ENABLE_STREAMS,
+    XHCI_FLAG_FORCE_PCIE_ENDCAP = 2,
+    XHCI_FLAG_ENABLE_STREAMS = 3,
 };
 
 typedef enum TRBType {