Initialize variables to avoid maybe-uninitialized warnings

When building the package for PPA, gcc throws errors indicating that
some variables may be used uninitialized. This is not a real problem
that shows up during the CI build, but only when building using
dpkg-buildpackage.

This change adds some dummy initialization so that it avoids triggering
those warnings during debuild/dpkg-buildpackage.
update-lkm
nirenjan 2023-01-03 12:26:51 -08:00
parent d4412aba3e
commit 03c0376e7c
2 changed files with 5 additions and 2 deletions

View File

@ -31,7 +31,9 @@ static libusb_device_handle *libusbx52_init(void)
int rc;
ssize_t count;
int i;
libusb_device **list;
libusb_device dummy = { 0 };
libusb_device *dummy_list[] = { &dummy };
libusb_device **list = dummy_list;
libusb_device_handle *hdl = NULL;
struct libusb_device_descriptor desc;

View File

@ -89,7 +89,8 @@ static int group_teardown(void **state)
{ \
libx52io_context *ctx = *state; \
int rc; \
int32_t min, max; \
int32_t min = 0; \
int32_t max = 0; \
ctx->pid = X52_PROD_X52 ## prodid; \
_x52io_set_axis_range(ctx); \
rc = libx52io_get_axis_range(ctx, LIBX52IO_AXIS_ ## axis, &min, &max); \