Re: [PATCH] linux/container_of.h: Remove redundant type cast in container_of_const()
From: Greg Kroah-Hartman
Date: Tue Aug 13 2024 - 05:17:45 EST
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@xxxxxxxxxxx>
> >
> > 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