From be15c51ed49fcd5b725e1174247c92ee295b2b3b Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Wed, 2 Jan 2019 13:15:17 +0100 Subject: [PATCH] ols: drop wrong usage of macro commit f51acd69 ("ols: combine demux samples") wrongly replaced the bit pattern of 0x20 with the number of channels which just happens to be 32 as well. So, the code works but is confusing to read. Reword the for-loop to make it more comprehensible. Signed-off-by: Wolfram Sang --- src/hardware/openbench-logic-sniffer/protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hardware/openbench-logic-sniffer/protocol.c b/src/hardware/openbench-logic-sniffer/protocol.c index 3bfb890f..0041b21a 100644 --- a/src/hardware/openbench-logic-sniffer/protocol.c +++ b/src/hardware/openbench-logic-sniffer/protocol.c @@ -365,7 +365,7 @@ SR_PRIV int ols_receive_data(int fd, int revents, void *cb_data) } num_ols_changrp = 0; - for (i = NUM_CHANNELS; i > 0x02; i /= 2) { + for (i = 0x20; i > 0x02; i >>= 1) { if ((devc->flag_reg & i) == 0) { num_ols_changrp++; } -- 2.30.2