]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/openbench-logic-sniffer/protocol.c
Don't check sr_channel_new() return value (always succeeds).
[libsigrok.git] / src / hardware / openbench-logic-sniffer / protocol.c
index 584164e7ba412e02382b257ebc73a0339f4cebed..b732da59c19e5a271b553a9be7288186e6cb6530 100644 (file)
@@ -216,9 +216,8 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial)
                        case 0x00:
                                /* Number of usable channels */
                                for (ui = 0; ui < tmp_int; ui++) {
-                                       if (!(ch = sr_channel_new(ui, SR_CHANNEL_LOGIC, TRUE,
-                                                       ols_channel_names[ui])))
-                                               return 0;
+                                       ch = sr_channel_new(ui, SR_CHANNEL_LOGIC, TRUE,
+                                                       ols_channel_names[ui]);
                                        sdi->channels = g_slist_append(sdi->channels, ch);
                                }
                                break;
@@ -255,9 +254,8 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial)
                        case 0x00:
                                /* Number of usable channels */
                                for (ui = 0; ui < tmp_c; ui++) {
-                                       if (!(ch = sr_channel_new(ui, SR_CHANNEL_LOGIC, TRUE,
-                                                       ols_channel_names[ui])))
-                                               return 0;
+                                       ch = sr_channel_new(ui, SR_CHANNEL_LOGIC, TRUE,
+                                                       ols_channel_names[ui]);
                                        sdi->channels = g_slist_append(sdi->channels, ch);
                                }
                                break;