diff mbox series

hw/rdma: another clang compilation fix

Message ID 20190214154053.15050-1-marcel.apfelbaum@gmail.com (mailing list archive)
State New, archived
Headers show
Series hw/rdma: another clang compilation fix | expand

Commit Message

Marcel Apfelbaum Feb. 14, 2019, 3:40 p.m. UTC
Configuring QEMU with:
   configure --target-list="x86_64-softmmu" --cc=clang --enable-pvrdma
Results in:
   qemu/hw/rdma/rdma_rm_defs.h:108:3: error: redefinition of typedef 'RdmaDeviceResources' is a C11 feature [-Werror,-Wtypedef-redefinition]
   } RdmaDeviceResources;
     ^
   qemu/hw/rdma/rdma_backend_defs.h:24:36: note: previous definition is here
   typedef struct RdmaDeviceResources RdmaDeviceResources;

Fix by removing one of the 'typedef' definitions.

Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
---
 hw/rdma/rdma_rm_defs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kamal Heib Feb. 14, 2019, 7:50 p.m. UTC | #1
On 2/14/19 5:40 PM, Marcel Apfelbaum wrote:
> Configuring QEMU with:
>    configure --target-list="x86_64-softmmu" --cc=clang --enable-pvrdma
> Results in:
>    qemu/hw/rdma/rdma_rm_defs.h:108:3: error: redefinition of typedef 'RdmaDeviceResources' is a C11 feature [-Werror,-Wtypedef-redefinition]
>    } RdmaDeviceResources;
>      ^
>    qemu/hw/rdma/rdma_backend_defs.h:24:36: note: previous definition is here
>    typedef struct RdmaDeviceResources RdmaDeviceResources;
> 
> Fix by removing one of the 'typedef' definitions.
> 
> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> ---
>  hw/rdma/rdma_rm_defs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/rdma/rdma_rm_defs.h b/hw/rdma/rdma_rm_defs.h
> index 0ba61d1838..5e877c1fd9 100644
> --- a/hw/rdma/rdma_rm_defs.h
> +++ b/hw/rdma/rdma_rm_defs.h
> @@ -96,7 +96,7 @@ typedef struct RdmaRmPort {
>      enum ibv_port_state state;
>  } RdmaRmPort;
>  
> -typedef struct RdmaDeviceResources {
> +struct RdmaDeviceResources {
>      RdmaRmPort port;
>      RdmaRmResTbl pd_tbl;
>      RdmaRmResTbl mr_tbl;
> @@ -105,6 +105,6 @@ typedef struct RdmaDeviceResources {
>      RdmaRmResTbl cq_tbl;
>      RdmaRmResTbl cqe_ctx_tbl;
>      GHashTable *qp_hash; /* Keeps mapping between real and emulated */
> -} RdmaDeviceResources;
> +};
>  
>  #endif
> 

Acked-by: Kamal Heib <kamalheib1@gmail.com>
Marcel Apfelbaum Feb. 17, 2019, 7:51 a.m. UTC | #2
Cc:qemu-stable@nongnu.org


Thanks,
Marcel

On 2/14/19 5:40 PM, Marcel Apfelbaum wrote:
> Configuring QEMU with:
>     configure --target-list="x86_64-softmmu" --cc=clang --enable-pvrdma
> Results in:
>     qemu/hw/rdma/rdma_rm_defs.h:108:3: error: redefinition of typedef 'RdmaDeviceResources' is a C11 feature [-Werror,-Wtypedef-redefinition]
>     } RdmaDeviceResources;
>       ^
>     qemu/hw/rdma/rdma_backend_defs.h:24:36: note: previous definition is here
>     typedef struct RdmaDeviceResources RdmaDeviceResources;
>
> Fix by removing one of the 'typedef' definitions.
>
> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> ---
>   hw/rdma/rdma_rm_defs.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/rdma/rdma_rm_defs.h b/hw/rdma/rdma_rm_defs.h
> index 0ba61d1838..5e877c1fd9 100644
> --- a/hw/rdma/rdma_rm_defs.h
> +++ b/hw/rdma/rdma_rm_defs.h
> @@ -96,7 +96,7 @@ typedef struct RdmaRmPort {
>       enum ibv_port_state state;
>   } RdmaRmPort;
>   
> -typedef struct RdmaDeviceResources {
> +struct RdmaDeviceResources {
>       RdmaRmPort port;
>       RdmaRmResTbl pd_tbl;
>       RdmaRmResTbl mr_tbl;
> @@ -105,6 +105,6 @@ typedef struct RdmaDeviceResources {
>       RdmaRmResTbl cq_tbl;
>       RdmaRmResTbl cqe_ctx_tbl;
>       GHashTable *qp_hash; /* Keeps mapping between real and emulated */
> -} RdmaDeviceResources;
> +};
>   
>   #endif
Philippe Mathieu-Daudé Feb. 18, 2019, 10:05 p.m. UTC | #3
On 2/17/19 8:51 AM, Marcel Apfelbaum wrote:
> 
> Cc:qemu-stable@nongnu.org

I doubt this is a security issue worth Cc'ing qemu-stable :)

> Thanks,
> Marcel
> 
> On 2/14/19 5:40 PM, Marcel Apfelbaum wrote:
>> Configuring QEMU with:
>>     configure --target-list="x86_64-softmmu" --cc=clang --enable-pvrdma
>> Results in:
>>     qemu/hw/rdma/rdma_rm_defs.h:108:3: error: redefinition of typedef
>> 'RdmaDeviceResources' is a C11 feature [-Werror,-Wtypedef-redefinition]
>>     } RdmaDeviceResources;
>>       ^
>>     qemu/hw/rdma/rdma_backend_defs.h:24:36: note: previous definition
>> is here
>>     typedef struct RdmaDeviceResources RdmaDeviceResources;
>>
>> Fix by removing one of the 'typedef' definitions.
>>
>> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>> ---
>>   hw/rdma/rdma_rm_defs.h | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/rdma/rdma_rm_defs.h b/hw/rdma/rdma_rm_defs.h
>> index 0ba61d1838..5e877c1fd9 100644
>> --- a/hw/rdma/rdma_rm_defs.h
>> +++ b/hw/rdma/rdma_rm_defs.h
>> @@ -96,7 +96,7 @@ typedef struct RdmaRmPort {
>>       enum ibv_port_state state;
>>   } RdmaRmPort;
>>   -typedef struct RdmaDeviceResources {
>> +struct RdmaDeviceResources {
>>       RdmaRmPort port;
>>       RdmaRmResTbl pd_tbl;
>>       RdmaRmResTbl mr_tbl;
>> @@ -105,6 +105,6 @@ typedef struct RdmaDeviceResources {
>>       RdmaRmResTbl cq_tbl;
>>       RdmaRmResTbl cqe_ctx_tbl;
>>       GHashTable *qp_hash; /* Keeps mapping between real and emulated */
>> -} RdmaDeviceResources;
>> +};
>>     #endif
> 
>
Marcel Apfelbaum Feb. 19, 2019, 12:04 p.m. UTC | #4
Hi Philippe,

On 2/19/19 12:05 AM, Philippe Mathieu-Daudé wrote:
> On 2/17/19 8:51 AM, Marcel Apfelbaum wrote:
>> Cc:qemu-stable@nongnu.org
> I doubt this is a security issue worth Cc'ing qemu-stable :)
>

I thought it worth adding a compilation fix to the stable branch.

Thanks,
Marcel

>> Thanks,
>> Marcel
>>
>> On 2/14/19 5:40 PM, Marcel Apfelbaum wrote:
>>> Configuring QEMU with:
>>>      configure --target-list="x86_64-softmmu" --cc=clang --enable-pvrdma
>>> Results in:
>>>      qemu/hw/rdma/rdma_rm_defs.h:108:3: error: redefinition of typedef
>>> 'RdmaDeviceResources' is a C11 feature [-Werror,-Wtypedef-redefinition]
>>>      } RdmaDeviceResources;
>>>        ^
>>>      qemu/hw/rdma/rdma_backend_defs.h:24:36: note: previous definition
>>> is here
>>>      typedef struct RdmaDeviceResources RdmaDeviceResources;
>>>
>>> Fix by removing one of the 'typedef' definitions.
>>>
>>> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
>>> ---
>>>    hw/rdma/rdma_rm_defs.h | 4 ++--
>>>    1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/hw/rdma/rdma_rm_defs.h b/hw/rdma/rdma_rm_defs.h
>>> index 0ba61d1838..5e877c1fd9 100644
>>> --- a/hw/rdma/rdma_rm_defs.h
>>> +++ b/hw/rdma/rdma_rm_defs.h
>>> @@ -96,7 +96,7 @@ typedef struct RdmaRmPort {
>>>        enum ibv_port_state state;
>>>    } RdmaRmPort;
>>>    -typedef struct RdmaDeviceResources {
>>> +struct RdmaDeviceResources {
>>>        RdmaRmPort port;
>>>        RdmaRmResTbl pd_tbl;
>>>        RdmaRmResTbl mr_tbl;
>>> @@ -105,6 +105,6 @@ typedef struct RdmaDeviceResources {
>>>        RdmaRmResTbl cq_tbl;
>>>        RdmaRmResTbl cqe_ctx_tbl;
>>>        GHashTable *qp_hash; /* Keeps mapping between real and emulated */
>>> -} RdmaDeviceResources;
>>> +};
>>>      #endif
>>
diff mbox series

Patch

diff --git a/hw/rdma/rdma_rm_defs.h b/hw/rdma/rdma_rm_defs.h
index 0ba61d1838..5e877c1fd9 100644
--- a/hw/rdma/rdma_rm_defs.h
+++ b/hw/rdma/rdma_rm_defs.h
@@ -96,7 +96,7 @@  typedef struct RdmaRmPort {
     enum ibv_port_state state;
 } RdmaRmPort;
 
-typedef struct RdmaDeviceResources {
+struct RdmaDeviceResources {
     RdmaRmPort port;
     RdmaRmResTbl pd_tbl;
     RdmaRmResTbl mr_tbl;
@@ -105,6 +105,6 @@  typedef struct RdmaDeviceResources {
     RdmaRmResTbl cq_tbl;
     RdmaRmResTbl cqe_ctx_tbl;
     GHashTable *qp_hash; /* Keeps mapping between real and emulated */
-} RdmaDeviceResources;
+};
 
 #endif