From: kernel test robot <lkp@intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, arm@kernel.org
Subject: [soc:board-remove 200/200] drivers/mmc/host/sdhci-pxav2.c:305:6: warning: variable 'pdata' is used uninitialized whenever 'if' condition is false
Date: Wed, 19 Aug 2026 15:05:37 +0800 [thread overview]
Message-ID: <202608191406.FXxPSlmS-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git board-remove
head: c12d647b0229f4d75a2973c9b4e79f9b53406426
commit: c12d647b0229f4d75a2973c9b4e79f9b53406426 [200/200] remaining pdata removal
config: loongarch-randconfig-001-20260819 (https://download.01.org/0day-ci/archive/20260819/202608191406.FXxPSlmS-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 844a18e753e822736c9805ab779144b647a2c186)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260819/202608191406.FXxPSlmS-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), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608191406.FXxPSlmS-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/mmc/host/sdhci-pxav2.c:305:6: warning: variable 'pdata' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
305 | if (variant)
| ^~~~~~~
drivers/mmc/host/sdhci-pxav2.c:308:6: note: uninitialized use occurs here
308 | if (pdata->flags & PXA_FLAG_CARD_PERMANENT) {
| ^~~~~
drivers/mmc/host/sdhci-pxav2.c:305:2: note: remove the 'if' if its condition is always true
305 | if (variant)
| ^~~~~~~~~~~~
306 | pdata = pxav2_get_mmc_pdata(dev);
drivers/mmc/host/sdhci-pxav2.c:273:34: note: initialize the variable 'pdata' to silence this warning
273 | struct sdhci_pxa_platdata *pdata;
| ^
| = NULL
1 warning generated.
vim +305 drivers/mmc/host/sdhci-pxav2.c
b650352dd3df361 Chris Ball 2012-04-10 269
c3be1efd41a97f9 Bill Pemberton 2012-11-19 270 static int sdhci_pxav2_probe(struct platform_device *pdev)
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 271 {
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 272 struct sdhci_pltfm_host *pltfm_host;
c12d647b0229f4d Arnd Bergmann 2026-08-07 273 struct sdhci_pxa_platdata *pdata;
f35ca223882aa6f Doug Brown 2023-01-16 274 struct sdhci_pxav2_host *pxav2_host;
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 275 struct device *dev = &pdev->dev;
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 276 struct sdhci_host *host = NULL;
dfe9746aed2d126 Doug Brown 2023-01-16 277 const struct sdhci_pxa_variant *variant;
b650352dd3df361 Chris Ball 2012-04-10 278
e41c48b4bcb3cee Doug Brown 2023-01-16 279 struct clk *clk, *clk_core;
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 280
f35ca223882aa6f Doug Brown 2023-01-16 281 host = sdhci_pltfm_init(pdev, NULL, sizeof(*pxav2_host));
6a686c31324c9ef Sebastian Hesselbarth 2014-10-21 282 if (IS_ERR(host))
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 283 return PTR_ERR(host);
6a686c31324c9ef Sebastian Hesselbarth 2014-10-21 284
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 285 pltfm_host = sdhci_priv(host);
f35ca223882aa6f Doug Brown 2023-01-16 286 pxav2_host = sdhci_pltfm_priv(pltfm_host);
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 287
c21f1b0dc6418e0 Adrian Hunter 2023-08-11 288 clk = devm_clk_get_optional_enabled(dev, "io");
c21f1b0dc6418e0 Adrian Hunter 2023-08-11 289 if (!clk)
c21f1b0dc6418e0 Adrian Hunter 2023-08-11 290 clk = devm_clk_get_enabled(dev, NULL);
072f5e2c34a95bc Binbin Zhou 2025-06-07 291 if (IS_ERR(clk))
072f5e2c34a95bc Binbin Zhou 2025-06-07 292 return dev_err_probe(dev, PTR_ERR(clk), "failed to get io clock\n");
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 293 pltfm_host->clk = clk;
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 294
e41c48b4bcb3cee Doug Brown 2023-01-16 295 clk_core = devm_clk_get_optional_enabled(dev, "core");
072f5e2c34a95bc Binbin Zhou 2025-06-07 296 if (IS_ERR(clk_core))
072f5e2c34a95bc Binbin Zhou 2025-06-07 297 return dev_err_probe(dev, PTR_ERR(clk_core),
072f5e2c34a95bc Binbin Zhou 2025-06-07 298 "failed to enable core clock\n");
e41c48b4bcb3cee Doug Brown 2023-01-16 299
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 300 host->quirks = SDHCI_QUIRK_BROKEN_ADMA
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 301 | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 302 | SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN;
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 303
dfe9746aed2d126 Doug Brown 2023-01-16 304 variant = of_device_get_match_data(dev);
dfe9746aed2d126 Doug Brown 2023-01-16 @305 if (variant)
b650352dd3df361 Chris Ball 2012-04-10 306 pdata = pxav2_get_mmc_pdata(dev);
dfe9746aed2d126 Doug Brown 2023-01-16 307
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 308 if (pdata->flags & PXA_FLAG_CARD_PERMANENT) {
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 309 /* on-chip device */
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 310 host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 311 host->mmc->caps |= MMC_CAP_NONREMOVABLE;
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 312 }
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 313
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 314 /* If slot design supports 8 bit data, indicate this to MMC. */
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 315 if (pdata->flags & PXA_FLAG_SD_8_BIT_CAPABLE_SLOT)
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 316 host->mmc->caps |= MMC_CAP_8_BIT_DATA;
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 317
dfe9746aed2d126 Doug Brown 2023-01-16 318 host->quirks |= variant->extra_quirks;
dfe9746aed2d126 Doug Brown 2023-01-16 319 host->ops = variant->ops;
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 320
f35ca223882aa6f Doug Brown 2023-01-16 321 /* Set up optional pinctrl for PXA168 SDIO IRQ fix */
f35ca223882aa6f Doug Brown 2023-01-16 322 pxav2_host->pinctrl = devm_pinctrl_get(dev);
f35ca223882aa6f Doug Brown 2023-01-16 323 if (!IS_ERR(pxav2_host->pinctrl)) {
f35ca223882aa6f Doug Brown 2023-01-16 324 pxav2_host->pins_cmd_gpio = pinctrl_lookup_state(pxav2_host->pinctrl,
f35ca223882aa6f Doug Brown 2023-01-16 325 "state_cmd_gpio");
f35ca223882aa6f Doug Brown 2023-01-16 326 if (IS_ERR(pxav2_host->pins_cmd_gpio))
f35ca223882aa6f Doug Brown 2023-01-16 327 pxav2_host->pins_cmd_gpio = NULL;
f35ca223882aa6f Doug Brown 2023-01-16 328 pxav2_host->pins_default = pinctrl_lookup_state(pxav2_host->pinctrl,
f35ca223882aa6f Doug Brown 2023-01-16 329 "default");
f35ca223882aa6f Doug Brown 2023-01-16 330 if (IS_ERR(pxav2_host->pins_default))
f35ca223882aa6f Doug Brown 2023-01-16 331 pxav2_host->pins_default = NULL;
f35ca223882aa6f Doug Brown 2023-01-16 332 } else {
f35ca223882aa6f Doug Brown 2023-01-16 333 pxav2_host->pinctrl = NULL;
f35ca223882aa6f Doug Brown 2023-01-16 334 }
f35ca223882aa6f Doug Brown 2023-01-16 335
072f5e2c34a95bc Binbin Zhou 2025-06-07 336 return sdhci_add_host(host);
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 337 }
9f5d71e4a78a02f Zhangfei Gao 2011-06-08 338
:::::: The code at line 305 was first introduced by commit
:::::: dfe9746aed2d1267f00b880ae232170d7d9e4202 mmc: sdhci-pxav2: add initial support for PXA168 V1 controller
:::::: TO: Doug Brown <doug@schmorgal.com>
:::::: CC: Ulf Hansson <ulf.hansson@linaro.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-08-19 7:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202608191406.FXxPSlmS-lkp@intel.com \
--to=lkp@intel.com \
--cc=arm@kernel.org \
--cc=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.