All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/firmware/arm_scmi/driver.c:815:2: warning: Address of local auto-variable assigned to a function parameter. [autoVariables]
@ 2021-06-04 17:10 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-04 17:10 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5136 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Cristian Marussi <cristian.marussi@arm.com>
CC: Sudeep Holla <sudeep.holla@arm.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f88cd3fb9df228e5ce4e13ec3dbad671ddb2146e
commit: 23934efe3748f6d9d8ac0760178a5ef1ed8320f4 firmware: arm_scmi: Introduce devres get/put protocols operations
date:   10 weeks ago
:::::: branch date: 22 hours ago
:::::: commit date: 10 weeks ago
compiler: aarch64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/firmware/arm_scmi/driver.c:815:2: warning: Address of local auto-variable assigned to a function parameter. [autoVariables]
    *ph = &pi->ph;
    ^

vim +815 drivers/firmware/arm_scmi/driver.c

23934efe3748f6 Cristian Marussi 2021-03-16  770  
23934efe3748f6 Cristian Marussi 2021-03-16  771  /**
23934efe3748f6 Cristian Marussi 2021-03-16  772   * scmi_devm_protocol_get  - Devres managed get protocol operations and handle
23934efe3748f6 Cristian Marussi 2021-03-16  773   * @sdev: A reference to an scmi_device whose embedded struct device is to
23934efe3748f6 Cristian Marussi 2021-03-16  774   *	  be used for devres accounting.
23934efe3748f6 Cristian Marussi 2021-03-16  775   * @protocol_id: The protocol being requested.
23934efe3748f6 Cristian Marussi 2021-03-16  776   * @ph: A pointer reference used to pass back the associated protocol handle.
23934efe3748f6 Cristian Marussi 2021-03-16  777   *
23934efe3748f6 Cristian Marussi 2021-03-16  778   * Get hold of a protocol accounting for its usage, eventually triggering its
23934efe3748f6 Cristian Marussi 2021-03-16  779   * initialization, and returning the protocol specific operations and related
23934efe3748f6 Cristian Marussi 2021-03-16  780   * protocol handle which will be used as first argument in most of the
23934efe3748f6 Cristian Marussi 2021-03-16  781   * protocols operations methods.
23934efe3748f6 Cristian Marussi 2021-03-16  782   * Being a devres based managed method, protocol hold will be automatically
23934efe3748f6 Cristian Marussi 2021-03-16  783   * released, and possibly de-initialized on last user, once the SCMI driver
23934efe3748f6 Cristian Marussi 2021-03-16  784   * owning the scmi_device is unbound from it.
23934efe3748f6 Cristian Marussi 2021-03-16  785   *
23934efe3748f6 Cristian Marussi 2021-03-16  786   * Return: A reference to the requested protocol operations or error.
23934efe3748f6 Cristian Marussi 2021-03-16  787   *	   Must be checked for errors by caller.
23934efe3748f6 Cristian Marussi 2021-03-16  788   */
23934efe3748f6 Cristian Marussi 2021-03-16  789  static const void __must_check *
23934efe3748f6 Cristian Marussi 2021-03-16  790  scmi_devm_protocol_get(struct scmi_device *sdev, u8 protocol_id,
23934efe3748f6 Cristian Marussi 2021-03-16  791  		       struct scmi_protocol_handle **ph)
23934efe3748f6 Cristian Marussi 2021-03-16  792  {
23934efe3748f6 Cristian Marussi 2021-03-16  793  	struct scmi_protocol_instance *pi;
23934efe3748f6 Cristian Marussi 2021-03-16  794  	struct scmi_protocol_devres *dres;
23934efe3748f6 Cristian Marussi 2021-03-16  795  	struct scmi_handle *handle = sdev->handle;
23934efe3748f6 Cristian Marussi 2021-03-16  796  
23934efe3748f6 Cristian Marussi 2021-03-16  797  	if (!ph)
23934efe3748f6 Cristian Marussi 2021-03-16  798  		return ERR_PTR(-EINVAL);
23934efe3748f6 Cristian Marussi 2021-03-16  799  
23934efe3748f6 Cristian Marussi 2021-03-16  800  	dres = devres_alloc(scmi_devm_release_protocol,
23934efe3748f6 Cristian Marussi 2021-03-16  801  			    sizeof(*dres), GFP_KERNEL);
23934efe3748f6 Cristian Marussi 2021-03-16  802  	if (!dres)
23934efe3748f6 Cristian Marussi 2021-03-16  803  		return ERR_PTR(-ENOMEM);
23934efe3748f6 Cristian Marussi 2021-03-16  804  
23934efe3748f6 Cristian Marussi 2021-03-16  805  	pi = scmi_get_protocol_instance(handle, protocol_id);
23934efe3748f6 Cristian Marussi 2021-03-16  806  	if (IS_ERR(pi)) {
23934efe3748f6 Cristian Marussi 2021-03-16  807  		devres_free(dres);
23934efe3748f6 Cristian Marussi 2021-03-16  808  		return pi;
23934efe3748f6 Cristian Marussi 2021-03-16  809  	}
23934efe3748f6 Cristian Marussi 2021-03-16  810  
23934efe3748f6 Cristian Marussi 2021-03-16  811  	dres->handle = handle;
23934efe3748f6 Cristian Marussi 2021-03-16  812  	dres->protocol_id = protocol_id;
23934efe3748f6 Cristian Marussi 2021-03-16  813  	devres_add(&sdev->dev, dres);
23934efe3748f6 Cristian Marussi 2021-03-16  814  
23934efe3748f6 Cristian Marussi 2021-03-16 @815  	*ph = &pi->ph;
23934efe3748f6 Cristian Marussi 2021-03-16  816  
23934efe3748f6 Cristian Marussi 2021-03-16  817  	return pi->proto->ops;
23934efe3748f6 Cristian Marussi 2021-03-16  818  }
23934efe3748f6 Cristian Marussi 2021-03-16  819  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

only message in thread, other threads:[~2021-06-04 17:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04 17:10 drivers/firmware/arm_scmi/driver.c:815:2: warning: Address of local auto-variable assigned to a function parameter. [autoVariables] kernel test robot

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.