CC: [email protected]
CC: [email protected]
TO: Arnd Bergmann <[email protected]>
CC: Bjorn Andersson <[email protected]>
CC: Charles Keepax <[email protected]>
CC: Mark Brown <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   ee1703cda8dc777e937dec172da55beaf1a74919
commit: 951cd3a0866d29cb9c01ebc1d9c17590e598226e firmware: include 
drivers/firmware/Kconfig unconditionally
date:   6 weeks ago
:::::: branch date: 6 hours ago
:::::: commit date: 6 weeks ago
compiler: microblaze-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


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

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

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

23934efe3748f6 Cristian Marussi 2021-03-16  1233  
23934efe3748f6 Cristian Marussi 2021-03-16  1234  /**
23934efe3748f6 Cristian Marussi 2021-03-16  1235   * scmi_devm_protocol_get  - 
Devres managed get protocol operations and handle
23934efe3748f6 Cristian Marussi 2021-03-16  1236   * @sdev: A reference to an 
scmi_device whose embedded struct device is to
23934efe3748f6 Cristian Marussi 2021-03-16  1237   *      be used for devres 
accounting.
23934efe3748f6 Cristian Marussi 2021-03-16  1238   * @protocol_id: The protocol 
being requested.
23934efe3748f6 Cristian Marussi 2021-03-16  1239   * @ph: A pointer reference 
used to pass back the associated protocol handle.
23934efe3748f6 Cristian Marussi 2021-03-16  1240   *
23934efe3748f6 Cristian Marussi 2021-03-16  1241   * Get hold of a protocol 
accounting for its usage, eventually triggering its
23934efe3748f6 Cristian Marussi 2021-03-16  1242   * initialization, and 
returning the protocol specific operations and related
23934efe3748f6 Cristian Marussi 2021-03-16  1243   * protocol handle which will 
be used as first argument in most of the
23934efe3748f6 Cristian Marussi 2021-03-16  1244   * protocols operations 
methods.
23934efe3748f6 Cristian Marussi 2021-03-16  1245   * Being a devres based 
managed method, protocol hold will be automatically
23934efe3748f6 Cristian Marussi 2021-03-16  1246   * released, and possibly 
de-initialized on last user, once the SCMI driver
23934efe3748f6 Cristian Marussi 2021-03-16  1247   * owning the scmi_device is 
unbound from it.
23934efe3748f6 Cristian Marussi 2021-03-16  1248   *
23934efe3748f6 Cristian Marussi 2021-03-16  1249   * Return: A reference to the 
requested protocol operations or error.
23934efe3748f6 Cristian Marussi 2021-03-16  1250   *       Must be checked for 
errors by caller.
23934efe3748f6 Cristian Marussi 2021-03-16  1251   */
23934efe3748f6 Cristian Marussi 2021-03-16  1252  static const void 
__must_check *
23934efe3748f6 Cristian Marussi 2021-03-16  1253  scmi_devm_protocol_get(struct 
scmi_device *sdev, u8 protocol_id,
23934efe3748f6 Cristian Marussi 2021-03-16  1254                       struct 
scmi_protocol_handle **ph)
23934efe3748f6 Cristian Marussi 2021-03-16  1255  {
23934efe3748f6 Cristian Marussi 2021-03-16  1256        struct 
scmi_protocol_instance *pi;
23934efe3748f6 Cristian Marussi 2021-03-16  1257        struct 
scmi_protocol_devres *dres;
23934efe3748f6 Cristian Marussi 2021-03-16  1258        struct scmi_handle 
*handle = sdev->handle;
23934efe3748f6 Cristian Marussi 2021-03-16  1259  
23934efe3748f6 Cristian Marussi 2021-03-16  1260        if (!ph)
23934efe3748f6 Cristian Marussi 2021-03-16  1261                return 
ERR_PTR(-EINVAL);
23934efe3748f6 Cristian Marussi 2021-03-16  1262  
23934efe3748f6 Cristian Marussi 2021-03-16  1263        dres = 
devres_alloc(scmi_devm_release_protocol,
23934efe3748f6 Cristian Marussi 2021-03-16  1264                            
sizeof(*dres), GFP_KERNEL);
23934efe3748f6 Cristian Marussi 2021-03-16  1265        if (!dres)
23934efe3748f6 Cristian Marussi 2021-03-16  1266                return 
ERR_PTR(-ENOMEM);
23934efe3748f6 Cristian Marussi 2021-03-16  1267  
23934efe3748f6 Cristian Marussi 2021-03-16  1268        pi = 
scmi_get_protocol_instance(handle, protocol_id);
23934efe3748f6 Cristian Marussi 2021-03-16  1269        if (IS_ERR(pi)) {
23934efe3748f6 Cristian Marussi 2021-03-16  1270                
devres_free(dres);
23934efe3748f6 Cristian Marussi 2021-03-16  1271                return pi;
23934efe3748f6 Cristian Marussi 2021-03-16  1272        }
23934efe3748f6 Cristian Marussi 2021-03-16  1273  
23934efe3748f6 Cristian Marussi 2021-03-16  1274        dres->handle = handle;
23934efe3748f6 Cristian Marussi 2021-03-16  1275        dres->protocol_id = 
protocol_id;
23934efe3748f6 Cristian Marussi 2021-03-16  1276        devres_add(&sdev->dev, 
dres);
23934efe3748f6 Cristian Marussi 2021-03-16  1277  
23934efe3748f6 Cristian Marussi 2021-03-16 @1278        *ph = &pi->ph;
23934efe3748f6 Cristian Marussi 2021-03-16  1279  
23934efe3748f6 Cristian Marussi 2021-03-16  1280        return pi->proto->ops;
23934efe3748f6 Cristian Marussi 2021-03-16  1281  }
23934efe3748f6 Cristian Marussi 2021-03-16  1282  

:::::: The code at line 1278 was first introduced by commit
:::::: 23934efe3748f6d9d8ac0760178a5ef1ed8320f4 firmware: arm_scmi: Introduce 
devres get/put protocols operations

:::::: TO: Cristian Marussi <[email protected]>
:::::: CC: Sudeep Holla <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to