[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210190747.5bjTZWP6-lkp@intel.com>
Date: Wed, 19 Oct 2022 07:51:26 +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:bits/120-spmi 16/16]
drivers/spmi/spmi-apple-controller.c:98:22: warning: variable 'rsp' set but
not used
tree: https://github.com/AsahiLinux/linux bits/120-spmi
head: ce1bdf8c49606fbbb6c1b1a7c17b56267a099c9e
commit: ce1bdf8c49606fbbb6c1b1a7c17b56267a099c9e [16/16] spmi: apple: Properly wait for status data after write
config: microblaze-allmodconfig
compiler: microblaze-linux-gcc (GCC) 12.1.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/ce1bdf8c49606fbbb6c1b1a7c17b56267a099c9e
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux bits/120-spmi
git checkout ce1bdf8c49606fbbb6c1b1a7c17b56267a099c9e
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=microblaze SHELL=/bin/bash drivers/spmi/ drivers/thermal/ net/sunrpc/auth_gss/
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;
| ^~~
vim +/rsp +98 drivers/spmi/spmi-apple-controller.c
219439f34db71b Jean-Francois Bortolotti 2022-02-04 92
219439f34db71b Jean-Francois Bortolotti 2022-02-04 93 static int spmi_write_cmd(struct spmi_controller *ctrl,
219439f34db71b Jean-Francois Bortolotti 2022-02-04 94 u8 opc, u8 slave_id, u16 slave_addr, const u8 *__buf, size_t bc)
219439f34db71b Jean-Francois Bortolotti 2022-02-04 95 {
219439f34db71b Jean-Francois Bortolotti 2022-02-04 96 struct apple_spmi *spmi;
219439f34db71b Jean-Francois Bortolotti 2022-02-04 97 u32 spmi_cmd = opc|slave_id<<8|slave_addr<<16|(bc-1)|(1<<15);
219439f34db71b Jean-Francois Bortolotti 2022-02-04 @98 volatile u32 rsp;
ce1bdf8c49606f Hector Martin 2022-07-02 99 volatile u32 status;
219439f34db71b Jean-Francois Bortolotti 2022-02-04 100 size_t i=0,j;
219439f34db71b Jean-Francois Bortolotti 2022-02-04 101
219439f34db71b Jean-Francois Bortolotti 2022-02-04 102 spmi = spmi_controller_get_drvdata(ctrl);
219439f34db71b Jean-Francois Bortolotti 2022-02-04 103
219439f34db71b Jean-Francois Bortolotti 2022-02-04 104 write_reg(spmi_cmd, spmi, SPMI_CMD_REG);
219439f34db71b Jean-Francois Bortolotti 2022-02-04 105
219439f34db71b Jean-Francois Bortolotti 2022-02-04 106 while (i<bc) {
219439f34db71b Jean-Francois Bortolotti 2022-02-04 107 j=0;
219439f34db71b Jean-Francois Bortolotti 2022-02-04 108 spmi_cmd=0;
219439f34db71b Jean-Francois Bortolotti 2022-02-04 109 while ((j<4)&(i<bc)) {
219439f34db71b Jean-Francois Bortolotti 2022-02-04 110 spmi_cmd |= __buf[i++]<<(j++*8);
219439f34db71b Jean-Francois Bortolotti 2022-02-04 111 }
219439f34db71b Jean-Francois Bortolotti 2022-02-04 112 write_reg(spmi_cmd, spmi, SPMI_CMD_REG);
219439f34db71b Jean-Francois Bortolotti 2022-02-04 113 }
219439f34db71b Jean-Francois Bortolotti 2022-02-04 114
ce1bdf8c49606f Hector Martin 2022-07-02 115 /* Wait for Rx FIFO to have something */
ce1bdf8c49606f Hector Martin 2022-07-02 116 /* Quite ugly msleep, need to find a better way to do it */
ce1bdf8c49606f Hector Martin 2022-07-02 117 i=0;
219439f34db71b Jean-Francois Bortolotti 2022-02-04 118 do {
ce1bdf8c49606f Hector Martin 2022-07-02 119 status=read_reg(spmi, SPMI_STATUS_REG);
ce1bdf8c49606f Hector Martin 2022-07-02 120 msleep(10);
ce1bdf8c49606f Hector Martin 2022-07-02 121 i+=1;
ce1bdf8c49606f Hector Martin 2022-07-02 122 } while ((status & SPMI_RX_FIFO_EMPTY) && i<5);
ce1bdf8c49606f Hector Martin 2022-07-02 123
ce1bdf8c49606f Hector Martin 2022-07-02 124 if(i>=5){
ce1bdf8c49606f Hector Martin 2022-07-02 125 dev_err(&ctrl->dev,"spmi_write_cmd:took to long to get the status");
ce1bdf8c49606f Hector Martin 2022-07-02 126 return -1;
ce1bdf8c49606f Hector Martin 2022-07-02 127 }
ce1bdf8c49606f Hector Martin 2022-07-02 128
219439f34db71b Jean-Francois Bortolotti 2022-02-04 129 rsp = read_reg(spmi, SPMI_RSP_REG);
219439f34db71b Jean-Francois Bortolotti 2022-02-04 130
219439f34db71b Jean-Francois Bortolotti 2022-02-04 131 return 0;
219439f34db71b Jean-Francois Bortolotti 2022-02-04 132 }
219439f34db71b Jean-Francois Bortolotti 2022-02-04 133
:::::: The code at line 98 was first introduced by commit
:::::: 219439f34db71b88394a31c0c110ce6c4782b5d7 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
View attachment "config" of type "text/plain" (308034 bytes)
Powered by blists - more mailing lists