All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irqdomain: fix compiling when IRQ_DOMAIN unset
@ 2016-11-13 15:59 Stefan Christ
  2016-11-14 10:41 ` Marc Zyngier
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Christ @ 2016-11-13 15:59 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig, marc.zyngier; +Cc: linux-kernel

When config option IRQ_DOMAIN is unset, compiling the file
'drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c' fails:

      CC      drivers/gpu/drm/amd/amdgpu/amdgpu_irq.o
    drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c: In function ‘amdgpu_irq_dispatch’:
    drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:345:3: error: implicit declaration of
        function ‘irq_find_mapping’ [-Werror=implicit-function-declaration]
    drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c: In function ‘amdgpu_irq_add_domain’:
    drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:529:2: error: implicit declaration of
        function ‘irq_domain_add_linear’ [-Werror=implicit-function-declaration]
    drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c: In function ‘amdgpu_irq_remove_domain’:
    drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:550:3: error: implicit declaration of
        function ‘irq_domain_remove’ [-Werror=implicit-function-declaration]
    drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c: In function ‘amdgpu_irq_create_mapping’:
    drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:569:2: error: implicit declaration of
        function ‘irq_create_mapping’ [-Werror=implicit-function-declaration]

Adding the functions stubs in the header file so it compiles cleanly.
Maybe the drm driver 'amdgpu' should select the config option IRQ_DOMAIN
if it cannot work without it. But I don't know if that's necessary.

Signed-off-by: Stefan Christ <contact@stefanchrist.eu>
---
 include/linux/irqdomain.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index ffb8460..1c79a0d 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -480,6 +480,24 @@ static inline bool irq_domain_is_ipi_single(struct irq_domain *domain)
 #endif	/* CONFIG_IRQ_DOMAIN_HIERARCHY */
 
 #else /* CONFIG_IRQ_DOMAIN */
+static inline int irq_find_mapping(struct irq_domain *host,
+				   irq_hw_number_t hwirq)
+{
+	return 0;
+}
+static inline struct irq_domain *irq_domain_add_linear(
+				struct device_node *of_node, unsigned int size,
+				const struct irq_domain_ops *ops,
+				void *host_data)
+{
+	return NULL;
+}
+static inline void irq_domain_remove(struct irq_domain *host) { }
+static inline unsigned int irq_create_mapping(struct irq_domain *host,
+					      irq_hw_number_t hwirq)
+{
+	return 0;
+}
 static inline void irq_dispose_mapping(unsigned int virq) { }
 static inline void irq_domain_activate_irq(struct irq_data *data) { }
 static inline void irq_domain_deactivate_irq(struct irq_data *data) { }
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] irqdomain: fix compiling when IRQ_DOMAIN unset
  2016-11-13 15:59 [PATCH] irqdomain: fix compiling when IRQ_DOMAIN unset Stefan Christ
@ 2016-11-14 10:41 ` Marc Zyngier
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Zyngier @ 2016-11-14 10:41 UTC (permalink / raw)
  To: Stefan Christ, alexander.deucher, christian.koenig; +Cc: linux-kernel

Hi Stephan,

On 13/11/16 15:59, Stefan Christ wrote:
> When config option IRQ_DOMAIN is unset, compiling the file
> 'drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c' fails:
> 
>       CC      drivers/gpu/drm/amd/amdgpu/amdgpu_irq.o
>     drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c: In function ‘amdgpu_irq_dispatch’:
>     drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:345:3: error: implicit declaration of
>         function ‘irq_find_mapping’ [-Werror=implicit-function-declaration]
>     drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c: In function ‘amdgpu_irq_add_domain’:
>     drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:529:2: error: implicit declaration of
>         function ‘irq_domain_add_linear’ [-Werror=implicit-function-declaration]
>     drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c: In function ‘amdgpu_irq_remove_domain’:
>     drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:550:3: error: implicit declaration of
>         function ‘irq_domain_remove’ [-Werror=implicit-function-declaration]
>     drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c: In function ‘amdgpu_irq_create_mapping’:
>     drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:569:2: error: implicit declaration of
>         function ‘irq_create_mapping’ [-Werror=implicit-function-declaration]
> 
> Adding the functions stubs in the header file so it compiles cleanly.
> Maybe the drm driver 'amdgpu' should select the config option IRQ_DOMAIN
> if it cannot work without it. But I don't know if that's necessary.

This looks like the wrong fix to me, as you just end-up with a
non-functional driver which will compiles just fine, making it even
harder to find out what's wrong with it.

Selecting IRQ_DOMAIN is a much saner option.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-14 10:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-13 15:59 [PATCH] irqdomain: fix compiling when IRQ_DOMAIN unset Stefan Christ
2016-11-14 10:41 ` Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.