From: Gerhard Sittig Date: Sun, 16 May 2021 13:30:42 +0000 (+0200) Subject: hp-3457a: style nits in the probe routine X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=9417f26fd47556c4b4f6ecaa08a2860672664eb9;p=libsigrok.git hp-3457a: style nits in the probe routine Unobfuscate a string comparison. Eliminate redundant data type specs in malloc calls. --- diff --git a/src/hardware/hp-3457a/api.c b/src/hardware/hp-3457a/api.c index 6e42bb9a..f828cfd8 100644 --- a/src/hardware/hp-3457a/api.c +++ b/src/hardware/hp-3457a/api.c @@ -138,15 +138,15 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) if ((ret != SR_OK) || !response) return NULL; - if (strcmp(response, "HP3457A")) { + if (strcmp(response, "HP3457A") != 0) { g_free(response); return NULL; } g_free(response); - devc = g_malloc0(sizeof(struct dev_context)); - sdi = g_malloc0(sizeof(struct sr_dev_inst)); + devc = g_malloc0(sizeof(*devc)); + sdi = g_malloc0(sizeof(*sdi)); sdi->vendor = g_strdup("Hewlett-Packard"); sdi->model = g_strdup("3457A"); sdi->version = get_revision(scpi);