From: Mathieu Desnoyers Date: Mon, 13 Apr 2020 16:20:27 +0000 (-0400) Subject: wrapper: Remove irqdesc wrapper X-Git-Tag: for-upstreaming-review-1~103 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=751f85fefa16030216faf0c582de8bbd23a80e68;p=lttng-modules.git wrapper: Remove irqdesc wrapper --- diff --git a/Makefile b/Makefile index ebd355c7..4ae26b41 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ ifneq ($(KERNELRELEASE),) endif obj-$(CONFIG_LTTNG) += lttng-statedump.o - lttng-statedump-objs := lttng-statedump-impl.o wrapper/irqdesc.o \ + lttng-statedump-objs := lttng-statedump-impl.o \ wrapper/fdtable.o obj-$(CONFIG_LTTNG) += probes/ diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c index 9dc0eb19..ace81a3d 100644 --- a/lttng-statedump-impl.c +++ b/lttng-statedump-impl.c @@ -35,7 +35,6 @@ #include #include -#include #include #include #include @@ -346,7 +345,6 @@ int lttng_list_interrupts(struct lttng_session *session) unsigned long flags = 0; struct irq_desc *desc; -#define irq_to_desc wrapper_irq_to_desc /* needs irq_desc */ for_each_irq_desc(irq, desc) { struct irqaction *action; @@ -363,7 +361,6 @@ int lttng_list_interrupts(struct lttng_session *session) local_irq_restore(flags); } return 0; -#undef irq_to_desc } #else static inline diff --git a/wrapper/irqdesc.c b/wrapper/irqdesc.c deleted file mode 100644 index a85a855e..00000000 --- a/wrapper/irqdesc.c +++ /dev/null @@ -1,48 +0,0 @@ -/* SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only) - * - * wrapper/irqdesc.c - * - * wrapper around irq_to_desc. Using KALLSYMS to get its address when - * available, else we need to have a kernel that exports this function to GPL - * modules. This export was added to the 3.4 kernels. - * - * Copyright (C) 2011-2012 Mathieu Desnoyers - */ - -#include - -#if (defined(CONFIG_KALLSYMS) \ - && (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))) - -#include -#include -#include -#include -#include - -static -struct irq_desc *(*irq_to_desc_sym)(unsigned int irq); - -struct irq_desc *wrapper_irq_to_desc(unsigned int irq) -{ - if (!irq_to_desc_sym) - irq_to_desc_sym = (void *) kallsyms_lookup_funcptr("irq_to_desc"); - if (irq_to_desc_sym) { - return irq_to_desc_sym(irq); - } else { - printk_once(KERN_WARNING "LTTng: irq_to_desc symbol lookup failed.\n"); - return NULL; - } -} - -#else - -#include -#include - -struct irq_desc *wrapper_irq_to_desc(unsigned int irq) -{ - return irq_to_desc(irq); -} - -#endif diff --git a/wrapper/irqdesc.h b/wrapper/irqdesc.h deleted file mode 100644 index d2032302..00000000 --- a/wrapper/irqdesc.h +++ /dev/null @@ -1,20 +0,0 @@ -/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) - * - * wrapper/irqdesc.h - * - * wrapper around irq_to_desc. Using KALLSYMS to get its address when - * available, else we need to have a kernel that exports this function to GPL - * modules. - * - * Copyright (C) 2011-2012 Mathieu Desnoyers - */ - -#ifndef _LTTNG_WRAPPER_IRQDESC_H -#define _LTTNG_WRAPPER_IRQDESC_H - -#include -#include - -struct irq_desc *wrapper_irq_to_desc(unsigned int irq); - -#endif /* _LTTNG_WRAPPER_IRQDESC_H */