* [broonie-spi:for-next 59/66] drivers/spi/spi-amd.c:296:21: warning: cast to smaller integer type 'enum amd_spi_versions' from 'const void *'
@ 2022-02-15 19:13 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-02-15 19:13 UTC (permalink / raw)
To: André Almeida; +Cc: llvm, kbuild-all, linux-spi, Mark Brown
tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
head: db91535d770445e1b61f6f7e4bdbd8cce45440c0
commit: 209043554915d7c51ac112a668ad1a255e1bea61 [59/66] spi: amd: Add support for version AMDI0062
config: x86_64-randconfig-a005-20220214 (https://download.01.org/0day-ci/archive/20220216/202202160331.TbQABF6V-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 37f422f4ac31c8b8041c6b62065263314282dab6)
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://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/commit/?id=209043554915d7c51ac112a668ad1a255e1bea61
git remote add broonie-spi https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
git fetch --no-tags broonie-spi for-next
git checkout 209043554915d7c51ac112a668ad1a255e1bea61
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/spi/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/spi/spi-amd.c:296:21: warning: cast to smaller integer type 'enum amd_spi_versions' from 'const void *' [-Wvoid-pointer-to-enum-cast]
amd_spi->version = (enum amd_spi_versions) device_get_match_data(dev);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
vim +296 drivers/spi/spi-amd.c
272
273 static int amd_spi_probe(struct platform_device *pdev)
274 {
275 struct device *dev = &pdev->dev;
276 struct spi_master *master;
277 struct amd_spi *amd_spi;
278 int err = 0;
279
280 /* Allocate storage for spi_master and driver private data */
281 master = spi_alloc_master(dev, sizeof(struct amd_spi));
282 if (!master) {
283 dev_err(dev, "Error allocating SPI master\n");
284 return -ENOMEM;
285 }
286
287 amd_spi = spi_master_get_devdata(master);
288 amd_spi->io_remap_addr = devm_platform_ioremap_resource(pdev, 0);
289 if (IS_ERR(amd_spi->io_remap_addr)) {
290 err = PTR_ERR(amd_spi->io_remap_addr);
291 dev_err(dev, "error %d ioremap of SPI registers failed\n", err);
292 goto err_free_master;
293 }
294 dev_dbg(dev, "io_remap_address: %p\n", amd_spi->io_remap_addr);
295
> 296 amd_spi->version = (enum amd_spi_versions) device_get_match_data(dev);
297
298 /* Initialize the spi_master fields */
299 master->bus_num = 0;
300 master->num_chipselect = 4;
301 master->mode_bits = 0;
302 master->flags = SPI_MASTER_HALF_DUPLEX;
303 master->setup = amd_spi_master_setup;
304 master->transfer_one_message = amd_spi_master_transfer;
305
306 /* Register the controller with SPI framework */
307 err = devm_spi_register_master(dev, master);
308 if (err) {
309 dev_err(dev, "error %d registering SPI controller\n", err);
310 goto err_free_master;
311 }
312
313 return 0;
314
315 err_free_master:
316 spi_master_put(master);
317
318 return err;
319 }
320
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-02-15 19:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-15 19:13 [broonie-spi:for-next 59/66] drivers/spi/spi-amd.c:296:21: warning: cast to smaller integer type 'enum amd_spi_versions' from 'const void *' kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).