diff mbox series

[v1,1/1] target/xtensa: Use the pre-defined MEMTXATTRS_UNSPECIFIED macro

Message ID b35860a5f4377883fd2c2942bdb524d279a91de9.1504116039.git.alistair.francis@xilinx.com
State New
Headers show
Series [v1,1/1] target/xtensa: Use the pre-defined MEMTXATTRS_UNSPECIFIED macro | expand

Commit Message

Alistair Francis Aug. 30, 2017, 6:02 p.m. UTC
Instead of using the hardcoded (MemTxAttrs){0} for no memory attributes
let's use the already defined MEMTXATTRS_UNSPECIFIED macro instead.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
---

 target/xtensa/op_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Peter Maydell Aug. 30, 2017, 10:12 p.m. UTC | #1
On 30 August 2017 at 19:02, Alistair Francis
<alistair.francis@xilinx.com> wrote:
> Instead of using the hardcoded (MemTxAttrs){0} for no memory attributes
> let's use the already defined MEMTXATTRS_UNSPECIFIED macro instead.
>
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> ---
>
>  target/xtensa/op_helper.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/xtensa/op_helper.c b/target/xtensa/op_helper.c
> index 519fbeddd6..3d990c0caa 100644
> --- a/target/xtensa/op_helper.c
> +++ b/target/xtensa/op_helper.c
> @@ -1025,11 +1025,11 @@ void HELPER(ule_s)(CPUXtensaState *env, uint32_t br, float32 a, float32 b)
>  uint32_t HELPER(rer)(CPUXtensaState *env, uint32_t addr)
>  {
>      return address_space_ldl(env->address_space_er, addr,
> -                             (MemTxAttrs){0}, NULL);
> +                             MEMTXATTRS_UNSPECIFIED, NULL);
>  }
>
>  void HELPER(wer)(CPUXtensaState *env, uint32_t data, uint32_t addr)
>  {
>      address_space_stl(env->address_space_er, addr, data,
> -                      (MemTxAttrs){0}, NULL);
> +                      MEMTXATTRS_UNSPECIFIED, NULL);
>  }

Might be worth noting in the commit that this is technically
a change of behaviour, because MEMTXATTRS_UNSPECIFIED
sets the 'unspecified' field to 1 whereas {0} doesn't.
I don't think anything actually checks that field, though.

thanks
-- PMM
Alistair Francis Aug. 31, 2017, 5:21 p.m. UTC | #2
On Wed, Aug 30, 2017 at 3:12 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 30 August 2017 at 19:02, Alistair Francis
> <alistair.francis@xilinx.com> wrote:
>> Instead of using the hardcoded (MemTxAttrs){0} for no memory attributes
>> let's use the already defined MEMTXATTRS_UNSPECIFIED macro instead.
>>
>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
>> ---
>>
>>  target/xtensa/op_helper.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/target/xtensa/op_helper.c b/target/xtensa/op_helper.c
>> index 519fbeddd6..3d990c0caa 100644
>> --- a/target/xtensa/op_helper.c
>> +++ b/target/xtensa/op_helper.c
>> @@ -1025,11 +1025,11 @@ void HELPER(ule_s)(CPUXtensaState *env, uint32_t br, float32 a, float32 b)
>>  uint32_t HELPER(rer)(CPUXtensaState *env, uint32_t addr)
>>  {
>>      return address_space_ldl(env->address_space_er, addr,
>> -                             (MemTxAttrs){0}, NULL);
>> +                             MEMTXATTRS_UNSPECIFIED, NULL);
>>  }
>>
>>  void HELPER(wer)(CPUXtensaState *env, uint32_t data, uint32_t addr)
>>  {
>>      address_space_stl(env->address_space_er, addr, data,
>> -                      (MemTxAttrs){0}, NULL);
>> +                      MEMTXATTRS_UNSPECIFIED, NULL);
>>  }
>
> Might be worth noting in the commit that this is technically
> a change of behaviour, because MEMTXATTRS_UNSPECIFIED
> sets the 'unspecified' field to 1 whereas {0} doesn't.
> I don't think anything actually checks that field, though.

Good point, I have added something to the commit message to indicate
that. It'll be included in v2.

Thanks,
Alistair

>
> thanks
> -- PMM
diff mbox series

Patch

diff --git a/target/xtensa/op_helper.c b/target/xtensa/op_helper.c
index 519fbeddd6..3d990c0caa 100644
--- a/target/xtensa/op_helper.c
+++ b/target/xtensa/op_helper.c
@@ -1025,11 +1025,11 @@  void HELPER(ule_s)(CPUXtensaState *env, uint32_t br, float32 a, float32 b)
 uint32_t HELPER(rer)(CPUXtensaState *env, uint32_t addr)
 {
     return address_space_ldl(env->address_space_er, addr,
-                             (MemTxAttrs){0}, NULL);
+                             MEMTXATTRS_UNSPECIFIED, NULL);
 }
 
 void HELPER(wer)(CPUXtensaState *env, uint32_t data, uint32_t addr)
 {
     address_space_stl(env->address_space_er, addr, data,
-                      (MemTxAttrs){0}, NULL);
+                      MEMTXATTRS_UNSPECIFIED, NULL);
 }