[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fee97bfc-aebf-47e2-8764-e998cf9a9eb3@suswa.mountain>
Date: Thu, 26 Jun 2025 02:18:31 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Marc Herbert <marc.herbert@...ux.intel.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, gregkh@...uxfoundation.org,
Benjamin.Cheatham@....com, Jonathan.Cameron@...wei.com,
dakr@...nel.org, dan.j.williams@...el.com,
linux-acpi@...r.kernel.org, linux-cxl@...r.kernel.org,
linux-kernel@...r.kernel.org, rafael.j.wysocki@...el.com,
rafael@...nel.org, sudeep.holla@....com,
Kees Cook <kees@...nel.org>
Subject: Re: [PATCH] driver core: faux: fix Undefined Behavior in
faux_device_destroy()
On Wed, Jun 25, 2025 at 03:30:47PM -0700, Marc Herbert wrote:
>
>
> On 2025-06-25 08:20, Dan Carpenter wrote:
> > On Sat, Jun 14, 2025 at 12:50:37PM +0200, Miguel Ojeda wrote:
> >> On Fri, 13 Jun 2025 20:33:42 -0400 Greg KH <gregkh@...uxfoundation.org> wrote:
> >>>
> >>> Great writeup, but as Miguel says, this isn't needed at all, the kernel
> >>> relies on the compiler to be sane :)
> >>
> >> We may still want to clean them up, e.g. for tooling -- Kees/Dan: do we?
> >> e.g. I see a similar case with discussion at:
> >>
> >> https://lore.kernel.org/lkml/3f1e7aaa-501a-44f1-8122-28e9efa0a33c@web.de/
> >>
> >> Which in the end was picked up as commit 2df2c0caaecf ("fbdev: au1100fb:
> >> Move a variable assignment behind a null pointer check").
> >
> > Putting the declarations at the top was always just a style preference.
>
> No, "const" and variable scopes are not just "style", please do a
> bit of research. For instance...
>
No, I meant it was a style issue for *us* as kernel developers. It
wasn't like kernel developers had not heard that c99 let you put
variable declarations randomly all over the place. We knew about it
and hated it. We only changed the rules because of __cleanup magic.
regards,
dan carpenter
Powered by blists - more mailing lists