[PATCH 3/4] gpio: imx-rpmsg: add imx-rpmsg GPIO driver

kernel test robot lkp at intel.com
Thu Aug 21 07:11:18 PDT 2025


Hi Shenwei,

kernel test robot noticed the following build warnings:

[auto build test WARNING on remoteproc/rproc-next]
[also build test WARNING on brgl/gpio/for-next shawnguo/for-next linus/master v6.17-rc2 next-20250820]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Shenwei-Wang/dt-bindings-remoteproc-imx_rproc-Add-rpmsg-subnode-support/20250819-044803
base:   https://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux.git rproc-next
patch link:    https://lore.kernel.org/r/20250818204420.794554-4-shenwei.wang%40nxp.com
patch subject: [PATCH 3/4] gpio: imx-rpmsg: add imx-rpmsg GPIO driver
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20250821/202508212119.gamkDcXG-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250821/202508212119.gamkDcXG-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508212119.gamkDcXG-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpio/gpio-imx-rpmsg.c:419:6: warning: variable 'port' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     419 |         if (msg)
         |             ^~~
   drivers/gpio/gpio-imx-rpmsg.c:421:7: note: uninitialized use occurs here
     421 |         if (!port)
         |              ^~~~
   drivers/gpio/gpio-imx-rpmsg.c:419:2: note: remove the 'if' if its condition is always true
     419 |         if (msg)
         |         ^~~~~~~~
     420 |                 port = drvdata->channel_devices[msg->port_idx];
   drivers/gpio/gpio-imx-rpmsg.c:415:34: note: initialize the variable 'port' to silence this warning
     415 |         struct imx_rpmsg_gpio_port *port;
         |                                         ^
         |                                          = NULL
   drivers/gpio/gpio-imx-rpmsg.c:503:10: error: incompatible function pointer types assigning to 'void (*)(struct gpio_chip *, unsigned int, int)' from 'int (struct gpio_chip *, unsigned int, int)' [-Wincompatible-function-pointer-types]
     503 |         gc->set = imx_rpmsg_gpio_set;
         |                 ^ ~~~~~~~~~~~~~~~~~~
   1 warning and 1 error generated.


vim +419 drivers/gpio/gpio-imx-rpmsg.c

   409	
   410	static int imx_rpmsg_gpio_callback(struct rpmsg_device *rpdev,
   411		void *data, int len, void *priv, u32 src)
   412	{
   413		struct gpio_rpmsg_data *msg = (struct gpio_rpmsg_data *)data;
   414		unsigned long flags;
   415		struct imx_rpmsg_gpio_port *port;
   416		struct imx_rpmsg_driver_data *drvdata;
   417	
   418		drvdata = dev_get_drvdata(&rpdev->dev);
 > 419		if (msg)
   420			port = drvdata->channel_devices[msg->port_idx];
   421		if (!port)
   422			return -ENODEV;
   423	
   424		if (msg->header.type == GPIO_RPMSG_REPLY) {
   425			port->info.reply_msg = msg;
   426			complete(&port->info.cmd_complete);
   427		} else if (msg->header.type == GPIO_RPMSG_NOTIFY) {
   428			port->info.notify_msg = msg;
   429			local_irq_save(flags);
   430			generic_handle_domain_irq(port->domain, msg->pin_idx);
   431			local_irq_restore(flags);
   432		} else
   433			dev_err(&rpdev->dev, "wrong command type!\n");
   434	
   435		return 0;
   436	}
   437	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



More information about the linux-arm-kernel mailing list