Skip to content

Commit de02697

Browse files
Ren Zhijiejoergroedel
authored andcommitted
ACPI/IORT: Fix build error implicit-function-declaration
If CONFIG_ACPI_IORT=y and CONFIG_IOMMU_API is not set, make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-, will be failed, like this: drivers/acpi/arm64/iort.c: In function ‘iort_get_rmr_sids’: drivers/acpi/arm64/iort.c:1406:2: error: implicit declaration of function ‘iort_iommu_rmr_get_resv_regions’; did you mean ‘iort_iommu_get_resv_regions’? [-Werror=implicit-function-declaration] iort_iommu_rmr_get_resv_regions(iommu_fwnode, NULL, head); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ iort_iommu_get_resv_regions cc1: some warnings being treated as errors make[3]: *** [drivers/acpi/arm64/iort.o] Error 1 The function iort_iommu_rmr_get_resv_regions() is declared under CONFIG_IOMMU_API, and the callers of iort_get_rmr_sids() and iort_put_rmr_sids() would select IOMMU_API. To fix this error, move the definitions to #ifdef CONFIG_IOMMU_API. Fixes: e302eea ("ACPI/IORT: Add a helper to retrieve RMR info directly") Signed-off-by: Ren Zhijie <[email protected]> Acked-by: Hanjun Guo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 1dcef3d commit de02697

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

drivers/acpi/arm64/iort.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,34 @@ void iort_iommu_get_resv_regions(struct device *dev, struct list_head *head)
11621162
iort_iommu_rmr_get_resv_regions(fwspec->iommu_fwnode, dev, head);
11631163
}
11641164

1165+
/**
1166+
* iort_get_rmr_sids - Retrieve IORT RMR node reserved regions with
1167+
* associated StreamIDs information.
1168+
* @iommu_fwnode: fwnode associated with IOMMU
1169+
* @head: Resereved region list
1170+
*/
1171+
void iort_get_rmr_sids(struct fwnode_handle *iommu_fwnode,
1172+
struct list_head *head)
1173+
{
1174+
iort_iommu_rmr_get_resv_regions(iommu_fwnode, NULL, head);
1175+
}
1176+
EXPORT_SYMBOL_GPL(iort_get_rmr_sids);
1177+
1178+
/**
1179+
* iort_put_rmr_sids - Free memory allocated for RMR reserved regions.
1180+
* @iommu_fwnode: fwnode associated with IOMMU
1181+
* @head: Resereved region list
1182+
*/
1183+
void iort_put_rmr_sids(struct fwnode_handle *iommu_fwnode,
1184+
struct list_head *head)
1185+
{
1186+
struct iommu_resv_region *entry, *next;
1187+
1188+
list_for_each_entry_safe(entry, next, head, list)
1189+
entry->free(NULL, entry);
1190+
}
1191+
EXPORT_SYMBOL_GPL(iort_put_rmr_sids);
1192+
11651193
static inline bool iort_iommu_driver_enabled(u8 type)
11661194
{
11671195
switch (type) {
@@ -1394,34 +1422,6 @@ int iort_dma_get_ranges(struct device *dev, u64 *size)
13941422
return nc_dma_get_range(dev, size);
13951423
}
13961424

1397-
/**
1398-
* iort_get_rmr_sids - Retrieve IORT RMR node reserved regions with
1399-
* associated StreamIDs information.
1400-
* @iommu_fwnode: fwnode associated with IOMMU
1401-
* @head: Resereved region list
1402-
*/
1403-
void iort_get_rmr_sids(struct fwnode_handle *iommu_fwnode,
1404-
struct list_head *head)
1405-
{
1406-
iort_iommu_rmr_get_resv_regions(iommu_fwnode, NULL, head);
1407-
}
1408-
EXPORT_SYMBOL_GPL(iort_get_rmr_sids);
1409-
1410-
/**
1411-
* iort_put_rmr_sids - Free memory allocated for RMR reserved regions.
1412-
* @iommu_fwnode: fwnode associated with IOMMU
1413-
* @head: Resereved region list
1414-
*/
1415-
void iort_put_rmr_sids(struct fwnode_handle *iommu_fwnode,
1416-
struct list_head *head)
1417-
{
1418-
struct iommu_resv_region *entry, *next;
1419-
1420-
list_for_each_entry_safe(entry, next, head, list)
1421-
entry->free(NULL, entry);
1422-
}
1423-
EXPORT_SYMBOL_GPL(iort_put_rmr_sids);
1424-
14251425
static void __init acpi_iort_register_irq(int hwirq, const char *name,
14261426
int trigger,
14271427
struct resource *res)

0 commit comments

Comments
 (0)