use ARRAY_SIZE macro
[fw/openocd] / src / jtag / rlink / rlink_speed_table.c
index f91a58eb5566335dc7a0f6d221bbe554b4101da5..2ef62ee3969fbb81d9078da667c9cf9bd819420a 100644 (file)
@@ -6,7 +6,7 @@
 #include "rlink.h"
 #include "st7.h"
 
-static const u8 dtc_64[] = {
+static const uint8_t dtc_64[] = {
        0, 2, 68, 84, 67, 2, 13, 160, 176, 151, 147, 182, 141, 152, 177, 129, 148,
        191, 143, 142, 5, 3, 0, 0, 0, 2, 68, 84, 67, 4, 0, 192, 5, 15, 0, 42, 42,
        42, 73, 0, 88, 0, 160, 189, 0, 0, 0, 0, 106, 9, 1, 8, 22, 100, 111, 119,
@@ -27,7 +27,7 @@ static const u8 dtc_64[] = {
        60, 97, 203, 8, 2, 36, 139, 124, 193, 151, 96
 };
 
-static const u8 dtc_11[] = {
+static const uint8_t dtc_11[] = {
        0, 2, 68, 84, 67, 2, 13, 160, 176, 151, 147, 182, 141, 152, 177, 129, 148,
        188, 143, 142, 5, 3, 0, 0, 0, 2, 68, 84, 67, 4, 0, 192, 5, 15, 0, 42, 42,
        42, 73, 0, 88, 0, 154, 183, 0, 0, 0, 0, 106, 9, 1, 8, 22, 100, 111, 119,
@@ -47,7 +47,7 @@ static const u8 dtc_11[] = {
        203, 8, 2, 36, 139, 117, 193, 151, 96
 };
 
-static const u8 dtc_8[] = {
+static const uint8_t dtc_8[] = {
        0, 2, 68, 84, 67, 2, 13, 160, 176, 151, 147, 182, 141, 152, 177, 129, 148,
        187, 143, 142, 5, 3, 0, 0, 0, 2, 68, 84, 67, 4, 0, 192, 5, 15, 0, 42, 42,
        42, 73, 0, 88, 0, 152, 181, 0, 0, 0, 0, 106, 9, 1, 8, 22, 100, 111, 119,
@@ -67,7 +67,7 @@ static const u8 dtc_8[] = {
        8, 2, 36, 139, 115, 193, 151, 96
 };
 
-static const u8 dtc_2[] = {
+static const uint8_t dtc_2[] = {
        0, 2, 68, 84, 67, 2, 14, 160, 176, 151, 147, 182, 141, 152, 177, 129, 148,
        186, 143, 185, 142, 5, 3, 0, 0, 0, 2, 68, 84, 67, 4, 0, 192, 5, 15, 0,
        42, 42, 42, 73, 0, 88, 0, 149, 178, 0, 0, 0, 0, 106, 9, 1, 8, 22, 100,
@@ -87,7 +87,7 @@ static const u8 dtc_2[] = {
        36, 139, 112, 193, 151, 96
 };
 
-const rlink_speed_table_t rlink_speed_table[] = {{
+const struct rlink_speed_table rlink_speed_table[] = {{
        dtc_64, sizeof(dtc_64), (ST7_FOSC * 2) / (1000 * 64), 64
 }, {
        dtc_11, sizeof(dtc_11), (ST7_FOSC * 2) / (1000 * 11), 11
@@ -97,5 +97,5 @@ const rlink_speed_table_t rlink_speed_table[] = {{
        dtc_2, sizeof(dtc_2), (ST7_FOSC * 2) / (1000 * 2), 2
 }};
 
-const size_t rlink_speed_table_size = sizeof(rlink_speed_table) / sizeof(*rlink_speed_table);
+const size_t rlink_speed_table_size = ARRAY_SIZE(rlink_speed_table);