]> sigrok.org Git - libsigrok.git/commit
korad-kaxxxxp: style cleanup in device scan, keep serno at hand
authorGerhard Sittig <redacted>
Fri, 28 Aug 2020 14:17:22 +0000 (16:17 +0200)
committerGerhard Sittig <redacted>
Fri, 28 Aug 2020 14:28:47 +0000 (16:28 +0200)
commitfcacf532f5180b11b9ddaac6d7a95549f3ee0e32
treed642b9b298d7de286f16b6d1ad6921e01dbcf7d3
parent003ad0ab8cfaab20d3037d46c35ae63c7d2a2c42
korad-kaxxxxp: style cleanup in device scan, keep serno at hand

Cleanup style in the korad driver's scan() routine. Keep declarations
out of code blocks. Reduce redundancy and improve robustness in the
response buffer length calculation. Reduce clutter and group related
instructions together. Unobfuscate result checks, and keep the result
at hand (for diagnostics, or error propagation). Unobfuscate string
comparisons in the model ID lookups, terminate the search upon match.
Use a not so terse name for data that gets referenced at rather distant
locations.

Keep the optionally available serial number at hand, to present it to
users when desired. This aspect was
Reported-By: Karl Palsson <redacted>
src/hardware/korad-kaxxxxp/api.c