Convert a few sizeof() users to ARRAY_SIZE

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1818 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Mike Frysinger 15 years ago
parent fc8686b8dd
commit f8e53c6e0a

@ -1,3 +1,7 @@
2010-07-31 Mike Frysinger <vapier@gentoo.org>
* src/bus/buses.c, src/flash/jedec.c, src/tap/cable.c: Convert to ARRAY_SIZE.
2010-07-30 Mike Frysinger <vapier@gentoo.org>
* data/analog/bf592/STEPPINGS: Add support for bf592-0.1.

@ -212,5 +212,5 @@ static const urj_param_descr_t bus_param[] =
const urj_param_list_t urj_bus_param_list =
{
.list = bus_param,
.n = sizeof bus_param / sizeof bus_param[0],
.n = ARRAY_SIZE (bus_param)
};

@ -495,8 +495,7 @@ urj_flash_jedec_detect (urj_bus_t *bus, uint32_t adr,
devid = URJ_BUS_READ (bus, adr + (1 << 1));
URJ_BUS_WRITE (bus, adr, 0xf0);
for (dev_idx = sizeof (table) / sizeof (struct amd_flash_info) - 1;
dev_idx >= 0; dev_idx--)
for (dev_idx = ARRAY_SIZE (table) - 1; dev_idx >= 0; dev_idx--)
{
if (table[dev_idx].interface_width == CFI_INTERFACE_X16 ||
table[dev_idx].interface_width == CFI_INTERFACE_X8_X16)
@ -526,8 +525,7 @@ urj_flash_jedec_detect (urj_bus_t *bus, uint32_t adr,
devid = URJ_BUS_READ (bus, adr + 1);
URJ_BUS_WRITE (bus, adr, 0xf0);
for (dev_idx = sizeof (table) / sizeof (struct amd_flash_info) - 1;
dev_idx >= 0; dev_idx--)
for (dev_idx = ARRAY_SIZE (table) - 1; dev_idx >= 0; dev_idx--)
{
if (table[dev_idx].interface_width == CFI_INTERFACE_X8)
{

@ -677,5 +677,5 @@ static const urj_param_descr_t cable_param[] =
const urj_param_list_t urj_cable_param_list =
{
.list = cable_param,
.n = sizeof cable_param / sizeof cable_param[0],
.n = ARRAY_SIZE (cable_param),
};

Loading…
Cancel
Save