[ti:ti-linux-5.10.y 4688/9684] drivers/remoteproc/remoteproc_core.c:2104 rproc_boot() warn: inconsistent indenting

From: kernel test robot
Date: Sun Oct 24 2021 - 08:07:20 EST


tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-5.10.y
head: f22103162c771ddd47372b579682445e6dc8dd0e
commit: f84f01271e4e4deffc108645bc543ff9ced6960d [4688/9684] remoteproc: add infrastructure support for userspace driven loading
config: x86_64-randconfig-m001-20211014 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

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

smatch warnings:
drivers/remoteproc/remoteproc_core.c:2104 rproc_boot() warn: inconsistent indenting
drivers/remoteproc/remoteproc_core.c:2108 rproc_boot() error: uninitialized symbol 'firmware_p'.

vim +2104 drivers/remoteproc/remoteproc_core.c

4eb45c11141832 Suman Anna 2018-01-15 2049
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2050 /**
1b0ef9068f053d Suman Anna 2017-07-20 2051 * rproc_boot() - boot a remote processor
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2052 * @rproc: handle of a remote processor
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2053 *
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2054 * Boot a remote processor (i.e. load its firmware, power it on, ...).
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2055 *
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2056 * If the remote processor is already powered on, this function immediately
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2057 * returns (successfully).
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2058 *
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2059 * Returns 0 on success, and an appropriate error value otherwise.
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2060 */
1b0ef9068f053d Suman Anna 2017-07-20 2061 int rproc_boot(struct rproc *rproc)
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2062 {
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2063 const struct firmware *firmware_p;
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2064 struct device *dev;
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2065 int ret;
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2066
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2067 if (!rproc) {
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2068 pr_err("invalid rproc handle\n");
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2069 return -EINVAL;
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2070 }
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2071
b5ab5e24e960b9 Ohad Ben-Cohen 2012-05-30 2072 dev = &rproc->dev;
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2073
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2074 ret = mutex_lock_interruptible(&rproc->lock);
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2075 if (ret) {
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2076 dev_err(dev, "can't lock rproc %s: %d\n", rproc->name, ret);
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2077 return ret;
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2078 }
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2079
2099c77d4af7d1 Sarangdhar Joshi 2017-01-23 2080 if (rproc->state == RPROC_DELETED) {
2099c77d4af7d1 Sarangdhar Joshi 2017-01-23 2081 ret = -ENODEV;
2099c77d4af7d1 Sarangdhar Joshi 2017-01-23 2082 dev_err(dev, "can't boot deleted rproc %s\n", rproc->name);
2099c77d4af7d1 Sarangdhar Joshi 2017-01-23 2083 goto unlock_mutex;
2099c77d4af7d1 Sarangdhar Joshi 2017-01-23 2084 }
2099c77d4af7d1 Sarangdhar Joshi 2017-01-23 2085
0f9dc562b721aa Mathieu Poirier 2020-07-14 2086 /* skip the boot or attach process if rproc is already powered up */
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2087 if (atomic_inc_return(&rproc->power) > 1) {
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2088 ret = 0;
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2089 goto unlock_mutex;
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2090 }
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2091
0f9dc562b721aa Mathieu Poirier 2020-07-14 2092 if (rproc->state == RPROC_DETACHED) {
0f9dc562b721aa Mathieu Poirier 2020-07-14 2093 dev_info(dev, "attaching to %s\n", rproc->name);
0f9dc562b721aa Mathieu Poirier 2020-07-14 2094
978f5ec648b16f Mathieu Poirier 2021-03-12 2095 ret = rproc_attach(rproc);
0f9dc562b721aa Mathieu Poirier 2020-07-14 2096 } else {
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2097 dev_info(dev, "powering up %s\n", rproc->name);
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2098
f84f01271e4e4d Suman Anna 2021-04-21 2099 if (!rproc->skip_firmware_load) {
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2100 /* load firmware */
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2101 ret = request_firmware(&firmware_p, rproc->firmware, dev);
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2102 if (ret < 0) {
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2103 dev_err(dev, "request_firmware failed: %d\n", ret);
400e64df6b237e Ohad Ben-Cohen 2011-10-20 @2104 goto downref_rproc;
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2105 }
f84f01271e4e4d Suman Anna 2021-04-21 2106 }
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2107
400e64df6b237e Ohad Ben-Cohen 2011-10-20 @2108 ret = rproc_fw_boot(rproc, firmware_p);
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2109
f84f01271e4e4d Suman Anna 2021-04-21 2110 if (!rproc->skip_firmware_load)
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2111 release_firmware(firmware_p);
0f9dc562b721aa Mathieu Poirier 2020-07-14 2112 }
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2113
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2114 downref_rproc:
fbb6aacb078285 Bjorn Andersson 2016-10-02 2115 if (ret)
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2116 atomic_dec(&rproc->power);
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2117 unlock_mutex:
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2118 mutex_unlock(&rproc->lock);
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2119 return ret;
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2120 }
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2121 EXPORT_SYMBOL(rproc_boot);
400e64df6b237e Ohad Ben-Cohen 2011-10-20 2122

:::::: The code at line 2104 was first introduced by commit
:::::: 400e64df6b237eb36b127efd72000a2794f9eec1 remoteproc: add framework for controlling remote processors

:::::: TO: Ohad Ben-Cohen <ohad@xxxxxxxxxx>
:::::: CC: Ohad Ben-Cohen <ohad@xxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip