Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci this could have never worked. Cleanup bogus code.



details:   https://anonhg.NetBSD.org/src/rev/5c27d1d76de6
branches:  trunk
changeset: 787691:5c27d1d76de6
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jun 28 15:26:57 2013 +0000

description:
this could have never worked. Cleanup bogus code.
http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html

diffstat:

 sys/dev/pci/pm2fb.c |  22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diffs (46 lines):

diff -r 21da68ba3cc9 -r 5c27d1d76de6 sys/dev/pci/pm2fb.c
--- a/sys/dev/pci/pm2fb.c       Fri Jun 28 15:04:35 2013 +0000
+++ b/sys/dev/pci/pm2fb.c       Fri Jun 28 15:26:57 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pm2fb.c,v 1.21 2012/10/06 14:41:40 macallan Exp $      */
+/*     $NetBSD: pm2fb.c,v 1.22 2013/06/28 15:26:57 christos Exp $      */
 
 /*
  * Copyright (c) 2009, 2012 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pm2fb.c,v 1.21 2012/10/06 14:41:40 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm2fb.c,v 1.22 2013/06/28 15:26:57 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1342,19 +1342,17 @@
                 * best one we can support
                 */
                if (sc->sc_videomode == NULL) {
-                       int n;
                        struct videomode *m = sc->sc_ei.edid_modes;
 
                        sort_modes(sc->sc_ei.edid_modes,
-                                   &sc->sc_ei.edid_preferred_mode,
-                                   sc->sc_ei.edid_nmodes);
-                       while ((sc->sc_videomode == NULL) &&
-                              (n < sc->sc_ei.edid_nmodes)) {
-                               if (MODE_IS_VALID(&m[n])) {
-                                       sc->sc_videomode = &m[n];
-                               }
-                               n++;
-                       }
+                           &sc->sc_ei.edid_preferred_mode,
+                           sc->sc_ei.edid_nmodes);
+                       if (sc->sc_videomode == NULL)
+                               for (int n = 0; n < sc->sc_ei.edid_nmodes; n++)
+                                       if (MODE_IS_VALID(&m[n])) {
+                                               sc->sc_videomode = &m[n];
+                                               break;
+                                       }
                }
        }
        if (sc->sc_videomode == NULL) {



Home | Main Index | Thread Index | Old Index