summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-disk.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-01-02 12:12:10 +0000
committered <ed@FreeBSD.org>2012-01-02 12:12:10 +0000
commitab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9 (patch)
treec3375fb3aa9ccc6f33c26a511457552dfbab74a7 /sys/dev/ata/ata-disk.c
parentd9de01105e6c2f60ef0fb2a67c0f3d915cef8c61 (diff)
downloadFreeBSD-src-ab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9.zip
FreeBSD-src-ab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9.tar.gz
Use strchr() and strrchr().
It seems strchr() and strrchr() are used more often than index() and rindex(). Therefore, simply migrate all kernel code to use it. For the XFS code, remove an empty line to make the code identical to the code in the Linux kernel.
Diffstat (limited to 'sys/dev/ata/ata-disk.c')
-rw-r--r--sys/dev/ata/ata-disk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c
index a45221a..5388349 100644
--- a/sys/dev/ata/ata-disk.c
+++ b/sys/dev/ata/ata-disk.c
@@ -532,8 +532,8 @@ ad_describe(device_t dev)
u_int8_t *marker, vendor[64], product[64];
/* try to separate the ATA model string into vendor and model parts */
- if ((marker = index(atadev->param.model, ' ')) ||
- (marker = index(atadev->param.model, '-'))) {
+ if ((marker = strchr(atadev->param.model, ' ')) ||
+ (marker = strchr(atadev->param.model, '-'))) {
int len = (marker - atadev->param.model);
strncpy(vendor, atadev->param.model, len);
OpenPOWER on IntegriCloud