lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202209061133.jHAJuknr-lkp@intel.com>
Date:   Tue, 6 Sep 2022 11:27:22 +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 4/4]
 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:   33e70ed8b3323f4b2dfa8d754265410a0df10e09
commit: 33e70ed8b3323f4b2dfa8d754265410a0df10e09 [4/4] spmi: apple: Properly wait for status data after write
config: x86_64-buildonly-randconfig-r001-20220905
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/AsahiLinux/linux/commit/33e70ed8b3323f4b2dfa8d754265410a0df10e09
        git remote add asahilinux https://github.com/AsahiLinux/linux
        git fetch --no-tags asahilinux bits/120-spmi
        git checkout 33e70ed8b3323f4b2dfa8d754265410a0df10e09
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash 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;
         |                      ^~~


vim +/rsp +98 drivers/spmi/spmi-apple-controller.c

a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04   92  
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04   93  static int spmi_write_cmd(struct spmi_controller *ctrl,
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04   94  			  u8 opc, u8 slave_id, u16 slave_addr, const u8 *__buf, size_t bc)
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04   95  {
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04   96      struct apple_spmi *spmi;
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04   97  	u32 spmi_cmd = opc|slave_id<<8|slave_addr<<16|(bc-1)|(1<<15);
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  @98  	volatile u32 rsp;
33e70ed8b3323f Hector Martin            2022-07-02   99  	volatile u32 status;
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  100  	size_t i=0,j;
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  101  
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  102  	spmi = spmi_controller_get_drvdata(ctrl);
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  103  
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  104  	write_reg(spmi_cmd, spmi, SPMI_CMD_REG);
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  105  
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  106  	while (i<bc) {
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  107  		j=0;
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  108  		spmi_cmd=0;
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  109  		while ((j<4)&(i<bc)) {
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  110  			spmi_cmd |= __buf[i++]<<(j++*8);
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  111  		}
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  112  		write_reg(spmi_cmd, spmi, SPMI_CMD_REG);
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  113  	}
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  114  
33e70ed8b3323f Hector Martin            2022-07-02  115  	/* Wait for Rx FIFO to have something */
33e70ed8b3323f Hector Martin            2022-07-02  116  	/* Quite ugly msleep, need to find a better way to do it */
33e70ed8b3323f Hector Martin            2022-07-02  117  	i=0;
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  118  	do {
33e70ed8b3323f Hector Martin            2022-07-02  119  		status=read_reg(spmi, SPMI_STATUS_REG);
33e70ed8b3323f Hector Martin            2022-07-02  120  		msleep(10);
33e70ed8b3323f Hector Martin            2022-07-02  121  		i+=1;
33e70ed8b3323f Hector Martin            2022-07-02  122  	} while ((status & SPMI_RX_FIFO_EMPTY) && i<5);
33e70ed8b3323f Hector Martin            2022-07-02  123  
33e70ed8b3323f Hector Martin            2022-07-02  124  	if(i>=5){
33e70ed8b3323f Hector Martin            2022-07-02  125  		dev_err(&ctrl->dev,"spmi_write_cmd:took to long to get the status");
33e70ed8b3323f Hector Martin            2022-07-02  126  		return -1;
33e70ed8b3323f Hector Martin            2022-07-02  127  	}
33e70ed8b3323f Hector Martin            2022-07-02  128  
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  129  	rsp = read_reg(spmi, SPMI_RSP_REG);
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  130  
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  131  	return 0;
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  132  }
a534d42ff22c9c Jean-Francois Bortolotti 2022-02-04  133  

:::::: The code at line 98 was first introduced by commit
:::::: a534d42ff22c9c49b46ddf9bfe4f2da25b2a8e5a 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" (195678 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ