git: e92ab3adf4f9 - stable/13 - atomic: make atomic_store_ptr type-aware

Hans Petter Selasky hps at selasky.org
Mon Feb 1 13:52:45 UTC 2021


On 2/1/21 1:40 PM, Mateusz Guzik wrote:
>   #define	atomic_store_ptr(p, v)		\
> -    (*(volatile uintptr_t *)(p) = (uintptr_t)(v))
> +    (*(volatile __typeof(*p) *)(p) = (v))

Are you missing an assert here?

CASSERT(sizeof(*p) == sizeof(void *));

The way I read it atomic_store_ptr() can now store any type?

--HPS


More information about the dev-commits-src-branches mailing list