[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202207081436.xHlkVYWP-lkp@intel.com>
Date: Fri, 8 Jul 2022 14:10:37 +0800
From: kernel test robot <lkp@...el.com>
To: Hector Martin <marcan@...can.st>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [asahilinux:t8112/bringup 11/19]
drivers/spmi/spmi-apple-controller.c:98:22: warning: variable 'rsp' set but
not used
tree: https://github.com/AsahiLinux/linux t8112/bringup
head: 0e7640fed025ba0ce4b845a0bbf2a5fdceab631d
commit: b781679f65b2f7b376e32d2b8b7f9283dfb94f5d [11/19] spmi: apple: Properly wait for status data after write
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20220708/202207081436.xHlkVYWP-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/AsahiLinux/linux/commit/b781679f65b2f7b376e32d2b8b7f9283dfb94f5d
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux t8112/bringup
git checkout b781679f65b2f7b376e32d2b8b7f9283dfb94f5d
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash drivers/hid/ drivers/spmi/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
drivers/spmi/spmi-apple-controller.c: In function 'spmi_write_cmd':
>> drivers/spmi/spmi-apple-controller.c:98:22: warning: variable 'rsp' set but not used [-Wunused-but-set-variable]
98 | volatile u32 rsp;
| ^~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for APPLE_ADMAC
Depends on DMADEVICES && (ARCH_APPLE || COMPILE_TEST
Selected by
- SND_SOC_APPLE_MCA && SOUND && !UML && SND && SND_SOC && (ARCH_APPLE || COMPILE_TEST
vim +/rsp +98 drivers/spmi/spmi-apple-controller.c
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 92
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 93 static int spmi_write_cmd(struct spmi_controller *ctrl,
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 94 u8 opc, u8 slave_id, u16 slave_addr, const u8 *__buf, size_t bc)
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 95 {
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 96 struct apple_spmi *spmi;
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 97 u32 spmi_cmd = opc|slave_id<<8|slave_addr<<16|(bc-1)|(1<<15);
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 @98 volatile u32 rsp;
b781679f65b2f7 Hector Martin 2022-07-02 99 volatile u32 status;
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 100 size_t i=0,j;
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 101
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 102 spmi = spmi_controller_get_drvdata(ctrl);
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 103
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 104 write_reg(spmi_cmd, spmi, SPMI_CMD_REG);
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 105
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 106 while (i<bc) {
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 107 j=0;
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 108 spmi_cmd=0;
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 109 while ((j<4)&(i<bc)) {
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 110 spmi_cmd |= __buf[i++]<<(j++*8);
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 111 }
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 112 write_reg(spmi_cmd, spmi, SPMI_CMD_REG);
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 113 }
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 114
b781679f65b2f7 Hector Martin 2022-07-02 115 /* Wait for Rx FIFO to have something */
b781679f65b2f7 Hector Martin 2022-07-02 116 /* Quite ugly msleep, need to find a better way to do it */
b781679f65b2f7 Hector Martin 2022-07-02 117 i=0;
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 118 do {
b781679f65b2f7 Hector Martin 2022-07-02 119 status=read_reg(spmi, SPMI_STATUS_REG);
b781679f65b2f7 Hector Martin 2022-07-02 120 msleep(10);
b781679f65b2f7 Hector Martin 2022-07-02 121 i+=1;
b781679f65b2f7 Hector Martin 2022-07-02 122 } while ((status & SPMI_RX_FIFO_EMPTY) && i<5);
b781679f65b2f7 Hector Martin 2022-07-02 123
b781679f65b2f7 Hector Martin 2022-07-02 124 if(i>=5){
b781679f65b2f7 Hector Martin 2022-07-02 125 dev_err(&ctrl->dev,"spmi_write_cmd:took to long to get the status");
b781679f65b2f7 Hector Martin 2022-07-02 126 return -1;
b781679f65b2f7 Hector Martin 2022-07-02 127 }
b781679f65b2f7 Hector Martin 2022-07-02 128
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 129 rsp = read_reg(spmi, SPMI_RSP_REG);
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 130
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 131 return 0;
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 132 }
6ebdfe55de1288 Jean-Francois Bortolotti 2022-02-04 133
:::::: The code at line 98 was first introduced by commit
:::::: 6ebdfe55de12883ccf9df0c84900873a1b349b1a spmi: add a first basic spmi driver for Apple SoC
:::::: TO: Jean-Francois Bortolotti <jeff@...to.fr>
:::::: CC: Hector Martin <marcan@...can.st>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists