[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2024081349-anchovy-scratch-c7c9@gregkh>
Date: Tue, 13 Aug 2024 11:17:35 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Zijun Hu <zijun_hu@...oud.com>, Jason Gunthorpe <jgg@...pe.ca>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
linux-kernel@...r.kernel.org, Zijun Hu <quic_zijuhu@...cinc.com>
Subject: Re: [PATCH] linux/container_of.h: Remove redundant type cast in
container_of_const()
On Fri, Aug 09, 2024 at 02:27:23PM +0300, Andy Shevchenko wrote:
> On Fri, Aug 02, 2024 at 11:15:15PM +0800, Zijun Hu wrote:
> > From: Zijun Hu <quic_zijuhu@...cinc.com>
> >
> > Remove redundant (type *) cast for default branch in container_of_const()
> > since the cast has been done by container_of().
>
> While it might have same effect, the below is explicitly clear about both
> cases. With your patch it will become inconsistent.
Which is why I did it this way. It's safe to keep as-is, so let's do so
please.
Remember, we write code for people first, compilers second. There's
nothing wrong with the code as-is and it makes it more obvious what is
happening when someone reads it.
thanks,
greg k-h
Powered by blists - more mailing lists