[android-common:android14-6.1 13/13] drivers/virt/gunyah/rsc_mgr.c:303:47: sparse: sparse: restricted __le32 degrades to integer

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://android.googlesource.com/kernel/common android14-6.1
head:   057f1cf6ccb302346c3799917ec8893efcd87011
commit: 4db95aa21ae4d2b0fc50c8e538e692bca8fd8c4c [13/13] ANDROID: virt: gunyah: Do not allocate irq for GH_RM_RESOURCE_NO_VIRQ
config: arm64-randconfig-r133-20260823 (https://download.01.org/0day-ci/archive/20260824/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 935bfc708590c60147a79c7df145bb6e68b1d388)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260824/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
>> drivers/virt/gunyah/rsc_mgr.c:303:47: sparse: sparse: restricted __le32 degrades to integer
   drivers/virt/gunyah/rsc_mgr.c:792:26: sparse: sparse: unsigned value that used to be signed checked against zero?
   drivers/virt/gunyah/rsc_mgr.c:791:38: sparse: signed value source

vim +303 drivers/virt/gunyah/rsc_mgr.c

   289	
   290	struct gh_resource *gh_rm_alloc_resource(struct gh_rm *rm, struct gh_rm_hyp_resource *hyp_resource)
   291	{
   292		struct gh_resource *ghrsc;
   293		int ret;
   294	
   295		ghrsc = kzalloc(sizeof(*ghrsc), GFP_KERNEL);
   296		if (!ghrsc)
   297			return NULL;
   298	
   299		ghrsc->type = hyp_resource->type;
   300		ghrsc->capid = le64_to_cpu(hyp_resource->cap_id);
   301		ghrsc->irq = IRQ_NOTCONNECTED;
   302		ghrsc->rm_label = le32_to_cpu(hyp_resource->resource_label);
 > 303		if (hyp_resource->virq && hyp_resource->virq != GH_RM_RESOURCE_NO_VIRQ) {
   304			struct gh_irq_chip_data irq_data = {
   305				.gh_virq = le32_to_cpu(hyp_resource->virq),
   306			};
   307	
   308			ret = irq_domain_alloc_irqs(rm->irq_domain, 1, NUMA_NO_NODE, &irq_data);
   309			if (ret < 0) {
   310				dev_err(rm->dev,
   311					"Failed to allocate interrupt for resource %d label: %d: %d\n",
   312					ghrsc->type, ghrsc->rm_label, ret);
   313				kfree(ghrsc);
   314				return NULL;
   315			} else {
   316				ghrsc->irq = ret;
   317			}
   318		}
   319	
   320		return ghrsc;
   321	}
   322	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.