Remove dead code (comma is either 0 or 1 for sure, no need to test).

Close /dev/pci when we're done with it.

CID: 1007450, 1007449, 1008615, 1008614
This commit is contained in:
Warner Losh 2018-01-05 07:29:02 +00:00
parent 65273b4808
commit e96d5d7bb3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327581
2 changed files with 5 additions and 5 deletions

View file

@ -161,7 +161,7 @@ cap_pcix(int fd, struct pci_conf *p, uint8_t ptr)
printf("supports");
comma = 0;
if (status & PCIXM_STATUS_133CAP) {
printf("%s 133MHz", comma ? "," : "");
printf(" 133MHz");
comma = 1;
}
if (status & PCIXM_STATUS_266CAP) {
@ -351,10 +351,8 @@ cap_vendor(int fd, struct pci_conf *p, uint8_t ptr)
printf("%s SATA RAID-0/1/10", comma ? "," : "");
comma = 1;
}
if (fvec & (1 << 3)) {
printf("%s SATA AHCI", comma ? "," : "");
comma = 1;
}
if (fvec & (1 << 3))
printf(", SATA AHCI");
}
}
}

View file

@ -1005,6 +1005,7 @@ writeit(const char *name, const char *reg, const char *data, int width)
if (ioctl(fd, PCIOCWRITE, &pi) < 0)
err(1, "ioctl(PCIOCWRITE)");
close(fd);
}
static void
@ -1024,4 +1025,5 @@ chkattached(const char *name)
exitstatus = pi.pi_data ? 0 : 2; /* exit(2), if NOT attached */
printf("%s: %s%s\n", name, pi.pi_data == 0 ? "not " : "", "attached");
close(fd);
}