1
0
Fork 0
mirror of https://github.com/linux-usb-gadgets/libusbgx.git synced 2025-07-13 06:59:42 +03:00

Merge pull request #97 from mgrzeschik/cleanups

Fixes for some of the compile warnings (-Wall -pedantic).
This commit is contained in:
Michael Grzeschik 2024-09-24 23:44:02 +02:00 committed by GitHub
commit bf2bc2310c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 33 additions and 31 deletions

View file

@ -75,9 +75,9 @@ static struct {
#undef NET_DEC_ATTR
#undef NET_STRING_ATTR
GENERIC_ALLOC_INST(ether, struct usbg_f_net, func);
GENERIC_ALLOC_INST(ether, struct usbg_f_net, func)
GENERIC_FREE_INST(ether, struct usbg_f_net, func);
GENERIC_FREE_INST(ether, struct usbg_f_net, func)
static int ether_set_attrs(struct usbg_function *f, void *f_attrs)
{

View file

@ -23,9 +23,9 @@ struct usbg_f_fs {
struct usbg_function func;
};
GENERIC_ALLOC_INST(ffs, struct usbg_f_fs, func);
GENERIC_ALLOC_INST(ffs, struct usbg_f_fs, func)
GENERIC_FREE_INST(ffs, struct usbg_f_fs, func);
GENERIC_FREE_INST(ffs, struct usbg_f_fs, func)
static int ffs_set_attrs(struct usbg_function *f, void *f_attrs)
{

View file

@ -198,9 +198,9 @@ struct {
#undef HID_DEV_ATTR_RO
#undef HID_RD_ATTR
GENERIC_ALLOC_INST(hid, struct usbg_f_hid, func);
GENERIC_ALLOC_INST(hid, struct usbg_f_hid, func)
GENERIC_FREE_INST(hid, struct usbg_f_hid, func);
GENERIC_FREE_INST(hid, struct usbg_f_hid, func)
static int hid_set_attrs(struct usbg_function *f, void *f_attrs)
{

View file

@ -33,9 +33,9 @@ static size_t loopback_offsets[USBG_F_LOOPBACK_ATTR_MAX] = {
[USBG_F_LOOPBACK_QLEN] = offsetof(struct usbg_f_loopback_attrs, qlen),
};
GENERIC_ALLOC_INST(loopback, struct usbg_f_loopback, func);
GENERIC_ALLOC_INST(loopback, struct usbg_f_loopback, func)
GENERIC_FREE_INST(loopback, struct usbg_f_loopback, func);
GENERIC_FREE_INST(loopback, struct usbg_f_loopback, func)
static int loopback_set_attrs(struct usbg_function *f, void *f_attrs)
{

View file

@ -62,9 +62,9 @@ struct {
#undef MIDI_DEC_ATTR
#undef MIDI_STRING_ATTR
GENERIC_ALLOC_INST(midi, struct usbg_f_midi, func);
GENERIC_ALLOC_INST(midi, struct usbg_f_midi, func)
GENERIC_FREE_INST(midi, struct usbg_f_midi, func);
GENERIC_FREE_INST(midi, struct usbg_f_midi, func)
static int midi_set_attrs(struct usbg_function *f, void *f_attrs)
{

View file

@ -149,7 +149,8 @@ static inline bool *get_lun_mask(struct usbg_f_ms *ms)
return ms->luns;
}
GENERIC_ALLOC_INST(ms_internal, struct usbg_f_ms, func);
GENERIC_ALLOC_INST(ms_internal, struct usbg_f_ms, func)
static int ms_alloc_inst(struct usbg_function_type *type,
usbg_function_type type_code,
const char *instance, const char *path,
@ -171,7 +172,7 @@ out:
return ret;
}
GENERIC_FREE_INST(ms, struct usbg_f_ms, func);
GENERIC_FREE_INST(ms, struct usbg_f_ms, func)
static int ms_set_attrs(struct usbg_function *f, void *f_attrs)
{

View file

@ -23,9 +23,9 @@ struct usbg_f_phonet {
struct usbg_function func;
};
GENERIC_ALLOC_INST(phonet, struct usbg_f_phonet, func);
GENERIC_ALLOC_INST(phonet, struct usbg_f_phonet, func)
GENERIC_FREE_INST(phonet, struct usbg_f_phonet, func);
GENERIC_FREE_INST(phonet, struct usbg_f_phonet, func)
static int phonet_set_attrs(struct usbg_function *f, void *f_attrs)
{

View file

@ -21,9 +21,9 @@ struct usbg_f_printer {
struct usbg_function func;
};
GENERIC_ALLOC_INST(printer, struct usbg_f_printer, func);
GENERIC_ALLOC_INST(printer, struct usbg_f_printer, func)
GENERIC_FREE_INST(printer, struct usbg_f_printer, func);
GENERIC_FREE_INST(printer, struct usbg_f_printer, func)
#define PRINTER_FUNCTION_OPTS \
.alloc_inst = printer_alloc_inst, \

View file

@ -22,9 +22,9 @@ struct usbg_f_serial {
struct usbg_function func;
};
GENERIC_ALLOC_INST(serial, struct usbg_f_serial, func);
GENERIC_ALLOC_INST(serial, struct usbg_f_serial, func)
GENERIC_FREE_INST(serial, struct usbg_f_serial, func);
GENERIC_FREE_INST(serial, struct usbg_f_serial, func)
static int serial_set_attrs(struct usbg_function *f, void *f_attrs)
{

View file

@ -87,9 +87,9 @@ static struct {
#undef UAC2_DEC_ATTR
GENERIC_ALLOC_INST(uac2, struct usbg_f_uac2, func);
GENERIC_ALLOC_INST(uac2, struct usbg_f_uac2, func)
GENERIC_FREE_INST(uac2, struct usbg_f_uac2, func);
GENERIC_FREE_INST(uac2, struct usbg_f_uac2, func)
static int uac2_set_attrs(struct usbg_function *f, void *f_attrs)
{

View file

@ -269,7 +269,8 @@ static inline struct formats *get_formats_mask(struct usbg_f_uvc *uvc)
return uvc->formats;
}
GENERIC_ALLOC_INST(uvc_internal, struct usbg_f_uvc, func);
GENERIC_ALLOC_INST(uvc_internal, struct usbg_f_uvc, func)
static int uvc_alloc_inst(struct usbg_function_type *type,
usbg_function_type type_code,
const char *instance, const char *path,
@ -294,7 +295,7 @@ out:
return ret;
}
GENERIC_FREE_INST(uvc, struct usbg_f_uvc, func);
GENERIC_FREE_INST(uvc, struct usbg_f_uvc, func)
static int uvc_set_attrs(struct usbg_function *f, void *f_attrs)
{
@ -308,7 +309,7 @@ static int uvc_get_attrs(struct usbg_function *f, void *f_attrs)
static void uvc_cleanup_attrs(struct usbg_function *f, void *f_attrs)
{
return usbg_f_uvc_cleanup_attrs(f_attrs);
usbg_f_uvc_cleanup_attrs(f_attrs);
}
int usbg_f_uvc_get_config_attr_val(usbg_f_uvc *uvcf, enum usbg_f_uvc_config_attr iattr,
@ -770,7 +771,7 @@ static int uvc_import_format(struct usbg_f_uvc *uvcf, const char *format, bool *
out:
return ret;
};
}
static int uvc_import_config(struct usbg_f_uvc *uvcf, config_setting_t *root)
{
@ -896,7 +897,7 @@ static int uvc_export_config(struct usbg_f_uvc *uvcf, config_setting_t *root)
out:
return ret;
};
}
static int uvc_export_format_attrs(struct usbg_f_uvc *uvcf, const char *format,
config_setting_t *root)
@ -972,7 +973,7 @@ static int uvc_export_frames(struct usbg_f_uvc *uvcf, const char *format,
out:
return ret;
};
}
static int uvc_libconfig_export(struct usbg_function *f, config_setting_t *root)
{
@ -1190,7 +1191,7 @@ static int uvc_remove(struct usbg_function *f, int opts)
return USBG_ERROR_PATH_TOO_LONG;
return ret;
};
}
struct usbg_function_type usbg_f_type_uvc = {
.name = "uvc",

View file

@ -81,7 +81,7 @@ struct usbg_function_type* function_types[] = {
[USBG_F_9PFS] = &usbg_f_type_9pfs,
};
ARRAY_SIZE_SENTINEL(function_types, USBG_FUNCTION_TYPE_MAX);
ARRAY_SIZE_SENTINEL(function_types, USBG_FUNCTION_TYPE_MAX)
const char *gadget_attr_names[] =
{
@ -95,7 +95,7 @@ const char *gadget_attr_names[] =
"bcdDevice"
};
ARRAY_SIZE_SENTINEL(gadget_attr_names, USBG_GADGET_ATTR_MAX);
ARRAY_SIZE_SENTINEL(gadget_attr_names, USBG_GADGET_ATTR_MAX)
const char *gadget_str_names[] =
{
@ -104,7 +104,7 @@ const char *gadget_str_names[] =
"serialnumber",
};
ARRAY_SIZE_SENTINEL(gadget_str_names, USBG_GADGET_STR_MAX);
ARRAY_SIZE_SENTINEL(gadget_str_names, USBG_GADGET_STR_MAX)
const char *gadget_os_desc_names[] =
{
@ -113,7 +113,7 @@ const char *gadget_os_desc_names[] =
"qw_sign",
};
ARRAY_SIZE_SENTINEL(gadget_os_desc_names, USBG_GADGET_OS_DESC_MAX);
ARRAY_SIZE_SENTINEL(gadget_os_desc_names, USBG_GADGET_OS_DESC_MAX)
int usbg_lookup_function_type(const char *name)
{