From: Uwe Hermann Date: Tue, 12 Mar 2013 20:40:03 +0000 (+0100) Subject: rigol-ds1xx2: Use ARRAY_SIZE. X-Git-Tag: dsupstream~237 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=333bf022e3ab268fb575ec61ccf0c0f17213647c;p=libsigrok.git rigol-ds1xx2: Use ARRAY_SIZE. --- diff --git a/hardware/rigol-ds1xx2/api.c b/hardware/rigol-ds1xx2/api.c index 299fe20c..cb8ad1a9 100644 --- a/hardware/rigol-ds1xx2/api.c +++ b/hardware/rigol-ds1xx2/api.c @@ -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; diff --git a/hardware/rigol-ds1xx2/protocol.h b/hardware/rigol-ds1xx2/protocol.h index cc9251ac..fa056030 100644 --- a/hardware/rigol-ds1xx2/protocol.h +++ b/hardware/rigol-ds1xx2/protocol.h @@ -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). */