rigol-ds1xx2: Use ARRAY_SIZE.

This commit is contained in:
Uwe Hermann 2013-03-12 21:40:03 +01:00
parent 3864648bb6
commit 333bf022e3
2 changed files with 3 additions and 6 deletions

View File

@ -114,7 +114,7 @@ static const char *supported_models[] = {
"DS1052E", "DS1052E",
"DS1102E", "DS1102E",
"DS1052D", "DS1052D",
"DS1102D" "DS1102D",
}; };
SR_PRIV struct sr_dev_driver rigol_ds1xx2_driver_info; SR_PRIV struct sr_dev_driver rigol_ds1xx2_driver_info;
@ -172,7 +172,6 @@ static GSList *hw_scan(GSList *options)
const gchar *delimiter = ","; const gchar *delimiter = ",";
gchar **tokens; gchar **tokens;
const char *manufacturer, *model, *version; const char *manufacturer, *model, *version;
int num_models;
gboolean matched = FALSE; gboolean matched = FALSE;
char buf[256]; char buf[256];
@ -226,9 +225,7 @@ static GSList *hw_scan(GSList *options)
return NULL; return NULL;
} }
num_models = sizeof(supported_models) / sizeof(supported_models[0]); for (i = 0; i < ARRAY_SIZE(supported_models); i++) {
for (i = 0; i < num_models; i++) {
if (!strcmp(model, supported_models[i])) { if (!strcmp(model, supported_models[i])) {
matched = 1; matched = 1;
break; break;

View File

@ -37,7 +37,7 @@
/** Private, per-device-instance driver context. */ /** Private, per-device-instance driver context. */
struct dev_context { struct dev_context {
/** The current frame limit */ /** The current frame limit. */
uint64_t limit_frames; uint64_t limit_frames;
/** The current sampling limit (in number of samples). */ /** The current sampling limit (in number of samples). */