Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm drm: Use {} instead of [] for...



details:   https://anonhg.NetBSD.org/src/rev/e2176fc0a404
branches:  trunk
changeset: 1029015:e2176fc0a404
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:43:22 2021 +0000

description:
drm: Use {} instead of [] for drm prints.

Using [] confuses dmesg timestamp parsing.  We should maybe fix that,
but this will serve for now.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_print.c |  31 +++++++++++++++++------------
 1 files changed, 18 insertions(+), 13 deletions(-)

diffs (81 lines):

diff -r 307a96e74e88 -r e2176fc0a404 sys/external/bsd/drm2/dist/drm/drm_print.c
--- a/sys/external/bsd/drm2/dist/drm/drm_print.c        Sun Dec 19 12:43:14 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_print.c        Sun Dec 19 12:43:22 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_print.c,v 1.14 2021/12/19 12:40:43 riastradh Exp $ */
+/*     $NetBSD: drm_print.c,v 1.15 2021/12/19 12:43:22 riastradh Exp $ */
 
 /*
  * Copyright (C) 2016 Red Hat
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_print.c,v 1.14 2021/12/19 12:40:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_print.c,v 1.15 2021/12/19 12:43:22 riastradh Exp $");
 
 #ifndef __NetBSD__             /* XXX ??? */
 #define DEBUG /* for pr_debug() */
@@ -207,7 +207,7 @@
 void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf)
 {
 #ifdef __NetBSD__
-       dev_info(p->arg, "[" DRM_NAME "] ");
+       dev_info(p->arg, "{" DRM_NAME "} ");
        vprintf(vaf->fmt, *vaf->va);    /* XXX */
 #else
        dev_info(p->arg, "[" DRM_NAME "] %pV", vaf);
@@ -308,10 +308,12 @@
        char symbuf[128];
 
        drm_symstr((vaddr_t)__builtin_return_address(0), symbuf, sizeof symbuf);
-       if (dev)
-               printf("%s [" DRM_NAME ":%s] ", device_xname(__UNCONST(dev)), symbuf);
-       else
-               printf("[" DRM_NAME ":%s] ", symbuf);
+       if (dev) {
+               printf("%s {" DRM_NAME ":%s} ", device_xname(__UNCONST(dev)),
+                   symbuf);
+       } else {
+               printf("{" DRM_NAME ":%s} ", symbuf);
+       }
 
        va_start(va, format);
        vprintf(format, va);
@@ -347,10 +349,12 @@
                return;
 
        drm_symstr((vaddr_t)__builtin_return_address(0), symbuf, sizeof symbuf);
-       if (dev)
-               printf("%s [" DRM_NAME ":%s] ", device_xname(__UNCONST(dev)), symbuf);
-       else
-               printf("[" DRM_NAME ":%s] ", symbuf);
+       if (dev) {
+               printf("%s {" DRM_NAME ":%s} ", device_xname(__UNCONST(dev)),
+                   symbuf);
+       } else {
+               printf("{" DRM_NAME ":%s} ", symbuf);
+       }
 
        va_start(va, format);
        vprintf(format, va);
@@ -387,8 +391,9 @@
        if (!(__drm_debug & category))
                return;
 
+       memset(symbuf, 0, sizeof symbuf);
        drm_symstr((vaddr_t)__builtin_return_address(0), symbuf, sizeof symbuf);
-       printf("[" DRM_NAME ":%s] ", symbuf);
+       printf("{" DRM_NAME ":%s} ", symbuf);
 
        va_start(va, format);
        vprintf(format, va);
@@ -419,7 +424,7 @@
        va_list va;
 
        drm_symstr((vaddr_t)__builtin_return_address(0), symbuf, sizeof symbuf);
-       printf("[" DRM_NAME ":%s] *ERROR* ", symbuf);
+       printf("{" DRM_NAME ":%s} *ERROR* ", symbuf);
 
        va_start(va, format);
        vprintf(format, va);



Home | Main Index | Thread Index | Old Index