]> sigrok.org Git - libsigrok.git/commit
Simplify single device list handling
authorLars-Peter Clausen <redacted>
Mon, 16 May 2016 09:37:23 +0000 (11:37 +0200)
committerUwe Hermann <redacted>
Fri, 27 May 2016 12:44:24 +0000 (14:44 +0200)
commit43376f3324cddd257a0260b06d9db8180c35fdf3
treeb562c98a2a35c713966fe96bc35a70e15efae20e
parent15a5bfe4815f9991a9bb532c05d6244a1818a0e4
Simplify single device list handling

Some driver scan() functions only ever return a single device. For those it
is possible to slightly simplify the handling of the device list by
creating it on demand when the function returns.

Some drivers also have the following expression:
devices = g_slist_append(devices, sdi);
...
if (!devices)
...

This check will never evaluate to false so it is dropped as well.

Signed-off-by: Lars-Peter Clausen <redacted>
17 files changed:
src/hardware/arachnid-labs-re-load-pro/api.c
src/hardware/asix-sigma/api.c
src/hardware/atten-pps3xxx/api.c
src/hardware/baylibre-acme/api.c
src/hardware/beaglelogic/api.c
src/hardware/center-3xx/api.c
src/hardware/colead-slm/api.c
src/hardware/conrad-digi-35-cpu/api.c
src/hardware/demo/demo.c
src/hardware/ikalogic-scanaplus/api.c
src/hardware/korad-kaxxxxp/api.c
src/hardware/manson-hcs-3xxx/api.c
src/hardware/mic-985xx/api.c
src/hardware/motech-lps-30x/api.c
src/hardware/openbench-logic-sniffer/api.c
src/hardware/pce-322a/api.c
src/hardware/tondaj-sl-814/api.c