From owner-svn-src-stable-7@FreeBSD.ORG Mon Sep 20 19:17:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04BD51065674; Mon, 20 Sep 2010 19:17:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E78A38FC16; Mon, 20 Sep 2010 19:17:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KJHVI5064220; Mon, 20 Sep 2010 19:17:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KJHVbm064218; Mon, 20 Sep 2010 19:17:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201009201917.o8KJHVbm064218@svn.freebsd.org> From: John Baldwin Date: Mon, 20 Sep 2010 19:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212919 - stable/7/usr.sbin/pciconf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 19:17:32 -0000 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)