diff mbox

[libdrm,2/7] nouveau: remove always-true #ifdef guards

Message ID 20180126113047.25658-2-eric.engestrom@imgtec.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Engestrom Jan. 26, 2018, 11:30 a.m. UTC
`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(-)

Comments

Emil Velikov Jan. 26, 2018, 5:19 p.m. UTC | #1
On 26 January 2018 at 11:30, Eric Engestrom <eric.engestrom@imgtec.com> wrote:
> `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)
>
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
diff mbox

Patch

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 {