On 1/25/21, Jessica Clarke <[email protected]> wrote:
> On 25 Jan 2021, at 22:42, Mateusz Guzik <[email protected]> wrote:
>> index a3548977b940..4c29d132c369 100644
>> --- a/sys/sys/atomic_common.h
>> +++ b/sys/sys/atomic_common.h
>> @@ -58,7 +58,7 @@
>> #define      atomic_store_long(p, v)         \
>>     (*(volatile u_long *)(p) = (u_long)(v))
>> #define      atomic_store_ptr(p, v)          \
>> -    (*(volatile uintptr_t *)(p) = (uintptr_t)(v))
>> +    (*(volatile __typeof(*p) *)(p) = (v))
>
> This is in fact general enough to be any of the atomic_store_*, and
> won't give any errors if you use it for a uint16_t (where it will store
> a uint16_t).
>

Unclear if you are suggesting validating that the passed thing is a
pointer or replacing the rest. The former is useful, the latter is
significantly more work.

-- 
Mateusz Guzik <mjguzik gmail.com>
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "[email protected]"

Reply via email to