sr_dbg("Found: %s %s (idx %zu).", model->vendor, model->name,
model - &models[0]);
- sdi = g_malloc0(sizeof(struct sr_dev_inst));
+ sdi = g_malloc0(sizeof(*sdi));
sdi->status = SR_ST_INACTIVE;
sdi->vendor = g_strdup(model->vendor);
sdi->model = g_strdup(model->name);
sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "V");
sr_channel_new(sdi, 1, SR_CHANNEL_ANALOG, TRUE, "I");
- devc = g_malloc0(sizeof(struct dev_context));
+ devc = g_malloc0(sizeof(*devc));
sr_sw_limits_init(&devc->limits);
g_mutex_init(&devc->rw_mutex);
devc->model = model;