hp-3457a: style nits in the probe routine
Unobfuscate a string comparison. Eliminate redundant data type specs in malloc calls.
This commit is contained in:
parent
1c50255506
commit
9417f26fd4
|
@ -138,15 +138,15 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
|
||||||
if ((ret != SR_OK) || !response)
|
if ((ret != SR_OK) || !response)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (strcmp(response, "HP3457A")) {
|
if (strcmp(response, "HP3457A") != 0) {
|
||||||
g_free(response);
|
g_free(response);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free(response);
|
g_free(response);
|
||||||
|
|
||||||
devc = g_malloc0(sizeof(struct dev_context));
|
devc = g_malloc0(sizeof(*devc));
|
||||||
sdi = g_malloc0(sizeof(struct sr_dev_inst));
|
sdi = g_malloc0(sizeof(*sdi));
|
||||||
sdi->vendor = g_strdup("Hewlett-Packard");
|
sdi->vendor = g_strdup("Hewlett-Packard");
|
||||||
sdi->model = g_strdup("3457A");
|
sdi->model = g_strdup("3457A");
|
||||||
sdi->version = get_revision(scpi);
|
sdi->version = get_revision(scpi);
|
||||||
|
|
Loading…
Reference in New Issue