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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <202312142250.7GMllD1E-lkp@intel.com>
Date:   Thu, 14 Dec 2023 22:51:33 +0800
From:   kernel test robot <lkp@...el.com>
To:     Geoff Levand <geoff@...radead.org>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Alexander Duyck <alexanderduyck@...com>
Subject: drivers/net/ethernet/toshiba/ps3_gelic_net.c:330:33: sparse: sparse:
 incorrect type in assignment (different base types)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5bd7ef53ffe5ca580e93e74eb8c81ed191ddc4bd
commit: bebe933d35a63d4f042fbf4dce4f22e689ba0fcd net/ps3_gelic_net: Use dma_mapping_error
date:   9 months ago
config: powerpc64-randconfig-r122-20231213 (https://download.01.org/0day-ci/archive/20231214/202312142250.7GMllD1E-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20231214/202312142250.7GMllD1E-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312142250.7GMllD1E-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/toshiba/ps3_gelic_net.c:330:33: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] bus_addr @@     got restricted __be32 [usertype] @@
   drivers/net/ethernet/toshiba/ps3_gelic_net.c:330:33: sparse:     expected unsigned long long [usertype] bus_addr
   drivers/net/ethernet/toshiba/ps3_gelic_net.c:330:33: sparse:     got restricted __be32 [usertype]

vim +330 drivers/net/ethernet/toshiba/ps3_gelic_net.c

   295	
   296	/**
   297	 * gelic_card_init_chain - links descriptor chain
   298	 * @card: card structure
   299	 * @chain: address of chain
   300	 * @start_descr: address of descriptor array
   301	 * @no: number of descriptors
   302	 *
   303	 * we manage a circular list that mirrors the hardware structure,
   304	 * except that the hardware uses bus addresses.
   305	 *
   306	 * returns 0 on success, <0 on failure
   307	 */
   308	static int gelic_card_init_chain(struct gelic_card *card,
   309					 struct gelic_descr_chain *chain,
   310					 struct gelic_descr *start_descr, int no)
   311	{
   312		int i;
   313		struct gelic_descr *descr;
   314	
   315		descr = start_descr;
   316		memset(descr, 0, sizeof(*descr) * no);
   317	
   318		/* set up the hardware pointers in each descriptor */
   319		for (i = 0; i < no; i++, descr++) {
   320			dma_addr_t cpu_addr;
   321	
   322			gelic_descr_set_status(descr, GELIC_DESCR_DMA_NOT_IN_USE);
   323	
   324			cpu_addr = dma_map_single(ctodev(card), descr,
   325						  GELIC_DESCR_SIZE, DMA_BIDIRECTIONAL);
   326	
   327			if (dma_mapping_error(ctodev(card), cpu_addr))
   328				goto iommu_error;
   329	
 > 330			descr->bus_addr = cpu_to_be32(cpu_addr);
   331			descr->next = descr + 1;
   332			descr->prev = descr - 1;
   333		}
   334		/* make them as ring */
   335		(descr - 1)->next = start_descr;
   336		start_descr->prev = (descr - 1);
   337	
   338		/* chain bus addr of hw descriptor */
   339		descr = start_descr;
   340		for (i = 0; i < no; i++, descr++) {
   341			descr->next_descr_addr = cpu_to_be32(descr->next->bus_addr);
   342		}
   343	
   344		chain->head = start_descr;
   345		chain->tail = start_descr;
   346	
   347		/* do not chain last hw descriptor */
   348		(descr - 1)->next_descr_addr = 0;
   349	
   350		return 0;
   351	
   352	iommu_error:
   353		for (i--, descr--; 0 <= i; i--, descr--)
   354			if (descr->bus_addr)
   355				dma_unmap_single(ctodev(card), descr->bus_addr,
   356						 GELIC_DESCR_SIZE,
   357						 DMA_BIDIRECTIONAL);
   358		return -ENOMEM;
   359	}
   360	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ