All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] drm: fix alpha build after drm_util.h change
@ 2019-01-14 18:04 Sam Ravnborg
  2019-01-15  6:03 ` Sam Ravnborg
  2019-01-15 21:48 ` [PATCH v2 " Sam Ravnborg
  0 siblings, 2 replies; 4+ messages in thread
From: Sam Ravnborg @ 2019-01-14 18:04 UTC (permalink / raw)
  To: dri-devel; +Cc: Maxime Ripard, Sam Ravnborg, David Airlie, Sean Paul

0-DAY reported the following bug:

tree:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head:   21376e2c3c5bad5e87ba700c055c8a8235c2bfd5
commit: e9eafcb589213395232084a2378e2e90f67feb29 [1/2] drm: move drm_can_sleep() to drm_util.h
config: alpha-allmodconfig (attached as .config)
...
   In file included from include/linux/irqflags.h:16:0,
                    from include/drm/drm_util.h:35,
                    from drivers/gpu/drm/qxl/qxl_cmd.c:28:
>> arch/alpha/include/asm/irqflags.h:58:15: error: unknown type name 'bool'
    static inline bool arch_irqs_disabled_flags(unsigned long flags)
                  ^~~~
...

So we have a situation where we do not pull in <linux/types.h>
when building for alpha.

An quick grep shows that roughly half of the declarations of
arch_irqs_disabled_flags() uses int as return type, the other half bool.

Two invasive fixes where considered:
- Change all declarations of arch_irqs_disabled_flags() to use bool
- Add include of <linux/types.h> to all files that uses bool for
  arch_irqs_disabled_flags

To invases with a too high pain/benefit ratio, so dropped.

Some less invasive fixes was also considered:
- Add include of <linux/types.h> to irqflags.h
- Add include of <linux/types.h> to qxl_cmd.c
- Add include of <linux/types.h> to drm_util.h

The first was dropped as irqflags.h did not use bool, so no need for the
types.h header file.

The latter was considered the best option as there could
be other similar cases and we would like the header files below
include/drm/ to be selfcontained.

It turns out that using the standard alphabetical order did not work
well as we then included irqflags.h before types.h.
It was considered just to pull in interrupt.h but that would
pull in a lot of unused stuff.
So in the end types.h was included with a comment that it must be first.

Build tested with alpha allmodconfig.

Fixes: 733748ac37b45 ("drm: move drm_can_sleep() to drm_util.h")
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
---
 include/drm/drm_util.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/drm/drm_util.h b/include/drm/drm_util.h
index 0500da65b1d1..0f550bc91db1 100644
--- a/include/drm/drm_util.h
+++ b/include/drm/drm_util.h
@@ -32,6 +32,8 @@
  * Macros and inline functions that does not naturally belong in other places
  */
 
+#include <linux/types.h>  /* Due to header dependencies this must be first */
+
 #include <linux/irqflags.h>
 #include <linux/preempt.h>
 #include <linux/kgdb.h>
-- 
2.12.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2019-01-16 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-14 18:04 [PATCH v1 1/1] drm: fix alpha build after drm_util.h change Sam Ravnborg
2019-01-15  6:03 ` Sam Ravnborg
2019-01-15 21:48 ` [PATCH v2 " Sam Ravnborg
2019-01-16 10:16   ` Daniel Vetter

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.