Re: [PATCH 4/5] tpm_tis_spi: Remove limitation of transfers to MAX_SPI_FRAMESIZE bytes
From: kbuild test robot
Date: Thu Feb 16 2017 - 12:28:18 EST
Hi Peter,
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on v4.10-rc8 next-20170216]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Peter-Huewe/Fix-whole-native-SPI-TPM-driver/20170217-010419
config: x86_64-randconfig-x001-201707 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
All warnings (new ones prefixed by >>):
drivers/char/tpm/tpm_tis_spi.c: In function 'tpm_tis_spi_transfer':
>> drivers/char/tpm/tpm_tis_spi.c:135:9: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
return ret;
^~~
vim +/ret +135 drivers/char/tpm/tpm_tis_spi.c
dae9219c Peter Huewe 2017-02-16 119 spi_xfer.tx_buf = buffer;
dae9219c Peter Huewe 2017-02-16 120 spi_xfer.rx_buf = NULL;
dae9219c Peter Huewe 2017-02-16 121 }
0edbfea5 Christophe Ricard 2016-05-19 122
0edbfea5 Christophe Ricard 2016-05-19 123 spi_message_init(&m);
0edbfea5 Christophe Ricard 2016-05-19 124 spi_message_add_tail(&spi_xfer, &m);
0edbfea5 Christophe Ricard 2016-05-19 125 ret = spi_sync_locked(phy->spi_device, &m);
4dea582e Peter Huewe 2017-02-16 126 if (ret < 0)
4dea582e Peter Huewe 2017-02-16 127 goto exit;
4dea582e Peter Huewe 2017-02-16 128
4dea582e Peter Huewe 2017-02-16 129 len -= transfer_len;
4dea582e Peter Huewe 2017-02-16 130 buffer += transfer_len;
4dea582e Peter Huewe 2017-02-16 131 }
0edbfea5 Christophe Ricard 2016-05-19 132
0edbfea5 Christophe Ricard 2016-05-19 133 exit:
0edbfea5 Christophe Ricard 2016-05-19 134 spi_bus_unlock(phy->spi_device->master);
0edbfea5 Christophe Ricard 2016-05-19 @135 return ret;
0edbfea5 Christophe Ricard 2016-05-19 136 }
0edbfea5 Christophe Ricard 2016-05-19 137
dae9219c Peter Huewe 2017-02-16 138 static int tpm_tis_spi_read_bytes(struct tpm_tis_data *data, u32 addr,
dae9219c Peter Huewe 2017-02-16 139 u16 len, u8 *result)
0edbfea5 Christophe Ricard 2016-05-19 140 {
dae9219c Peter Huewe 2017-02-16 141 return tpm_tis_spi_transfer(data, addr, len, result, 0x80);
0edbfea5 Christophe Ricard 2016-05-19 142 }
0edbfea5 Christophe Ricard 2016-05-19 143
:::::: The code at line 135 was first introduced by commit
:::::: 0edbfea537d10c0de5505d0413368aad71027663 tpm/tpm_tis_spi: Add support for spi phy
:::::: TO: Christophe Ricard <christophe.ricard@xxxxxxxxx>
:::::: CC: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip