[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] oslib-posix: Fix compiler warning and some d
From: |
Stefan Weil |
Subject: |
Re: [Qemu-devel] [PATCH v2] oslib-posix: Fix compiler warning and some data types |
Date: |
Sun, 15 Oct 2017 19:53:17 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
Am 15.10.2017 um 19:46 schrieb Stefan Weil:
> Am 15.10.2017 um 17:32 schrieb Paolo Bonzini:
>> On 14/10/2017 18:53, Philippe Mathieu-Daudé wrote:
>>>> @@ -328,7 +328,7 @@ static void *do_touch_pages(void *arg)
>>>> * don't need to write at all so we don't cause
>>>> * wear on the storage backing the region...
>>>> */
>>>> - *(volatile char *)addr = *addr;
>>>> + *addr = *addr;
>>> I personally prefer the other form which is mostly self-explicit when
>>> reviewing this code.
>>>
>>> Declaring addr non volatile and using volatile cast here:
>>> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
>>>
>>
>> I agree with Philippe; in general, volatile is more of a property of
>> the access rather than the variable.
>>
>> Paolo
>
> Thanks for the feedback.
>
> I see your arguments. Maybe that part can be removed from my patch
> when it is applied, or should I send a v3 (cc'ing qemu-trivial)?
>
> Stefan
While thinking more about that line of code, I wonder whether
it would make sense to replace the byte r/w by a 32 bit r/w.
Would that be faster on architectures with a 32 bit memory bus?
Stefan