From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6554280024411455004==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [zen:5.16/zen-sauce 3/22] drivers/i2c/busses/i2c-nct6775.c:221:39: warning: this statement may fall through Date: Mon, 31 Jan 2022 13:06:52 +0800 Message-ID: <202201311345.AIw7RfAS-lkp@intel.com> List-Id: --===============6554280024411455004== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable tree: https://github.com/zen-kernel/zen-kernel 5.16/zen-sauce head: 157e1814f25ab399070c421a96cdbf657f66a097 commit: 8444e1dc1a5996f3a19a1b14b3a6620cb9cf68b5 [3/22] ZEN: Add OpenRGB pa= tches config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20220= 131/202201311345.AIw7RfAS-lkp(a)intel.com/config) compiler: powerpc-linux-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 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/zen-kernel/zen-kernel/commit/8444e1dc1a5996f3a= 19a1b14b3a6620cb9cf68b5 git remote add zen https://github.com/zen-kernel/zen-kernel git fetch --no-tags zen 5.16/zen-sauce git checkout 8444e1dc1a5996f3a19a1b14b3a6620cb9cf68b5 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Dpowerpc SHELL=3D/bin/bash drivers/i2c/busses/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): drivers/i2c/busses/i2c-nct6775.c: In function 'nct6775_access': >> drivers/i2c/busses/i2c-nct6775.c:221:39: warning: this statement may fal= l through [-Wimplicit-fallthrough=3D] 221 | tmp_data.byte =3D data->byte; | ~~~~~~~~~~~~~~^~~~~~~~~~~~ drivers/i2c/busses/i2c-nct6775.c:222:17: note: here 222 | case I2C_SMBUS_BYTE: | ^~~~ At top level: drivers/i2c/busses/i2c-nct6775.c:93:27: warning: 'nct6775_device_names' = defined but not used [-Wunused-const-variable=3D] 93 | static const char * const nct6775_device_names[] =3D { | ^~~~~~~~~~~~~~~~~~~~ vim +221 drivers/i2c/busses/i2c-nct6775.c 197 = 198 /* Return negative errno on error. */ 199 static s32 nct6775_access(struct i2c_adapter * adap, u16 addr, 200 unsigned short flags, char read_write, 201 u8 command, int size, union i2c_smbus_data * data) 202 { 203 struct i2c_nct6775_adapdata *adapdata =3D i2c_get_adapdata(adap); 204 unsigned short nuvoton_nct6793d_smba =3D adapdata->smba; 205 int i, len, cnt; 206 union i2c_smbus_data tmp_data; 207 int timeout =3D 0; 208 = 209 tmp_data.word =3D 0; 210 cnt =3D 0; 211 len =3D 0; 212 = 213 outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL); 214 = 215 switch (size) { 216 case I2C_SMBUS_QUICK: 217 outb_p((addr << 1) | read_write, 218 SMBHSTADD); 219 break; 220 case I2C_SMBUS_BYTE_DATA: > 221 tmp_data.byte =3D data->byte; 222 case I2C_SMBUS_BYTE: 223 outb_p((addr << 1) | read_write, 224 SMBHSTADD); 225 outb_p(command, SMBHSTIDX); 226 if (read_write =3D=3D I2C_SMBUS_WRITE) { 227 outb_p(tmp_data.byte, SMBHSTDAT); 228 outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD); 229 } 230 else { 231 outb_p(NCT6793D_READ_BYTE, SMBHSTCMD); 232 } 233 break; 234 case I2C_SMBUS_WORD_DATA: 235 outb_p((addr << 1) | read_write, 236 SMBHSTADD); 237 outb_p(command, SMBHSTIDX); 238 if (read_write =3D=3D I2C_SMBUS_WRITE) { 239 outb_p(data->word & 0xff, SMBHSTDAT); 240 outb_p((data->word & 0xff00) >> 8, SMBHSTDAT); 241 outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD); 242 } 243 else { 244 outb_p(NCT6793D_READ_WORD, SMBHSTCMD); 245 } 246 break; 247 case I2C_SMBUS_BLOCK_DATA: 248 outb_p((addr << 1) | read_write, 249 SMBHSTADD); 250 outb_p(command, SMBHSTIDX); 251 if (read_write =3D=3D I2C_SMBUS_WRITE) { 252 len =3D data->block[0]; 253 if (len =3D=3D 0 || len > I2C_SMBUS_BLOCK_MAX) 254 return -EINVAL; 255 outb_p(len, SMBBLKSZ); 256 = 257 cnt =3D 1; 258 if (len >=3D 4) { 259 for (i =3D cnt; i <=3D 4; i++) { 260 outb_p(data->block[i], SMBHSTDAT); 261 } 262 = 263 len -=3D 4; 264 cnt +=3D 4; 265 } 266 else { 267 for (i =3D cnt; i <=3D len; i++ ) { 268 outb_p(data->block[i], SMBHSTDAT); 269 } 270 = 271 len =3D 0; 272 } 273 = 274 outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD); 275 } 276 else { 277 return -ENOTSUPP; 278 } 279 break; 280 default: 281 dev_warn(&adap->dev, "Unsupported transaction %d\n", size); 282 return -EOPNOTSUPP; 283 } 284 = 285 outb_p(NCT6793D_MANUAL_START, SMBHSTCTL); 286 = 287 while ((size =3D=3D I2C_SMBUS_BLOCK_DATA) && (len > 0)) { 288 if (read_write =3D=3D I2C_SMBUS_WRITE) { 289 timeout =3D 0; 290 while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) =3D=3D 0) 291 { 292 if(timeout > MAX_RETRIES) 293 { 294 return -ETIMEDOUT; 295 } 296 usleep_range(250, 500); 297 timeout++; 298 } 299 = 300 //Load more bytes into FIFO 301 if (len >=3D 4) { 302 for (i =3D cnt; i <=3D (cnt + 4); i++) { 303 outb_p(data->block[i], SMBHSTDAT); 304 } 305 = 306 len -=3D 4; 307 cnt +=3D 4; 308 } 309 else { 310 for (i =3D cnt; i <=3D (cnt + len); i++) { 311 outb_p(data->block[i], SMBHSTDAT); 312 } 313 = 314 len =3D 0; 315 } 316 } 317 else { 318 return -ENOTSUPP; 319 } 320 = 321 } 322 = 323 //wait for manual mode to complete 324 timeout =3D 0; 325 while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) !=3D 0) 326 { 327 if(timeout > MAX_RETRIES) 328 { 329 return -ETIMEDOUT; 330 } 331 usleep_range(250, 500); 332 timeout++; 333 } 334 = 335 if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) !=3D 0) { = 336 return -ENXIO; 337 } 338 else if ((read_write =3D=3D I2C_SMBUS_WRITE) || (size =3D=3D I2C_SM= BUS_QUICK)) { 339 return 0; 340 } 341 = 342 switch (size) { 343 case I2C_SMBUS_QUICK: 344 case I2C_SMBUS_BYTE_DATA: 345 data->byte =3D inb_p(SMBHSTDAT); 346 break; 347 case I2C_SMBUS_WORD_DATA: 348 data->word =3D inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8); 349 break; 350 } 351 return 0; 352 } 353 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org --===============6554280024411455004==--