From: Dan Carpenter <dan.carpenter@linaro.org>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: oe-kbuild@lists.linux.dev,
"Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>,
lkp@intel.com, oe-kbuild-all@lists.linux.dev,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Robert Marko" <robert.marko@sartura.hr>,
"Luka Perkov" <luka.perkov@sartura.hr>,
"Michael Walle" <michael@walle.cc>,
linux-kernel@vger.kernel.org,
"Randy Dunlap" <rdunlap@infradead.org>,
"Chen-Yu Tsai" <wenst@chromium.org>,
"Daniel Golle" <daniel@makrotopia.org>,
"Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH v7 5/7] nvmem: core: Rework layouts to become platform devices
Date: Fri, 4 Aug 2023 19:02:46 +0300 [thread overview]
Message-ID: <15cfd153-314a-4eeb-8de9-97a888905bff@kadam.mountain> (raw)
In-Reply-To: <20230804173903.2b298cd3@xps-13>
On Fri, Aug 04, 2023 at 05:39:03PM +0200, Miquel Raynal wrote:
> Hi Dan,
>
> dan.carpenter@linaro.org wrote on Thu, 3 Aug 2023 13:13:04 +0300:
>
> > Hi Miquel,
> >
> > kernel test robot noticed the following build warnings:
> >
> > https://git-scm.com/docs/git-format-patch#_base_tree_information]
> >
> > url: https://github.com/intel-lab-lkp/linux/commits/Miquel-Raynal/nvmem-core-Create-all-cells-before-adding-the-nvmem-device/20230802-022331
> > base: char-misc/char-misc-testing
> > patch link: https://lore.kernel.org/r/20230801182132.1058707-6-miquel.raynal%40bootlin.com
> > patch subject: [PATCH v7 5/7] nvmem: core: Rework layouts to become platform devices
> > config: x86_64-randconfig-m001-20230730 (https://download.01.org/0day-ci/archive/20230803/202308030002.DnSFOrMB-lkp@intel.com/config)
> > compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> > reproduce: (https://download.01.org/0day-ci/archive/20230803/202308030002.DnSFOrMB-lkp@intel.com/reproduce)
> >
> > If you fix the issue in a separate patch/commit
> > (i.e. not just a new version of the same patch/commit),
>
> (Nice addition, a lot of newcomers would always add these tags
> otherwise.)
The Intel kbuild devs add this stuff, I just look it over and hit
forward.
>
> > kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> > | Closes: https://lore.kernel.org/r/202308030002.DnSFOrMB-lkp@intel.com/
> >
> > New smatch warnings:
> > drivers/nvmem/core.c:1003 nvmem_register() warn: 'layout_np' is an error pointer or valid
> > drivers/nvmem/core.c:2130 nvmem_try_loading_layout_driver() warn: 'layout_np' is an error pointer or valid
> >
> > Old smatch warnings:
> > drivers/nvmem/core.c:761 nvmem_add_cells_from_fixed_layout() warn: 'layout_np' is an error pointer or valid
> > drivers/nvmem/core.c:802 nvmem_layout_get() warn: 'layout_np' is an error pointer or valid
> >
> > vim +/layout_np +1003 drivers/nvmem/core.c
> >
> > 266570f496b90d Michael Walle 2023-04-04 1000
> > 00d059fd6702f0 Miquel Raynal 2023-08-01 1001 /* Populate layouts as devices */
> > 00d059fd6702f0 Miquel Raynal 2023-08-01 1002 layout_np = of_nvmem_layout_get_container(nvmem);
> > 00d059fd6702f0 Miquel Raynal 2023-08-01 @1003 if (layout_np) {
> >
> > So, ugh, of_nvmem_layout_get_container() return NULL on error or error
> > pointer if either CONFIG_NVMEM or CONFIG_OF is turned off. I feel like
> > that's a mistake. Normally when a function returns both error pointers
> > and NULL then the NULL means the feature is disabled and the error
> > pointers mean there was an error. Here it is the opposite.
> >
> > I have written a blog about this:
> > https://staticthinking.wordpress.com/2022/08/01/mixing-error-pointers-and-null/
>
> Nice (besides the huge spider which stared at me unexpectedly :-) )
Those are a species of jumping spiders. They are shiny and golden in
real life, but it never shows up properly in photos. :)
>
> > At first I thought that this was to do with CONFIG_COMPILE_TEST but
> > actually that is disabled. The issue here is that CONFIG_OF is turned
> > off. So this is a genuine bug, we're compiling a module which will
> > always crash.
> >
> > So I guess the fix is easy that this should return NULL if either
> > CONFIG_NVMEM or CONFIG_OF is turned off. That was a long explanation
> > which is no longer required now that it's not a COMPILE_TEST issue. :P
>
> I wanted to disable CONFIG_OF to make the test, I totally forget, I'll
> handle this case and return NULL when this happens.
>
> However I don't understand why you mention CONFIG_NVMEM, because if it
> is not defined, this file will not compile at all?
Yeah. You're right. I wrote this email thinking it was a
CONFIG_COMPILE_TEST issue and didn't edit it properly in the end.
regards,
dan carpenter
next prev parent reply other threads:[~2023-08-04 16:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 18:21 [PATCH v7 0/7] NVMEM cells in sysfs Miquel Raynal
2023-08-01 18:21 ` [PATCH v7 1/7] nvmem: core: Create all cells before adding the nvmem device Miquel Raynal
2023-08-01 18:21 ` [PATCH v7 2/7] nvmem: core: Do not open-code existing functions Miquel Raynal
2023-08-01 18:21 ` [PATCH v7 3/7] nvmem: core: Track the registered devices Miquel Raynal
2023-08-01 18:21 ` [PATCH v7 4/7] nvmem: core: Notify when a new layout is registered Miquel Raynal
2023-08-01 18:21 ` [PATCH v7 5/7] nvmem: core: Rework layouts to become platform devices Miquel Raynal
2023-08-03 10:13 ` Dan Carpenter
2023-08-04 15:39 ` Miquel Raynal
2023-08-04 15:46 ` Miquel Raynal
2023-08-04 16:05 ` Dan Carpenter
2023-08-04 16:47 ` Miquel Raynal
2023-08-04 16:02 ` Dan Carpenter [this message]
2023-08-01 18:21 ` [PATCH v7 6/7] ABI: sysfs-nvmem-cells: Expose cells through sysfs Miquel Raynal
2023-08-05 14:50 ` Daniel Golle
2023-08-07 7:20 ` Miquel Raynal
2023-08-01 18:21 ` [PATCH v7 7/7] nvmem: core: " Miquel Raynal
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=15cfd153-314a-4eeb-8de9-97a888905bff@kadam.mountain \
--to=dan.carpenter@linaro.org \
--cc=daniel@makrotopia.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=luka.perkov@sartura.hr \
--cc=michael@walle.cc \
--cc=miquel.raynal@bootlin.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=rafal@milecki.pl \
--cc=rdunlap@infradead.org \
--cc=robert.marko@sartura.hr \
--cc=srinivas.kandagatla@linaro.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=wenst@chromium.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®