svn commit: r212919 - stable/7/usr.sbin/pciconf

John Baldwin jhb at FreeBSD.org
Mon Sep 20 19:17:32 UTC 2010


Author: jhb
Date: Mon Sep 20 19:17:31 2010
New Revision: 212919
URL: http://svn.freebsd.org/changeset/base/212919

Log:
  MFC 212329:
  Simplify chkattached().  The PCIOCATTACHED ioctl only needs the pi_sel
  field populated, it ignores the rest of the 'pci_io' structure.

Modified:
  stable/7/usr.sbin/pciconf/pciconf.c
Directory Properties:
  stable/7/usr.sbin/pciconf/   (props changed)

Modified: stable/7/usr.sbin/pciconf/pciconf.c
==============================================================================
--- stable/7/usr.sbin/pciconf/pciconf.c	Mon Sep 20 19:17:21 2010	(r212918)
+++ stable/7/usr.sbin/pciconf/pciconf.c	Mon Sep 20 19:17:31 2010	(r212919)
@@ -75,7 +75,7 @@ static const char *guess_subclass(struct
 static int load_vendors(void);
 static void readit(const char *, const char *, int);
 static void writeit(const char *, const char *, const char *, int);
-static void chkattached(const char *, int);
+static void chkattached(const char *);
 
 static int exitstatus = 0;
 
@@ -148,8 +148,7 @@ main(int argc, char **argv)
 	if (listmode) {
 		list_devs(verbose, bars, caps);
 	} else if (attachedmode) {
-		chkattached(argv[optind],
-		       byte ? 1 : isshort ? 2 : 4);
+		chkattached(argv[optind]);
 	} else if (readmode) {
 		readit(argv[optind], argv[optind + 1],
 		       byte ? 1 : isshort ? 2 : 4);
@@ -645,15 +644,12 @@ writeit(const char *name, const char *re
 }
 
 static void
-chkattached(const char *name, int width)
+chkattached(const char *name)
 {
 	int fd;
 	struct pci_io pi;
 
 	pi.pi_sel = getsel(name);
-	pi.pi_reg = 0;
-	pi.pi_width = width;
-	pi.pi_data = 0;
 
 	fd = open(_PATH_DEVPCI, O_RDWR, 0);
 	if (fd < 0)


More information about the svn-src-all mailing list