From: Uwe Hermann Date: Wed, 8 Apr 2015 17:14:05 +0000 (+0200) Subject: rigol-ds: Drop unneeded check of g_strdup_printf() result. X-Git-Tag: libsigrok-0.4.0~537 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=eac0c6132752224f46661ddc5a37a1e0e4694c27;p=libsigrok.git rigol-ds: Drop unneeded check of g_strdup_printf() result. --- diff --git a/src/hardware/rigol-ds/api.c b/src/hardware/rigol-ds/api.c index 955b6acc..b860c11b 100644 --- a/src/hardware/rigol-ds/api.c +++ b/src/hardware/rigol-ds/api.c @@ -353,8 +353,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) model->analog_channels); for (i = 0; i < model->analog_channels; i++) { - if (!(channel_name = g_strdup_printf("CH%d", i + 1))) - return NULL; + channel_name = g_strdup_printf("CH%d", i + 1); ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel_name); devc->analog_groups[i] = g_malloc0(sizeof(struct sr_channel_group)); @@ -369,8 +368,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) devc->digital_group = g_malloc0(sizeof(struct sr_channel_group)); for (i = 0; i < ARRAY_SIZE(devc->digital_channels); i++) { - if (!(channel_name = g_strdup_printf("D%d", i))) - return NULL; + channel_name = g_strdup_printf("D%d", i); ch = sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, channel_name); g_free(channel_name); devc->digital_group->channels = g_slist_append(