]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: Drop unneeded check of g_strdup_printf() result.
authorUwe Hermann <redacted>
Wed, 8 Apr 2015 17:14:05 +0000 (19:14 +0200)
committerUwe Hermann <redacted>
Wed, 8 Apr 2015 17:14:05 +0000 (19:14 +0200)
src/hardware/rigol-ds/api.c

index 955b6accf7048e2ff3e99106163361d213e08255..b860c11b5d6801f22f4e3b0cb69f337d72104834 100644 (file)
@@ -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(