Re: [Qemu-devel] [RFC PATCH] hw/registerfields: Deposit fields "in place"

2018-06-04 Thread Philippe Mathieu-Daudé
On 06/04/2018 03:01 PM, Alistair Francis wrote: > On Sat, Jun 2, 2018 at 3:26 PM, Philippe Mathieu-Daudé > wrote: >> On 06/02/2018 05:55 PM, Philippe Mathieu-Daudé wrote: >>> These macros are always used to deposit a field in place. >>> Update them to take the pointer argument. >>> >>> As these m

Re: [Qemu-devel] [RFC PATCH] hw/registerfields: Deposit fields "in place"

2018-06-04 Thread Alistair Francis
On Sat, Jun 2, 2018 at 3:26 PM, Philippe Mathieu-Daudé wrote: > On 06/02/2018 05:55 PM, Philippe Mathieu-Daudé wrote: >> These macros are always used to deposit a field in place. >> Update them to take the pointer argument. >> >> As these macros are constructed using compound statements, >> it is

Re: [Qemu-devel] [RFC PATCH] hw/registerfields: Deposit fields "in place"

2018-06-02 Thread Philippe Mathieu-Daudé
On 06/02/2018 05:55 PM, Philippe Mathieu-Daudé wrote: > These macros are always used to deposit a field in place. > Update them to take the pointer argument. > > As these macros are constructed using compound statements, > it is easy to not use the return value, and the compiler > doesn't warn. Th

[Qemu-devel] [RFC PATCH] hw/registerfields: Deposit fields "in place"

2018-06-02 Thread Philippe Mathieu-Daudé
These macros are always used to deposit a field in place. Update them to take the pointer argument. As these macros are constructed using compound statements, it is easy to not use the return value, and the compiler doesn't warn. Thus this change makes these macros safer. This also helps having a