[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aQSFhHB3txNJ-8uc@smile.fi.intel.com>
Date: Fri, 31 Oct 2025 11:46:44 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Daniel Scally <djrscally@...il.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Danilo Krummrich <dakr@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Krzysztof Kozlowski <krzk@...nel.org>, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v3 03/10] software node: allow referencing firmware nodes
On Fri, Oct 31, 2025 at 10:00:37AM +0100, Bartosz Golaszewski wrote:
> On Fri, Oct 31, 2025 at 9:24 AM Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
> > On Thu, Oct 30, 2025 at 04:17:48AM -0700, Bartosz Golaszewski wrote:
...
> > But first of all, your series doesn't compile AFAICS:
> >
> > drivers/reset/core.c:981:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
> > 981 | if (IS_ERR(rgpio_dev->swnode))
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~
> > drivers/reset/core.c:1001:9: note: uninitialized use occurs here
> > 1001 | return ret;
> > | ^~~
> > drivers/reset/core.c:981:2: note: remove the 'if' if its condition is always false
> > 981 | if (IS_ERR(rgpio_dev->swnode))
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 982 | goto err_put_of_node;
> > | ~~~~~~~~~~~~~~~~~~~~
> > drivers/reset/core.c:905:13: note: initialize the variable 'ret' to silence this warning
> > 905 | int id, ret, lflags;
> > | ^
> > | = 0
> > 1 error generated.
>
> You're not wrong but for the record: it builds fine for me with
> aarch64-linux-gnu-gcc 14.2 for some reason so I didn't notice it. I'll
> fix it.
GCC is not _the_ compiler nowadays. And building with `make W=1` should be a good
practice for subsystem maintainers :-)
...
> > So, but to the topic
> >
> > I have applied this and get the only error as per above
> >
> > (const struct software_node_ref_args) { \
> > - ._node = _ref, \
> > + .swnode = _Generic(_ref, const struct software_node *: _ref, default: NULL), \
> > + .fwnode = _Generic(_ref, struct fwnode_handle *: _ref, default: NULL), \
> >
>
> That works, thanks for the idea.
You're welcome!
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists