From: kernel test robot <lkp@intel.com>
To: Rohit Visavalia <rohit.visavalia@amd.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, git@amd.com,
Michal Simek <monstr@monstr.eu>,
Vishal Sagar <vishal.sagar@amd.com>
Subject: [xilinx-xlnx:xlnx_rebase_v6.18 1192/1490] drivers/gpu/drm/xlnx/xlnx_bridge.c:366:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
Date: Fri, 13 Nov 2026 08:36:28 +0800 [thread overview]
Message-ID: <202611130817.iOSit0sS-lkp@intel.com> (raw)
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v6.18
head: 964e4db09c78beb79bace2b636061cb3261b0512
commit: aca361011ad63d263f0022639c724c45866489c8 [1192/1490] drm: xlnx: bridge: fix debugfs command parsing
config: sparc64-allmodconfig (https://download.01.org/0day-ci/archive/20261113/202611130817.iOSit0sS-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261113/202611130817.iOSit0sS-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/202611130817.iOSit0sS-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/xlnx/xlnx_bridge.c:366:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
366 | if (w && h && bus_fmt) {
| ^~~~~~~~~~~~~~~~~
drivers/gpu/drm/xlnx/xlnx_bridge.c:372:7: note: uninitialized use occurs here
372 | if (ret) {
| ^~~
drivers/gpu/drm/xlnx/xlnx_bridge.c:366:3: note: remove the 'if' if its condition is always true
366 | if (w && h && bus_fmt) {
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/xlnx/xlnx_bridge.c:366:7: warning: variable 'ret' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
366 | if (w && h && bus_fmt) {
| ^~~~~~
drivers/gpu/drm/xlnx/xlnx_bridge.c:372:7: note: uninitialized use occurs here
372 | if (ret) {
| ^~~
drivers/gpu/drm/xlnx/xlnx_bridge.c:366:7: note: remove the '&&' if its condition is always true
366 | if (w && h && bus_fmt) {
| ^~~~~~~~~
>> drivers/gpu/drm/xlnx/xlnx_bridge.c:366:7: warning: variable 'ret' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
366 | if (w && h && bus_fmt) {
| ^
drivers/gpu/drm/xlnx/xlnx_bridge.c:372:7: note: uninitialized use occurs here
372 | if (ret) {
| ^~~
drivers/gpu/drm/xlnx/xlnx_bridge.c:366:7: note: remove the '&&' if its condition is always true
366 | if (w && h && bus_fmt) {
| ^~~~
drivers/gpu/drm/xlnx/xlnx_bridge.c:359:10: note: initialize the variable 'ret' to silence this warning
359 | int ret;
| ^
| = 0
3 warnings generated.
vim +366 drivers/gpu/drm/xlnx/xlnx_bridge.c
49e728aa293130f Hyun Kwon 2018-01-23 332
49e728aa293130f Hyun Kwon 2018-01-23 333 static ssize_t xlnx_bridge_debugfs_write(struct file *f, const char __user *buf,
49e728aa293130f Hyun Kwon 2018-01-23 334 size_t size, loff_t *pos)
49e728aa293130f Hyun Kwon 2018-01-23 335 {
49e728aa293130f Hyun Kwon 2018-01-23 336 struct xlnx_bridge *bridge = f->f_inode->i_private;
aca361011ad63d2 Rohit Visavalia 2026-09-01 337 char *cmd;
49e728aa293130f Hyun Kwon 2018-01-23 338
49e728aa293130f Hyun Kwon 2018-01-23 339 if (*pos != 0 || size <= 0)
49e728aa293130f Hyun Kwon 2018-01-23 340 return -EINVAL;
49e728aa293130f Hyun Kwon 2018-01-23 341
49e728aa293130f Hyun Kwon 2018-01-23 342 cmd = kzalloc(size, GFP_KERNEL);
49e728aa293130f Hyun Kwon 2018-01-23 343 if (!cmd)
49e728aa293130f Hyun Kwon 2018-01-23 344 return -ENOMEM;
49e728aa293130f Hyun Kwon 2018-01-23 345
aca361011ad63d2 Rohit Visavalia 2026-09-01 346 cmd = memdup_user_nul(buf, size);
aca361011ad63d2 Rohit Visavalia 2026-09-01 347 if (IS_ERR(cmd)) {
49e728aa293130f Hyun Kwon 2018-01-23 348 kfree(cmd);
aca361011ad63d2 Rohit Visavalia 2026-09-01 349 return PTR_ERR(cmd);
49e728aa293130f Hyun Kwon 2018-01-23 350 }
49e728aa293130f Hyun Kwon 2018-01-23 351
aca361011ad63d2 Rohit Visavalia 2026-09-01 352 if (sysfs_streq(cmd, "enable")) {
aca361011ad63d2 Rohit Visavalia 2026-09-01 353 xlnx_bridge_enable(bridge);
aca361011ad63d2 Rohit Visavalia 2026-09-01 354 } else if (sysfs_streq(cmd, "disable")) {
aca361011ad63d2 Rohit Visavalia 2026-09-01 355 xlnx_bridge_disable(bridge);
aca361011ad63d2 Rohit Visavalia 2026-09-01 356 } else if (str_has_prefix(cmd, "set_input")) {
aca361011ad63d2 Rohit Visavalia 2026-09-01 357 char *w, *h, *bus_fmt, *tmp;
aca361011ad63d2 Rohit Visavalia 2026-09-01 358 u32 width = 0, height = 0, fmt = 0;
aca361011ad63d2 Rohit Visavalia 2026-09-01 359 int ret;
aca361011ad63d2 Rohit Visavalia 2026-09-01 360
aca361011ad63d2 Rohit Visavalia 2026-09-01 361 tmp = cmd;
aca361011ad63d2 Rohit Visavalia 2026-09-01 362 strsep(&tmp, " ");
aca361011ad63d2 Rohit Visavalia 2026-09-01 363 w = strsep(&tmp, " ");
aca361011ad63d2 Rohit Visavalia 2026-09-01 364 h = strsep(&tmp, " ");
aca361011ad63d2 Rohit Visavalia 2026-09-01 365 bus_fmt = strsep(&tmp, " ");
49e728aa293130f Hyun Kwon 2018-01-23 @366 if (w && h && bus_fmt) {
49e728aa293130f Hyun Kwon 2018-01-23 367 ret = kstrtouint(w, 0, &width);
49e728aa293130f Hyun Kwon 2018-01-23 368 ret |= kstrtouint(h, 0, &height);
49e728aa293130f Hyun Kwon 2018-01-23 369 ret |= kstrtouint(bus_fmt, 0, &fmt);
49e728aa293130f Hyun Kwon 2018-01-23 370 }
49e728aa293130f Hyun Kwon 2018-01-23 371
49e728aa293130f Hyun Kwon 2018-01-23 372 if (ret) {
49e728aa293130f Hyun Kwon 2018-01-23 373 pr_err("%s %d invalid command: %s\n",
aca361011ad63d2 Rohit Visavalia 2026-09-01 374 __func__, __LINE__, cmd);
49e728aa293130f Hyun Kwon 2018-01-23 375 return -EINVAL;
49e728aa293130f Hyun Kwon 2018-01-23 376 }
49e728aa293130f Hyun Kwon 2018-01-23 377 xlnx_bridge_set_input(bridge, width, height, fmt);
49e728aa293130f Hyun Kwon 2018-01-23 378 }
49e728aa293130f Hyun Kwon 2018-01-23 379
aca361011ad63d2 Rohit Visavalia 2026-09-01 380 kfree(cmd);
49e728aa293130f Hyun Kwon 2018-01-23 381 return size;
49e728aa293130f Hyun Kwon 2018-01-23 382 }
49e728aa293130f Hyun Kwon 2018-01-23 383
:::::: The code at line 366 was first introduced by commit
:::::: 49e728aa293130f0265670e3c92bc9bfd780bb85 drm: xlnx: drv: Add Xilinx bridge support
:::::: TO: Hyun Kwon <hyun.kwon@xilinx.com>
:::::: CC: Michal Simek <michal.simek@amd.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-11-13 0:37 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=202611130817.iOSit0sS-lkp@intel.com \
--to=lkp@intel.com \
--cc=git@amd.com \
--cc=llvm@lists.linux.dev \
--cc=monstr@monstr.eu \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rohit.visavalia@amd.com \
--cc=vishal.sagar@amd.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