Skip to contentSkip to conversation

drivers/acpi/riscv/rimt.c:248:31: warning: 'rimt_node_get_id' defined but not used

PATCH kernel test robot 1 participant 1 message Sep 27, 2025

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   262858079afde6d367ce3db183c74d8a43a0e83f
commit: 8f77295525825086cb43675cd1a4f3716b119d7f [5507/12740] ACPI: RISC-V: Add support for RIMT
config: riscv-randconfig-r111-20250927 (https://download.01.org/0day-ci/archive/20250928/[email protected]/config)
compiler: riscv64-linux-gcc (GCC) 9.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250928/[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]/

All warnings (new ones prefixed by >>):

>> drivers/acpi/riscv/rimt.c:248:31: warning: 'rimt_node_get_id' defined but not used [-Wunused-function]
     248 | static struct acpi_rimt_node *rimt_node_get_id(struct acpi_rimt_node *node,
         |                               ^~~~~~~~~~~~~~~~
>> drivers/acpi/riscv/rimt.c:238:12: warning: 'rimt_id_map' defined but not used [-Wunused-function]
     238 | static int rimt_id_map(struct acpi_rimt_id_mapping *map, u8 type, u32 rid_in, u32 *rid_out)
         |            ^~~~~~~~~~~
>> drivers/acpi/riscv/rimt.c:213:12: warning: 'rimt_iommu_xlate' defined but not used [-Wunused-function]

213 | static int rimt_iommu_xlate(struct device *dev, struct acpi_rimt_node *node, u32 deviceid)
| ^~~~~~~~~~~~~~~~
drivers/acpi/riscv/rimt.c:205:13: warning: 'rimt_pcie_rc_supports_ats' defined but not used [-Wunused-function]
205 | static bool rimt_pcie_rc_supports_ats(struct acpi_rimt_node *node)
| ^~~~~~~~~~~~~~~~~~~~~~~~~

vim +/rimt_node_get_id +248 drivers/acpi/riscv/rimt.c

212

 > 213	static int rimt_iommu_xlate(struct device *dev, struct acpi_rimt_node *node, u32 deviceid)
   214	{
   215		struct fwnode_handle *rimt_fwnode;
   216	
   217		if (!node)
   218			return -ENODEV;
   219	
   220		rimt_fwnode = rimt_get_fwnode(node);
   221	
   222		/*
   223		 * The IOMMU drivers may not be probed yet.
   224		 * Defer the IOMMU configuration
   225		 */
   226		if (!rimt_fwnode)
   227			return -EPROBE_DEFER;
   228	
   229		return acpi_iommu_fwspec_init(dev, deviceid, rimt_fwnode);
   230	}
   231	
   232	struct rimt_pci_alias_info {
   233		struct device *dev;
   234		struct acpi_rimt_node *node;
   235		const struct iommu_ops *ops;
   236	};
   237	
 > 238	static int rimt_id_map(struct acpi_rimt_id_mapping *map, u8 type, u32 rid_in, u32 *rid_out)
   239	{
   240		if (rid_in < map->source_id_base ||
   241		    (rid_in > map->source_id_base + map->num_ids))
   242			return -ENXIO;
   243	
   244		*rid_out = map->dest_id_base + (rid_in - map->source_id_base);
   245		return 0;
   246	}
   247	
 > 248	static struct acpi_rimt_node *rimt_node_get_id(struct acpi_rimt_node *node,

249 u32 *id_out, int index)
250 {
251 struct acpi_rimt_platform_device *plat_node;
252 u32 id_mapping_offset, num_id_mapping;
253 struct acpi_rimt_pcie_rc *pci_node;
254 struct acpi_rimt_id_mapping *map;
255 struct acpi_rimt_node *parent;
256
257 if (node->type == ACPI_RIMT_NODE_TYPE_PCIE_ROOT_COMPLEX) {
258 pci_node = (struct acpi_rimt_pcie_rc *)&node->node_data;
259 id_mapping_offset = pci_node->id_mapping_offset;
260 num_id_mapping = pci_node->num_id_mappings;
261 } else if (node->type == ACPI_RIMT_NODE_TYPE_PLAT_DEVICE) {
262 plat_node = (struct acpi_rimt_platform_device *)&node->node_data;
263 id_mapping_offset = plat_node->id_mapping_offset;
264 num_id_mapping = plat_node->num_id_mappings;
265 } else {
266 return NULL;
267 }
268
269 if (!id_mapping_offset || !num_id_mapping || index >= num_id_mapping)
270 return NULL;
271
272 map = ACPI_ADD_PTR(struct acpi_rimt_id_mapping, node,
273 id_mapping_offset + index * sizeof(*map));
274
275 /* Firmware bug! */
276 if (!map->dest_offset) {
277 pr_err(FW_BUG "[node %p type %d] ID map has NULL parent reference\n",
278 node, node->type);
279 return NULL;
280 }
281
282 parent = ACPI_ADD_PTR(struct acpi_rimt_node, rimt_table, map->dest_offset);
283
284 if (node->type == ACPI_RIMT_NODE_TYPE_PLAT_DEVICE ||
285 node->type == ACPI_RIMT_NODE_TYPE_PCIE_ROOT_COMPLEX) {
286 *id_out = map->dest_id_base;
287 return parent;
288 }
289
290 return NULL;
291 }
292

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