From: Alexey Dobriyan <adobriyan@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, andriy.shevchenko@linux.intel.com
Subject: Re: [PATCH] simplify container_of_const()
Date: Fri, 19 Jul 2024 22:29:47 +0300 [thread overview]
Message-ID: <281a75d6-4aea-4d71-9d90-082e2744e491@p183> (raw)
In-Reply-To: <a088c95b-53d2-42ea-9eb3-ae81fbd07c1b@p183>
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) \
prev parent reply other threads:[~2024-07-19 19:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-19 19:19 Alexey Dobriyan
2024-07-19 19:29 ` Alexey Dobriyan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=281a75d6-4aea-4d71-9d90-082e2744e491@p183 \
--to=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®