From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Josua Mayer <josua@solid-run.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
Vincent Mailhol <mailhol@kernel.org>,
Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Peter Rosin <peda@axentia.se>,
Aaro Koskinen <aaro.koskinen@iki.fi>,
Andreas Kemnade <andreas@kemnade.info>,
Kevin Hilman <khilman@baylibre.com>,
Roger Quadros <rogerq@kernel.org>,
Tony Lindgren <tony@atomide.com>,
Janusz Krzysztofik <jmkrzyszt@gmail.com>,
Vignesh R <vigneshr@ti.com>, Andi Shyti <andi.shyti@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Wolfram Sang <wsa-dev@sang-engineering.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
Yazan Shhady <yazan.shhady@solid-run.com>,
Jon Nettleton <jon@solid-run.com>,
Mikhail Anikin <mikhail.anikin@solid-run.com>,
linux-can@vger.kernel.org, linux-phy@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
linux-i2c@vger.kernel.org, linux-mmc@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v6 2/7] mux: Add helper functions for getting optional and selected mux-state
Date: Thu, 22 Jan 2026 09:17:20 +0300 [thread overview]
Message-ID: <202601221036.J0kR78Uw-lkp@intel.com> (raw)
In-Reply-To: <20260121-rz-sdio-mux-v6-2-38aa39527928@solid-run.com>
Hi Josua,
kernel test robot noticed the following build warnings:
url: https://github.com/intel-lab-lkp/linux/commits/Josua-Mayer/phy-can-transceiver-rename-temporary-helper-function-to-avoid-conflict/20260121-173607
base: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
patch link: https://lore.kernel.org/r/20260121-rz-sdio-mux-v6-2-38aa39527928%40solid-run.com
patch subject: [PATCH v6 2/7] mux: Add helper functions for getting optional and selected mux-state
config: arm64-randconfig-r073-20260121 (https://download.01.org/0day-ci/archive/20260122/202601221036.J0kR78Uw-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0
smatch version: v0.5.0-8985-g2614ff1a
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), 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/202601221036.J0kR78Uw-lkp@intel.com/
New smatch warnings:
drivers/mux/core.c:776 __devm_mux_state_get() warn: passing zero to 'PTR_ERR'
drivers/mux/core.c:796 __devm_mux_state_get() warn: passing zero to 'ERR_PTR'
Old smatch warnings:
drivers/mux/core.c:722 mux_state_get() warn: passing zero to 'ERR_CAST'
vim +/PTR_ERR +776 drivers/mux/core.c
0610cc3159b786 Josua Mayer 2026-01-21 761 static struct mux_state *__devm_mux_state_get(struct device *dev, const char *mux_name,
0610cc3159b786 Josua Mayer 2026-01-21 762 bool optional,
0610cc3159b786 Josua Mayer 2026-01-21 763 int (*init)(struct mux_state *mstate),
0610cc3159b786 Josua Mayer 2026-01-21 764 int (*exit)(struct mux_state *mstate))
0610cc3159b786 Josua Mayer 2026-01-21 765 {
0610cc3159b786 Josua Mayer 2026-01-21 766 struct devm_mux_state_state *devm_state;
0610cc3159b786 Josua Mayer 2026-01-21 767 struct mux_state *mstate;
0610cc3159b786 Josua Mayer 2026-01-21 768 int ret;
84564481bc4520 Aswath Govindraju 2022-01-07 769
0610cc3159b786 Josua Mayer 2026-01-21 770 devm_state = devres_alloc(devm_mux_state_release, sizeof(*devm_state), GFP_KERNEL);
0610cc3159b786 Josua Mayer 2026-01-21 771 if (!devm_state)
0610cc3159b786 Josua Mayer 2026-01-21 772 return ERR_PTR(-ENOMEM);
0610cc3159b786 Josua Mayer 2026-01-21 773
0610cc3159b786 Josua Mayer 2026-01-21 774 mstate = mux_state_get(dev, mux_name, optional);
0610cc3159b786 Josua Mayer 2026-01-21 775 if (IS_ERR_OR_NULL(mstate)) {
Please, change this to if (IS_ERR(mstate)) {. The mux_state_get() never
returns NULL. I have written a blog about functions which return both
error pointers and NULL.
https://staticthinking.wordpress.com/2022/08/01/mixing-error-pointers-and-null/
0610cc3159b786 Josua Mayer 2026-01-21 @776 ret = PTR_ERR(mstate);
0610cc3159b786 Josua Mayer 2026-01-21 777 goto err_mux_state_get;
0610cc3159b786 Josua Mayer 2026-01-21 778 }
0610cc3159b786 Josua Mayer 2026-01-21 779
0610cc3159b786 Josua Mayer 2026-01-21 780 if (init) {
0610cc3159b786 Josua Mayer 2026-01-21 781 ret = init(mstate);
0610cc3159b786 Josua Mayer 2026-01-21 782 if (ret)
0610cc3159b786 Josua Mayer 2026-01-21 783 goto err_mux_state_init;
0610cc3159b786 Josua Mayer 2026-01-21 784 }
0610cc3159b786 Josua Mayer 2026-01-21 785
0610cc3159b786 Josua Mayer 2026-01-21 786 devm_state->mstate = mstate;
0610cc3159b786 Josua Mayer 2026-01-21 787 devm_state->exit = exit;
0610cc3159b786 Josua Mayer 2026-01-21 788 devres_add(dev, devm_state);
0610cc3159b786 Josua Mayer 2026-01-21 789
0610cc3159b786 Josua Mayer 2026-01-21 790 return mstate;
0610cc3159b786 Josua Mayer 2026-01-21 791
0610cc3159b786 Josua Mayer 2026-01-21 792 err_mux_state_init:
84564481bc4520 Aswath Govindraju 2022-01-07 793 mux_state_put(mstate);
0610cc3159b786 Josua Mayer 2026-01-21 794 err_mux_state_get:
0610cc3159b786 Josua Mayer 2026-01-21 795 devres_free(devm_state);
0610cc3159b786 Josua Mayer 2026-01-21 @796 return ERR_PTR(ret);
84564481bc4520 Aswath Govindraju 2022-01-07 797 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2026-01-22 6:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 9:20 [PATCH v6 0/7] mmc: host: renesas_sdhi_core: support configuring an optional sdio mux Josua Mayer
2026-01-21 9:20 ` [PATCH v6 1/7] phy: can-transceiver: rename temporary helper function to avoid conflict Josua Mayer
2026-01-21 9:20 ` [PATCH v6 2/7] mux: Add helper functions for getting optional and selected mux-state Josua Mayer
2026-01-21 14:49 ` kernel test robot
2026-01-22 6:17 ` Dan Carpenter [this message]
2026-01-21 9:20 ` [PATCH v6 3/7] mux: add help text for MULTIPLEXER config option Josua Mayer
2026-01-21 10:59 ` Geert Uytterhoeven
2026-01-28 14:47 ` Josua Mayer
2026-01-21 9:20 ` [PATCH v6 4/7] phy: can-transceiver: drop temporary helper getting optional mux-state Josua Mayer
2026-01-21 9:20 ` [PATCH v6 5/7] i2c: omap: switch to new generic helper for getting selected mux-state Josua Mayer
2026-01-21 10:39 ` Andreas Kemnade
2026-01-21 9:20 ` [PATCH v6 6/7] dt-bindings: mmc: renesas,sdhi: Add mux-states property Josua Mayer
2026-01-21 9:20 ` [PATCH v6 7/7] mmc: host: renesas_sdhi_core: support selecting an optional mux Josua Mayer
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=202601221036.J0kR78Uw-lkp@intel.com \
--to=dan.carpenter@linaro.org \
--cc=aaro.koskinen@iki.fi \
--cc=andi.shyti@kernel.org \
--cc=andreas@kemnade.info \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=jmkrzyszt@gmail.com \
--cc=jon@solid-run.com \
--cc=josua@solid-run.com \
--cc=khilman@baylibre.com \
--cc=krzk@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=lkp@intel.com \
--cc=magnus.damm@gmail.com \
--cc=mailhol@kernel.org \
--cc=mikhail.anikin@solid-run.com \
--cc=mkl@pengutronix.de \
--cc=neil.armstrong@linaro.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=peda@axentia.se \
--cc=robh@kernel.org \
--cc=rogerq@kernel.org \
--cc=tony@atomide.com \
--cc=ulf.hansson@linaro.org \
--cc=vigneshr@ti.com \
--cc=vkoul@kernel.org \
--cc=wsa-dev@sang-engineering.com \
--cc=yazan.shhady@solid-run.com \
/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