Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com --- configure.ac | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac index 35378b3384290f8e1e26..3fc4e7794cd974171c0a 100644 --- a/configure.ac +++ b/configure.ac @@ -197,7 +197,7 @@ dnl skipped and all flags rechecked. So there's no need to do anything dnl else. If for any reason you need to force a recheck, just change dnl MAYBE_WARN in an ignorable way (like adding whitespace)
-MAYBE_WARN="-Wall -Wextra \ +MAYBE_WARN="-Wall -Wextra -Wundef \ -Wsign-compare -Werror-implicit-function-declaration \ -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \ diff --git a/meson.build b/meson.build index d7a50cf96f905b53d37a..a410627fbf16a2c6d748 100644 --- a/meson.build +++ b/meson.build @@ -203,7 +203,7 @@ if cc.has_function('open_memstream') endif
warn_c_args = [] -foreach a : ['-Wall', '-Wextra', '-Wsign-compare', +foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Wundef', '-Werror-implicit-function-declaration', '-Wpointer-arith', '-Wwrite-strings', '-Wstrict-prototypes', '-Wmissing-prototypes', '-Wmissing-declarations', '-Wnested-externs', '-Wpacked',
`DEBUG` has always been defined since 292da616fe1f936ca78a3 "nouveau: pull in major libdrm rewrite" in 2011
Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com --- nouveau/Makefile.am | 3 +-- nouveau/nouveau.c | 4 ---- nouveau/private.h | 5 ----- 3 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/nouveau/Makefile.am b/nouveau/Makefile.am index 344a84454e420044afb5..60ebe243d4236e6aa814 100644 --- a/nouveau/Makefile.am +++ b/nouveau/Makefile.am @@ -4,8 +4,7 @@ AM_CFLAGS = \ $(WARN_CFLAGS) \ -I$(top_srcdir) \ $(PTHREADSTUBS_CFLAGS) \ - -I$(top_srcdir)/include/drm \ - -DDEBUG + -I$(top_srcdir)/include/drm
libdrm_nouveau_la_LTLIBRARIES = libdrm_nouveau.la libdrm_nouveau_ladir = $(libdir) diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c index e113a8fe780757a096b2..e68de16fe42c1953e9c0 100644 --- a/nouveau/nouveau.c +++ b/nouveau/nouveau.c @@ -50,7 +50,6 @@ #include "nvif/ioctl.h" #include "nvif/unpack.h"
-#ifdef DEBUG drm_private uint32_t nouveau_debug = 0;
static void @@ -62,7 +61,6 @@ debug_init(char *args) nouveau_debug = n; } } -#endif
static int nouveau_object_ioctl(struct nouveau_object *obj, void *data, uint32_t size) @@ -331,9 +329,7 @@ nouveau_drm_new(int fd, struct nouveau_drm **pdrm) struct nouveau_drm *drm; drmVersionPtr ver;
-#ifdef DEBUG debug_init(getenv("NOUVEAU_LIBDRM_DEBUG")); -#endif
if (!(drm = calloc(1, sizeof(*drm)))) return -ENOMEM; diff --git a/nouveau/private.h b/nouveau/private.h index 83060f965244fac3f087..8eca0a067195d7c5c54c 100644 --- a/nouveau/private.h +++ b/nouveau/private.h @@ -9,17 +9,12 @@
#include "nouveau.h"
-#ifdef DEBUG drm_private uint32_t nouveau_debug; #define dbg_on(lvl) (nouveau_debug & (1 << lvl)) #define dbg(lvl, fmt, args...) do { \ if (dbg_on((lvl))) \ fprintf(stderr, "nouveau: "fmt, ##args); \ } while(0) -#else -#define dbg_on(lvl) (0) -#define dbg(lvl, fmt, args...) -#endif #define err(fmt, args...) fprintf(stderr, "nouveau: "fmt, ##args)
struct nouveau_client_kref {
On 26 January 2018 at 11:30, Eric Engestrom eric.engestrom@imgtec.com wrote:
I've been meaning to ask Ben about the the DEBUG and SIMULATE bits in nouveau. The latter seems like a debug left-over (that we can drop), while the former is...
Ben can you shed some light?
-Emil
Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com --- xf86drmHash.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/xf86drmHash.c b/xf86drmHash.c index f287e61fb2b7a0051abb..b2fa414e5305f94cd12d 100644 --- a/xf86drmHash.c +++ b/xf86drmHash.c @@ -98,9 +98,6 @@ static unsigned long HashHash(unsigned long key) }
hash %= HASH_SIZE; -#if DEBUG - printf( "Hash(%lu) = %lu\n", key, hash); -#endif return hash; }
@@ -201,9 +198,6 @@ int drmHashInsert(void *t, unsigned long key, void *value) bucket->value = value; bucket->next = table->buckets[hash]; table->buckets[hash] = bucket; -#if DEBUG - printf("Inserted %lu at %lu/%p\n", key, hash, bucket); -#endif return 0; /* Added to table */ }
Fixes #if undefined warnings
Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/configure.ac b/configure.ac index 3fc4e7794cd974171c0a..a6df1a5f7fcd4576c5a8 100644 --- a/configure.ac +++ b/configure.ac @@ -259,9 +259,13 @@ AC_CACHE_CHECK([for native atomic primitives], drm_cv_atomic_primitives, [ if test "x$drm_cv_atomic_primitives" = xIntel; then AC_DEFINE(HAVE_LIBDRM_ATOMIC_PRIMITIVES, 1, [Enable if your compiler supports the Intel __sync_* atomic primitives]) +else + AC_DEFINE(HAVE_LIBDRM_ATOMIC_PRIMITIVES, 0) fi if test "x$drm_cv_atomic_primitives" = "xlibatomic-ops"; then AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 1, [Enable if you have libatomic-ops-dev installed]) +else + AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 0) fi
dnl Print out the approapriate message considering the value set be the
Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com --- tests/exynos/exynos_fimg2d_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/exynos/exynos_fimg2d_test.c b/tests/exynos/exynos_fimg2d_test.c index b71cf59351a6c0688c04..03a79c4e9d2579d71ed3 100644 --- a/tests/exynos/exynos_fimg2d_test.c +++ b/tests/exynos/exynos_fimg2d_test.c @@ -536,7 +536,7 @@ static int g2d_copy_with_scale_test(struct exynos_device *dev, return ret;; }
-#if EXYNOS_G2D_USERPTR_TEST +#ifdef EXYNOS_G2D_USERPTR_TEST static int g2d_blend_test(struct exynos_device *dev, struct exynos_bo *src, struct exynos_bo *dst, @@ -880,7 +880,7 @@ int main(int argc, char **argv) * * Disable the test for now, until the kernel code has been sanitized. */ -#if EXYNOS_G2D_USERPTR_TEST +#ifdef EXYNOS_G2D_USERPTR_TEST ret = g2d_blend_test(dev, src, bo, G2D_IMGBUF_USERPTR); if (ret < 0) fprintf(stderr, "failed to test blend operation.\n");
Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com --- configure.ac | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac index a6df1a5f7fcd4576c5a8..031e849bd0fc97d8762b 100644 --- a/configure.ac +++ b/configure.ac @@ -197,7 +197,7 @@ dnl skipped and all flags rechecked. So there's no need to do anything dnl else. If for any reason you need to force a recheck, just change dnl MAYBE_WARN in an ignorable way (like adding whitespace)
-MAYBE_WARN="-Wall -Wextra -Wundef \ +MAYBE_WARN="-Wall -Wextra -Werror=undef \ -Wsign-compare -Werror-implicit-function-declaration \ -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \ diff --git a/meson.build b/meson.build index a410627fbf16a2c6d748..1fd58b071bb90a49996e 100644 --- a/meson.build +++ b/meson.build @@ -203,7 +203,7 @@ if cc.has_function('open_memstream') endif
warn_c_args = [] -foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Wundef', +foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Werror=undef', '-Werror-implicit-function-declaration', '-Wpointer-arith', '-Wwrite-strings', '-Wstrict-prototypes', '-Wmissing-prototypes', '-Wmissing-declarations', '-Wnested-externs', '-Wpacked',
Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com --- meson.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build index 1fd58b071bb90a49996e..1bccdb2c03d7846e7bfb 100644 --- a/meson.build +++ b/meson.build @@ -207,8 +207,8 @@ foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Werror=undef', '-Werror-implicit-function-declaration', '-Wpointer-arith', '-Wwrite-strings', '-Wstrict-prototypes', '-Wmissing-prototypes', '-Wmissing-declarations', '-Wnested-externs', '-Wpacked', - '-Wswitch-enum', '-Wmissing-format-attribute', - '-Wstrict-aliasing=2', '-Winit-self', '-Winline', '-Wshadow', + '-Wswitch-enum', '-Wmissing-format-attribute', + '-Wstrict-aliasing=2', '-Winit-self', '-Winline', '-Wshadow', '-Wdeclaration-after-statement', '-Wold-style-definition'] if cc.has_argument(a) warn_c_args += a @@ -216,7 +216,7 @@ foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Werror=undef', endforeach # GCC will never error for -Wno-*, so check for -W* then add -Wno-* to the list # of options -foreach a : ['unused-parameter', 'attributes', 'long-long', +foreach a : ['unused-parameter', 'attributes', 'long-long', 'missing-field-initializers'] if cc.has_argument('-W@0@'.format(a)) warn_c_args += '-Wno-@0@'.format(a) @@ -326,7 +326,7 @@ pkg.generate( version : meson.project_version(), description : 'Userspace interface to kernel DRM services', ) - + if with_libkms subdir('libkms') endif
On Friday, 2018-01-26 09:45:14 -0800, Dylan Baker wrote:
Reviewed-by: Dylan Baker dylan@pnwbakers.com
Thanks :) Is that for this patch or the series?
On January 30, 2018 5:33:39 PM UTC, Dylan Baker dylan@pnwbakers.com wrote:
For the series :)
Thanks :)
I'm not pushing the nouveau patch until I get an ack, and the amdgpu sign patch needs a v2. I'll push the rest tomorrow.
On 26 January 2018 at 11:30, Eric Engestrom eric.engestrom@imgtec.com wrote:
Unless we have [m]any undef warnings, I'd just make that Werror=undef, across build systems.
-Emil
On Friday, 2018-01-26 17:14:06 +0000, Emil Velikov wrote:
This is what patch 6/7 of this series does. I chose to make it a two step thing, first enable the warning, fix the code, and then turn the warning into an error.
I guess I could just skip this patch, and introduce the warning as an error in 6/7.
-Emil
dri-devel@lists.freedesktop.org