summaryrefslogtreecommitdiffstats
path: root/sys/cam/ata/ata_xpt.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-21 15:38:28 +0000
committerpfg <pfg@FreeBSD.org>2016-04-21 15:38:28 +0000
commitfc65edc1cd05de15ef17e14dc54c2bf6c41ccab8 (patch)
tree45622d9ce5a6c394316a37f672cfd0a033c48374 /sys/cam/ata/ata_xpt.c
parentfdf39652a42767663d4a74a1a367d193185c51e9 (diff)
downloadFreeBSD-src-fc65edc1cd05de15ef17e14dc54c2bf6c41ccab8.zip
FreeBSD-src-fc65edc1cd05de15ef17e14dc54c2bf6c41ccab8.tar.gz
Remove slightly used const values that can be replaced with nitems().
Suggested by: jhb
Diffstat (limited to 'sys/cam/ata/ata_xpt.c')
-rw-r--r--sys/cam/ata/ata_xpt.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c
index 3429bb29a6..3dab055 100644
--- a/sys/cam/ata/ata_xpt.c
+++ b/sys/cam/ata/ata_xpt.c
@@ -160,9 +160,6 @@ static struct ata_quirk_entry ata_quirk_table[] =
},
};
-static const int ata_quirk_table_size =
- sizeof(ata_quirk_table) / sizeof(*ata_quirk_table);
-
static cam_status proberegister(struct cam_periph *periph,
void *arg);
static void probeschedule(struct cam_periph *probe_periph);
@@ -1284,7 +1281,7 @@ ata_find_quirk(struct cam_ed *device)
match = cam_quirkmatch((caddr_t)&device->ident_data,
(caddr_t)ata_quirk_table,
- ata_quirk_table_size,
+ nitems(ata_quirk_table),
sizeof(*ata_quirk_table), ata_identify_match);
if (match == NULL)
@@ -1579,7 +1576,7 @@ ata_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id)
* Take the default quirk entry until we have inquiry
* data and can determine a better quirk to use.
*/
- quirk = &ata_quirk_table[ata_quirk_table_size - 1];
+ quirk = &ata_quirk_table[nitems(ata_quirk_table) - 1];
device->quirk = (void *)quirk;
device->mintags = 0;
device->maxtags = 0;
OpenPOWER on IntegriCloud