]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds1xx2: Use ARRAY_SIZE.
authorUwe Hermann <redacted>
Tue, 12 Mar 2013 20:40:03 +0000 (21:40 +0100)
committerUwe Hermann <redacted>
Sat, 23 Mar 2013 13:14:58 +0000 (14:14 +0100)
hardware/rigol-ds1xx2/api.c
hardware/rigol-ds1xx2/protocol.h

index 299fe20c119e5bb8a0533c040db665eb53cd71d3..cb8ad1a9015d35b0fa868710d57d9c739865f9f1 100644 (file)
@@ -114,7 +114,7 @@ static const char *supported_models[] = {
        "DS1052E",
        "DS1102E",
        "DS1052D",
-       "DS1102D"
+       "DS1102D",
 };
 
 SR_PRIV struct sr_dev_driver rigol_ds1xx2_driver_info;
@@ -172,7 +172,6 @@ static GSList *hw_scan(GSList *options)
        const gchar *delimiter = ",";
        gchar **tokens;
        const char *manufacturer, *model, *version;
-       int num_models;
        gboolean matched = FALSE;
        char buf[256];
 
@@ -226,9 +225,7 @@ static GSList *hw_scan(GSList *options)
                        return NULL;
                }
 
-               num_models = sizeof(supported_models) / sizeof(supported_models[0]);
-
-               for (i = 0; i < num_models; i++) {
+               for (i = 0; i < ARRAY_SIZE(supported_models); i++) {
                        if (!strcmp(model, supported_models[i])) {
                                matched = 1;
                                break;
index cc9251ac20748757643938c0c706093acd387c90..fa056030f4e49ee10e54338f1221c373281d1607 100644 (file)
@@ -37,7 +37,7 @@
 
 /** Private, per-device-instance driver context. */
 struct dev_context {
-       /** The current frame limit */
+       /** The current frame limit. */
        uint64_t limit_frames;
 
        /** The current sampling limit (in number of samples). */