From ac30f53240eb3296851f8d8d691ec36bfde92307 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 26 Mar 2022 15:22:10 -0700 Subject: [PATCH] of.h: Improve of_match_node() Suppress the following compiler warning if CONFIG_OF=n: > drivers/scsi/ufs-drivers/ufs-hisi.c:560:34: warning: unused variable 'ufs_hisi_of_match' [-Wunused-const-variable] Signed-off-by: Bart Van Assche --- include/linux/of.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/linux/of.h b/include/linux/of.h index 2dc77430a91abf..f4602ce0bfa458 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -854,8 +854,14 @@ static inline phys_addr_t of_dma_get_max_cpu_address(struct device_node *np) return PHYS_ADDR_MAX; } -#define of_match_ptr(_ptr) NULL -#define of_match_node(_matches, _node) NULL +#define of_match_ptr(_ptr) ((_ptr), NULL) + +static inline const struct of_device_id * +of_match_node(const struct of_device_id *matches, + const struct device_node *node) +{ + return NULL; +} #endif /* CONFIG_OF */ /* Default string compare functions, Allow arch asm/prom.h to override */