Re: [PATCH] applesmc: Re-work SMC comms v1

From: kernel test robot
Date: Mon Nov 09 2020 - 04:28:46 EST


Hi Brad,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on hwmon/hwmon-next]
[also build test WARNING on v5.10-rc3 next-20201109]
[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]

url: https://github.com/0day-ci/linux/commits/Brad-Campbell/applesmc-Re-work-SMC-comms-v1/20201105-134944
base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: i386-randconfig-r022-20201109 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/db5e9737dcc2fec2ff3713bc346904d4b5ac5c0d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Brad-Campbell/applesmc-Re-work-SMC-comms-v1/20201105-134944
git checkout db5e9737dcc2fec2ff3713bc346904d4b5ac5c0d
# save the attached .config to linux build tree
make W=1 ARCH=i386

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

All warnings (new ones prefixed by >>):

drivers/hwmon/applesmc.c: In function 'send_command':
>> drivers/hwmon/applesmc.c:214:5: warning: variable 'status' set but not used [-Wunused-but-set-variable]
214 | u8 status;
| ^~~~~~

vim +/status +214 drivers/hwmon/applesmc.c

206
207 /*
208 * send_command - Write a command to the SMC. Callers must hold applesmc_lock.
209 * If SMC is in undefined state, any new command write resets the state machine.
210 */
211
212 static int send_command(u8 cmd)
213 {
> 214 u8 status;
215
216 if (wait_status(0,
217 SMC_STATUS_IB_CLOSED)) {
218 pr_warn("send_command SMC was busy\n");
219 goto fail; }
220
221 status = inb(APPLESMC_CMD_PORT);
222
223 outb(cmd, APPLESMC_CMD_PORT);
224 if (!wait_status(SMC_STATUS_BUSY,
225 SMC_STATUS_BUSY))
226 return 0;
227 fail:
228 pr_warn("send_cmd(0x%02x, 0x%04x) fail\n", cmd, APPLESMC_CMD_PORT);
229 return -EIO;
230 }
231

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

Attachment: .config.gz
Description: application/gzip