]> sigrok.org Git - libsigrok.git/commitdiff
serial_hid: silence compiler warning (unused value)
authorGerhard Sittig <redacted>
Sun, 16 Jun 2019 08:30:50 +0000 (10:30 +0200)
committerGerhard Sittig <redacted>
Sun, 21 Aug 2022 15:45:11 +0000 (17:45 +0200)
Silence a compiler warning about assigning a value to a variable that's
not used in subsequent instructions. This 'have_chip' condition is worth
keeping around, in case the HID chip search code receives updates later.
Removing the assignment may complicate maintenance, or result in
incomplete diagnostics during research.

../src/serial_hid.c:1066:3: warning: Value stored to 'have_chip' is never read
                have_chip = 1;

src/serial_hid.c

index eccdf0f22ef5a0c1c5274d0931db98685aec3294..ac9afaca6f46ba8c58c2a5c17b02154766d9833b 100644 (file)
@@ -1025,6 +1025,7 @@ static int ser_hid_chip_search(enum ser_hid_chip_t *chip_ref,
                        return SR_ERR_NA;
                have_chip = 1;
        }
+       (void)have_chip;
 
        if (chip_ref)
                *chip_ref = chip;