From owner-svn-src-all@FreeBSD.ORG Wed Jan 28 21:21:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E7B1FD9; Wed, 28 Jan 2015 21:21:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 EEE2E166; Wed, 28 Jan 2015 21:21:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0SLLZjR062883; Wed, 28 Jan 2015 21:21:35 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0SLLZUo062859; Wed, 28 Jan 2015 21:21:35 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201501282121.t0SLLZUo062859@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 28 Jan 2015 21:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277856 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2015 21:21:36 -0000 Author: dim Date: Wed Jan 28 21:21:35 2015 New Revision: 277856 URL: https://svnweb.freebsd.org/changeset/base/277856 Log: Fix the following clang 3.6.0 warnings in pciconf: usr.sbin/pciconf/pciconf.c:237:12: error: address of array 'p->pd_name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] (p->pd_name && *p->pd_name) ? p->pd_name : ~~~^~~~~~~ ~~ usr.sbin/pciconf/pciconf.c:239:12: error: address of array 'p->pd_name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] (p->pd_name && *p->pd_name) ? (int)p->pd_unit : ~~~^~~~~~~ ~~ The pd_name field of struct pci_conf is an array, so it can never be null. Remove the unnecessary check. Modified: head/usr.sbin/pciconf/pciconf.c Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Wed Jan 28 21:08:09 2015 (r277855) +++ head/usr.sbin/pciconf/pciconf.c Wed Jan 28 21:21:35 2015 (r277856) @@ -234,9 +234,9 @@ list_devs(const char *name, int verbose, for (p = conf; p < &conf[pc.num_matches]; p++) { printf("%s%d@pci%d:%d:%d:%d:\tclass=0x%06x card=0x%08x " "chip=0x%08x rev=0x%02x hdr=0x%02x\n", - (p->pd_name && *p->pd_name) ? p->pd_name : + *p->pd_name ? p->pd_name : "none", - (p->pd_name && *p->pd_name) ? (int)p->pd_unit : + *p->pd_name ? (int)p->pd_unit : none_count++, p->pc_sel.pc_domain, p->pc_sel.pc_bus, p->pc_sel.pc_dev, p->pc_sel.pc_func, (p->pc_class << 16) |