Re: [PATCH 2/5] seqlock: change __seqprop() to return the function pointer

From: Oleg Nesterov
Date: Wed Sep 13 2023 - 14:31:50 EST


On 09/14, kernel test robot wrote:
>
> Hi Oleg,

Hi kernel test robot, thank you very much.

> >> include/linux/u64_stats_sync.h:176:36: warning: passing argument 1 of '__seqprop_ptr' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Yes, a lot of seqcount_t helpers pass the "const seqcount_t *s" to
__seqprop_ptr(s) and this is wrong.

Before this patch __seqprop(s) did "(void *)(s)" and this masked the
problem.

I've updated __seqprop_##lockname##_ptr() for this reason, but didn't
notice that __seqprop_ptr() should be changed too.

Oleg.