lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <a119756eea1d3681bd8197a2cf04a1490b3139a6.camel@intel.com>
Date: Wed, 11 Dec 2024 23:35:13 +0000
From: "Colberg, Peter" <peter.colberg@...el.com>
To: "yilun.xu@...ux.intel.com" <yilun.xu@...ux.intel.com>
CC: "linux-fpga@...r.kernel.org" <linux-fpga@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"oe-kbuild-all@...ts.linux.dev" <oe-kbuild-all@...ts.linux.dev>,
	"matthew.gerlach@...ux.intel.com" <matthew.gerlach@...ux.intel.com>,
	"basheer.ahmed.muddebihal@...ux.intel.com"
	<basheer.ahmed.muddebihal@...ux.intel.com>
Subject: Re: [linux-next:master 2633/3192] drivers/fpga/dfl.c:165: warning:
 Excess function parameter 'pdev' description in 'dfl_fpga_port_ops_get'

Hi Yilun,

On Thu, 2024-12-12 at 04:38 +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   91e71d606356e50f238d7a87aacdee4abc427f07
> commit: 685126c76d55b469737b65d465620a2edcf81a99 [2633/3192] fpga: dfl: pass feature platform data instead of device as argument
> config: arc-randconfig-002-20241211 (https://download.01.org/0day-ci/archive/20241212/202412120419.feBcUVKu-lkp@intel.com/config)
> compiler: arc-elf-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241212/202412120419.feBcUVKu-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@...el.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202412120419.feBcUVKu-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
>    drivers/fpga/dfl.c:165: warning: Function parameter or struct member 'pdata' not described in 'dfl_fpga_port_ops_get'
> > > drivers/fpga/dfl.c:165: warning: Excess function parameter 'pdev' description in 'dfl_fpga_port_ops_get'
>    drivers/fpga/dfl.c:231: warning: Function parameter or struct member 'pdata' not described in 'dfl_fpga_check_port_id'
> > > drivers/fpga/dfl.c:231: warning: Excess function parameter 'pdev' description in 'dfl_fpga_check_port_id'

These warnings may be resolved by amending commit 685126c76d55 ("fpga:
dfl: pass feature platform data instead of device as argument").

--- a/drivers/fpga/dfl.c
+++ b/drivers/fpga/dfl.c
@@ -145,7 +145,7 @@ static LIST_HEAD(dfl_port_ops_list);
 
 /**
  * dfl_fpga_port_ops_get - get matched port ops from the global list
- * @pdev: platform device to match with associated port ops.
+ * @pdata: platform data to match with associated port ops.
  * Return: matched port ops on success, NULL otherwise.
  *
  * Please note that must dfl_fpga_port_ops_put after use the port_ops.
@@ -211,7 +211,7 @@ EXPORT_SYMBOL_GPL(dfl_fpga_port_ops_del);
 
 /**
  * dfl_fpga_check_port_id - check the port id
- * @pdev: port platform device.
+ * @pdata: port platform data.
  * @pport_id: port id to compare.
  *
  * Return: 1 if port device matches with given port id, otherwise 0.

Thanks,
Peter

> 
> 
> vim +165 drivers/fpga/dfl.c
> 
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  156  
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  157  /**
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  158   * dfl_fpga_port_ops_get - get matched port ops from the global list
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  159   * @pdev: platform device to match with associated port ops.
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  160   * Return: matched port ops on success, NULL otherwise.
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  161   *
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  162   * Please note that must dfl_fpga_port_ops_put after use the port_ops.
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  163   */
> 685126c76d55b46 Peter Colberg 2024-11-19  164  struct dfl_fpga_port_ops *dfl_fpga_port_ops_get(struct dfl_feature_platform_data *pdata)
> 6e8fd6e493bfca8 Wu Hao        2018-06-30 @165  {
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  166  	struct dfl_fpga_port_ops *ops = NULL;
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  167  
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  168  	mutex_lock(&dfl_port_ops_mutex);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  169  	if (list_empty(&dfl_port_ops_list))
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  170  		goto done;
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  171  
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  172  	list_for_each_entry(ops, &dfl_port_ops_list, node) {
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  173  		/* match port_ops using the name of platform device */
> 685126c76d55b46 Peter Colberg 2024-11-19  174  		if (!strcmp(pdata->dev->name, ops->name)) {
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  175  			if (!try_module_get(ops->owner))
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  176  				ops = NULL;
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  177  			goto done;
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  178  		}
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  179  	}
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  180  
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  181  	ops = NULL;
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  182  done:
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  183  	mutex_unlock(&dfl_port_ops_mutex);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  184  	return ops;
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  185  }
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  186  EXPORT_SYMBOL_GPL(dfl_fpga_port_ops_get);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  187  
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  188  /**
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  189   * dfl_fpga_port_ops_put - put port ops
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  190   * @ops: port ops.
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  191   */
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  192  void dfl_fpga_port_ops_put(struct dfl_fpga_port_ops *ops)
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  193  {
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  194  	if (ops && ops->owner)
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  195  		module_put(ops->owner);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  196  }
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  197  EXPORT_SYMBOL_GPL(dfl_fpga_port_ops_put);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  198  
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  199  /**
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  200   * dfl_fpga_port_ops_add - add port_ops to global list
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  201   * @ops: port ops to add.
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  202   */
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  203  void dfl_fpga_port_ops_add(struct dfl_fpga_port_ops *ops)
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  204  {
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  205  	mutex_lock(&dfl_port_ops_mutex);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  206  	list_add_tail(&ops->node, &dfl_port_ops_list);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  207  	mutex_unlock(&dfl_port_ops_mutex);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  208  }
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  209  EXPORT_SYMBOL_GPL(dfl_fpga_port_ops_add);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  210  
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  211  /**
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  212   * dfl_fpga_port_ops_del - remove port_ops from global list
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  213   * @ops: port ops to del.
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  214   */
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  215  void dfl_fpga_port_ops_del(struct dfl_fpga_port_ops *ops)
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  216  {
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  217  	mutex_lock(&dfl_port_ops_mutex);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  218  	list_del(&ops->node);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  219  	mutex_unlock(&dfl_port_ops_mutex);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  220  }
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  221  EXPORT_SYMBOL_GPL(dfl_fpga_port_ops_del);
> 6e8fd6e493bfca8 Wu Hao        2018-06-30  222  
> d06b004b99c9608 Wu Hao        2018-06-30  223  /**
> d06b004b99c9608 Wu Hao        2018-06-30  224   * dfl_fpga_check_port_id - check the port id
> d06b004b99c9608 Wu Hao        2018-06-30  225   * @pdev: port platform device.
> d06b004b99c9608 Wu Hao        2018-06-30  226   * @pport_id: port id to compare.
> d06b004b99c9608 Wu Hao        2018-06-30  227   *
> d06b004b99c9608 Wu Hao        2018-06-30  228   * Return: 1 if port device matches with given port id, otherwise 0.
> d06b004b99c9608 Wu Hao        2018-06-30  229   */
> 685126c76d55b46 Peter Colberg 2024-11-19  230  int dfl_fpga_check_port_id(struct dfl_feature_platform_data *pdata, void *pport_id)
> d06b004b99c9608 Wu Hao        2018-06-30 @231  {
> 69bb18ddfc4331b Wu Hao        2019-08-04  232  	struct dfl_fpga_port_ops *port_ops;
> 69bb18ddfc4331b Wu Hao        2019-08-04  233  
> 69bb18ddfc4331b Wu Hao        2019-08-04  234  	if (pdata->id != FEATURE_DEV_ID_UNUSED)
> 69bb18ddfc4331b Wu Hao        2019-08-04  235  		return pdata->id == *(int *)pport_id;
> d06b004b99c9608 Wu Hao        2018-06-30  236  
> 685126c76d55b46 Peter Colberg 2024-11-19  237  	port_ops = dfl_fpga_port_ops_get(pdata);
> d06b004b99c9608 Wu Hao        2018-06-30  238  	if (!port_ops || !port_ops->get_id)
> d06b004b99c9608 Wu Hao        2018-06-30  239  		return 0;
> d06b004b99c9608 Wu Hao        2018-06-30  240  
> 685126c76d55b46 Peter Colberg 2024-11-19  241  	pdata->id = port_ops->get_id(pdata);
> d06b004b99c9608 Wu Hao        2018-06-30  242  	dfl_fpga_port_ops_put(port_ops);
> d06b004b99c9608 Wu Hao        2018-06-30  243  
> 69bb18ddfc4331b Wu Hao        2019-08-04  244  	return pdata->id == *(int *)pport_id;
> d06b004b99c9608 Wu Hao        2018-06-30  245  }
> d06b004b99c9608 Wu Hao        2018-06-30  246  EXPORT_SYMBOL_GPL(dfl_fpga_check_port_id);
> d06b004b99c9608 Wu Hao        2018-06-30  247  
> 
> :::::: The code at line 165 was first introduced by commit
> :::::: 6e8fd6e493bfca83021cc6a8fd86d7f69bd14fc6 fpga: dfl: add dfl_fpga_port_ops support.
> 
> :::::: TO: Wu Hao <hao.wu@...el.com>
> :::::: CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ