mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zijun Hu <zijun_hu@icloud.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	 Sakari Ailus <sakari.ailus@linux.intel.com>,
	 "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	 Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	 "Rafael J. Wysocki" <rafael@kernel.org>,
	Zijun Hu <zijun_hu@icloud.com>,
	 linux-kernel@vger.kernel.org, Zijun Hu <quic_zijuhu@quicinc.com>
Subject: [PATCH] linux/container_of.h: Remove redundant type cast in container_of_const()
Date: Fri, 02 Aug 2024 23:15:15 +0800	[thread overview]
Message-ID: <20240802-container_of_const_fix-v1-1-90e7a5b624f9@quicinc.com> (raw)

From: Zijun Hu <quic_zijuhu@quicinc.com>

Remove redundant (type *) cast for default branch in container_of_const()
since the cast has been done by container_of().

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 include/linux/container_of.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/container_of.h b/include/linux/container_of.h
index 713890c867be..c36435e7c7f2 100644
--- a/include/linux/container_of.h
+++ b/include/linux/container_of.h
@@ -32,7 +32,7 @@
 #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))	\
+		default: container_of(ptr, type, member)	\
 	)
 
 #endif	/* _LINUX_CONTAINER_OF_H */

---
base-commit: 8400291e289ee6b2bf9779ff1c83a291501f017b
change-id: 20240802-container_of_const_fix-87ecdb71ba90

Best regards,
-- 
Zijun Hu <quic_zijuhu@quicinc.com>


             reply	other threads:[~2024-08-02 15:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02 15:15 Zijun Hu [this message]
2024-08-09 11:27 ` Andy Shevchenko
2024-08-09 12:04   ` Zijun Hu
2024-08-12 14:17   ` Sakari Ailus
2024-08-13  9:17   ` Greg Kroah-Hartman

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=20240802-container_of_const_fix-v1-1-90e7a5b624f9@quicinc.com \
    --to=zijun_hu@icloud.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_zijuhu@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=willy@infradead.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®