[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <281a75d6-4aea-4d71-9d90-082e2744e491@p183>
Date: Fri, 19 Jul 2024 22:29:47 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, andriy.shevchenko@...ux.intel.com
Subject: Re: [PATCH] simplify container_of_const()
On Fri, Jul 19, 2024 at 10:19:37PM +0300, Alexey Dobriyan wrote:
> * add necessary parenthesis so that
>
> container_of_const((expr1, expr2), T, member)
>
> compiles without warnings,
This part is bogus, I'm not sure why I wrote this.
> --- a/include/linux/container_of.h
> +++ b/include/linux/container_of.h
> @@ -30,9 +30,9 @@
> * @member: the name of the member within the struct.
> */
> #define container_of_const(ptr, type, member) \
> - _Generic(ptr, \
> - const typeof(*(ptr)) *: ((const type *)container_of(ptr, type, member)),\
> - default: ((type *)container_of(ptr, type, member)) \
> + _Generic((ptr), \
someone could sneak in additional clause...
> + const typeof(*(ptr)) *: (const type *)container_of(ptr, type, member),\
> + default: container_of(ptr, type, member) \
Powered by blists - more mailing lists