From owner-svn-src-head@freebsd.org Thu Feb 18 15:23:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C8E8AACBBA; Thu, 18 Feb 2016 15:23:27 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D68B262; Thu, 18 Feb 2016 15:23:27 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1IFNQHF004341; Thu, 18 Feb 2016 15:23:26 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1IFNQk8004338; Thu, 18 Feb 2016 15:23:26 GMT (envelope-from se@FreeBSD.org) Message-Id: <201602181523.u1IFNQk8004338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Thu, 18 Feb 2016 15:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295760 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2016 15:23:27 -0000 Author: se Date: Thu Feb 18 15:23:25 2016 New Revision: 295760 URL: https://svnweb.freebsd.org/changeset/base/295760 Log: Make WARNS=6 safe. Tested with Clang 3.7.1, GCC 4.2.1 and GCC 4.8.5 on amd64. Modified: head/usr.sbin/pciconf/Makefile head/usr.sbin/pciconf/cap.c head/usr.sbin/pciconf/pciconf.c Modified: head/usr.sbin/pciconf/Makefile ============================================================================== --- head/usr.sbin/pciconf/Makefile Thu Feb 18 15:12:52 2016 (r295759) +++ head/usr.sbin/pciconf/Makefile Thu Feb 18 15:23:25 2016 (r295760) @@ -5,6 +5,4 @@ PROG= pciconf SRCS= pciconf.c cap.c err.c MAN= pciconf.8 -WARNS?= 3 - .include Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Thu Feb 18 15:12:52 2016 (r295759) +++ head/usr.sbin/pciconf/cap.c Thu Feb 18 15:23:25 2016 (r295760) @@ -120,6 +120,9 @@ static void cap_vpd(int fd, struct pci_conf *p, uint8_t ptr) { + (void)fd; /* UNUSED */ + (void)p; /* UNUSED */ + (void)ptr; /* UNUSED */ printf("VPD"); } @@ -172,6 +175,7 @@ cap_pcix(int fd, struct pci_conf *p, uin } if ((p->pc_hdr & PCIM_HDRTYPE) == 1) return; + max_burst_read = 0; switch (status & PCIXM_STATUS_MAX_READ) { case PCIXM_STATUS_MAX_READ_512: max_burst_read = 512; @@ -186,6 +190,7 @@ cap_pcix(int fd, struct pci_conf *p, uin max_burst_read = 4096; break; } + max_splits = 0; switch (status & PCIXM_STATUS_MAX_SPLITS) { case PCIXM_STATUS_MAX_SPLITS_1: max_splits = 1; @@ -518,6 +523,9 @@ static void cap_sata(int fd, struct pci_conf *p, uint8_t ptr) { + (void)fd; /* UNUSED */ + (void)p; /* UNUSED */ + (void)ptr; /* UNUSED */ printf("SATA Index-Data Pair"); } @@ -759,7 +767,7 @@ ecap_sriov(int fd, struct pci_conf *p, u print_bar(fd, p, "iov bar ", ptr + PCIR_SRIOV_BAR(i)); } -struct { +static struct { uint16_t id; const char *name; } ecap_names[] = { Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Thu Feb 18 15:12:52 2016 (r295759) +++ head/usr.sbin/pciconf/pciconf.c Thu Feb 18 15:23:25 2016 (r295760) @@ -67,7 +67,7 @@ struct pci_vendor_info char *desc; }; -TAILQ_HEAD(,pci_vendor_info) pci_vendors; +static TAILQ_HEAD(,pci_vendor_info) pci_vendors; static struct pcisel getsel(const char *str); static void list_bridge(int fd, struct pci_conf *p); @@ -896,16 +896,18 @@ getdevice(const char *name) static struct pcisel parsesel(const char *str) { - char *ep = strchr(str, '@'); - char *epbase; + const char *ep; + const char *epbase; + char *eppos; struct pcisel sel; unsigned long selarr[4]; int i; - if (ep == NULL) - ep = (char *)str; - else + ep = strchr(str, '@'); + if (ep != NULL) ep++; + else + ep = str; epbase = ep; @@ -913,7 +915,8 @@ parsesel(const char *str) ep += 3; i = 0; do { - selarr[i++] = strtoul(ep, &ep, 10); + selarr[i++] = strtoul(ep, &eppos, 10); + ep = eppos; } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4); if (i > 2)