Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Nov 2009 18:16:35 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r199230 - in head/sys/dev: dpms fb
Message-ID:  <200911121816.nACIGZrM038423@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Thu Nov 12 18:16:35 2009
New Revision: 199230
URL: http://svn.freebsd.org/changeset/base/199230

Log:
  - Remove a redundant check for dpms(4).
  - Test a cheaper function first.

Modified:
  head/sys/dev/dpms/dpms.c
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/dpms/dpms.c
==============================================================================
--- head/sys/dev/dpms/dpms.c	Thu Nov 12 17:56:56 2009	(r199229)
+++ head/sys/dev/dpms/dpms.c	Thu Nov 12 18:16:35 2009	(r199230)
@@ -125,12 +125,8 @@ static void
 dpms_identify(driver_t *driver, device_t parent)
 {
 
-	/* The DPMS VBE only allows for manipulating a single monitor. */
-	if (devclass_get_device(dpms_devclass, 0) != NULL)
-		return;
-
-	if (x86bios_match_device(0xc0000, parent) &&
-	    device_get_flags(parent) != 0)
+	if (device_get_flags(parent) != 0 &&
+	    x86bios_match_device(0xc0000, parent))
 		device_add_child(parent, "dpms", 0);
 }
 

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Thu Nov 12 17:56:56 2009	(r199229)
+++ head/sys/dev/fb/vesa.c	Thu Nov 12 18:16:35 2009	(r199230)
@@ -250,8 +250,8 @@ vesa_bios_post(void)
 	dc = devclass_find("vgapci");
 	if (dc != NULL && devclass_get_devices(dc, &devs, &count) == 0) {
 		for (dev = NULL, i = 0; dev == NULL && i < count; devs++, i++)
-			if (x86bios_match_device(0xc0000, *devs) &&
-			    device_get_flags(*devs) != 0) {
+			if (device_get_flags(*devs) != 0 &&
+			    x86bios_match_device(0xc0000, *devs)) {
 				dev = *devs;
 				is_pci = 1;
 				break;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911121816.nACIGZrM038423>