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/nouveau Don't store non-enume...



details:   https://anonhg.NetBSD.org/src/rev/98e87b34feaa
branches:  trunk
changeset: 813469:98e87b34feaa
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Jan 29 21:46:03 2016 +0000

description:
Don't store non-enumerated values in an enum.

Found by joerg.

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bios/dcb.h |   1 +
 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bios.c                 |  10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diffs (55 lines):

diff -r 590a2f677cd0 -r 98e87b34feaa sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bios/dcb.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bios/dcb.h     Fri Jan 29 21:45:00 2016 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bios/dcb.h     Fri Jan 29 21:46:03 2016 +0000
@@ -11,6 +11,7 @@
        DCB_OUTPUT_DP           = 0x6,
        DCB_OUTPUT_EOL          = 0xe,
        DCB_OUTPUT_UNUSED       = 0xf,
+       DCB_OUTPUT_MERGED       = 100,
        DCB_OUTPUT_ANY = -1,
 };
 
diff -r 590a2f677cd0 -r 98e87b34feaa sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bios.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bios.c     Fri Jan 29 21:45:00 2016 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bios.c     Fri Jan 29 21:46:03 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_bios.c,v 1.1.1.2 2014/08/06 12:36:23 riastradh Exp $   */
+/*     $NetBSD: nouveau_bios.c,v 1.2 2016/01/29 21:46:03 riastradh Exp $       */
 
 /*
  * Copyright 2005-2006 Erik Waling
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_bios.c,v 1.1.1.2 2014/08/06 12:36:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_bios.c,v 1.2 2016/01/29 21:46:03 riastradh Exp $");
 
 #include <subdev/bios.h>
 
@@ -1607,7 +1607,7 @@
                for (j = i + 1; j < dcb->entries; j++) {
                        struct dcb_output *jent = &dcb->entry[j];
 
-                       if (jent->type == 100) /* already merged entry */
+                       if (jent->type == DCB_OUTPUT_MERGED)
                                continue;
 
                        /* merge heads field when all other fields the same */
@@ -1618,14 +1618,14 @@
                                NV_INFO(drm, "Merging DCB entries %d and %d\n",
                                         i, j);
                                ient->heads |= jent->heads;
-                               jent->type = 100; /* dummy value */
+                               jent->type = DCB_OUTPUT_MERGED;
                        }
                }
        }
 
        /* Compact entries merged into others out of dcb */
        for (i = 0; i < dcb->entries; i++) {
-               if (dcb->entry[i].type == 100)
+               if (dcb->entry[i].type == DCB_OUTPUT_MERGED)
                        continue;
 
                if (newentries != i) {



Home | Main Index | Thread Index | Old Index