Skip to content

Commit ebe0517

Browse files
committed
korad-kaxxxxp: address style nits, redundant data type in malloc
Rephrase malloc calls, eliminate a redundant yet unnecessary data type duplication. Just get how much space the variable happens to require.
1 parent 587ee11 commit ebe0517

File tree

1 file changed

+2
-2
lines changed
  • src/hardware/korad-kaxxxxp

1 file changed

+2
-2
lines changed

src/hardware/korad-kaxxxxp/api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
310310
sr_dbg("Found: %s %s (idx %zu).", model->vendor, model->name,
311311
model - &models[0]);
312312

313-
sdi = g_malloc0(sizeof(struct sr_dev_inst));
313+
sdi = g_malloc0(sizeof(*sdi));
314314
sdi->status = SR_ST_INACTIVE;
315315
sdi->vendor = g_strdup(model->vendor);
316316
sdi->model = g_strdup(model->name);
@@ -323,7 +323,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
323323
sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "V");
324324
sr_channel_new(sdi, 1, SR_CHANNEL_ANALOG, TRUE, "I");
325325

326-
devc = g_malloc0(sizeof(struct dev_context));
326+
devc = g_malloc0(sizeof(*devc));
327327
sr_sw_limits_init(&devc->limits);
328328
g_mutex_init(&devc->rw_mutex);
329329
devc->model = model;

0 commit comments

Comments
 (0)