diff options
author | dim <dim@FreeBSD.org> | 2015-01-28 21:21:35 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-28 21:21:35 +0000 |
commit | 51dfb55a0065d375570f0929e580f732b3a622a0 (patch) | |
tree | 6afef0df0858e79310d282302b118f35a831c107 /usr.sbin/pciconf | |
parent | c7d0935d11cf5759953f63cca51149aa15dcb848 (diff) | |
download | FreeBSD-src-51dfb55a0065d375570f0929e580f732b3a622a0.zip FreeBSD-src-51dfb55a0065d375570f0929e580f732b3a622a0.tar.gz |
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.
Diffstat (limited to 'usr.sbin/pciconf')
-rw-r--r-- | usr.sbin/pciconf/pciconf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c index 22bb61d..33fe95d 100644 --- a/usr.sbin/pciconf/pciconf.c +++ b/usr.sbin/pciconf/pciconf.c @@ -234,9 +234,9 @@ list_devs(const char *name, int verbose, int bars, int caps, int errors, 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) | |