Use the cflags and libs from pkg-config. This allows us to adapt to the
distro differences. Also, make sure to autodetect if the distro provides
libftdi or libftdi1, preferring the latter one.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Current default is to interpret 20 tilde characters as a signal to power
cycle the board and if there are no power cycles left to exit cdba.
Unfortunately gcc started spurting tilde chars in compile log, so
compiling software on the cdba target can cause cdba exit.
Change the defaults so that by default cdba doesn't interpret received
lines. One can specify '-c 0' on the cdba command line to restore
previous behaviour.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
For different reasons it might be desirable to keep slot 'b' as an
active slot. Add support for specifying the active slot in the config
file. The default is still slot 'a'.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
There is no need to manually install libc6-dev-ARCH-cross packages.
Corresponding target arch packages will be pulled out via the dependency
of library dev packages.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Don't count the timers, as it's not used anywhere. Clang is unhappy with that:
cdba-server.c:307:6: warning: variable 'count' set but not used [-Wunused-but-set-variable]
int count = 0;
Signed-off-by: Konrad Dybcio <konradybcio@kernel.org>
After fixing all the warnings (at least on gcc v11.3.0), enable them as
errors, so any silent builds will explicitly fail (also in Continuous
Integration builds).
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fixes clang warning:
circ_buf.c:49:9: warning: variable 'count' set but not used [-Wunused-but-set-variable]
size_t count = 0;
^
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Pointer arithmetic should not be done on void pointers.
cdba-server.c:146:21: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
146 | memcpy(newp + fastboot_size, data, len);
| ^
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Code should avoid comparing signed and unsigned integers, because of
implicit case. Explicit casts are safe because 'lock' size is PATH_MAX.
device.c: In function ‘device_lock’:
device.c:64:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
64 | if (n >= sizeof(lock))
| ^~
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fixes:
device_parser.c: In function ‘nextsym’:
device_parser.c:53:56: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
53 | fprintf(stderr, "device parser: error %d\n", dp->parser.error);
| ~^ ~~~~~~~~~~~~~~~~
| | |
| int unsigned int
| %d
device_parser.c: In function ‘expect’:
device_parser.c:80:58: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
80 | fprintf(stderr, "device parser: expected %d got %d\n", type, dp->event.type);
| ~^ ~~~~~~~~~~~~~~
| | |
| int unsigned int
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Code should avoid comparing signed and unsigned integers, because of
implicit case. Explicit casts are safe because 'buf' size is 256.
conmux.c: In function ‘registry_lookup’:
conmux.c:169:17: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
169 | if (ret >= sizeof(buf))
| ^~
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fixes:
cdb_assist.c: In function ‘cdb_assist_print_status’:
cdb_assist.c:351:28: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
351 | n = sprintf(buf, "%dmV %dmA%s%s%s%s%s ref: %dmV",
| ~^
| |
| int
| %d
352 | cdb->voltage_set,
| ~~~~~~~~~~~~~~~~
| |
| unsigned int
cdb_assist.c:372:29: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
372 | n = sprintf(buf, "u%d\r\n", mV);
| ~^ ~~
| | |
| int unsigned int
| %d
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Pointer arithmetic should not be done on void pointers.
circ_buf.c: In function ‘circ_read’:
circ_buf.c:104:25: warning: pointer of type ‘void *’ used in subtraction [-Wpointer-arith]
104 | return (void*)p - buf;
| ^
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>