Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [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
@ 2026-11-13  0:36 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-13  0:36 UTC (permalink / raw)
  To: Rohit Visavalia; +Cc: llvm, oe-kbuild-all, git, Michal Simek, Vishal Sagar

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-13  0:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13  0:36 [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 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox