diff --git a/src/function/ether.c b/src/function/ether.c index a9eaf33..8745eec 100644 --- a/src/function/ether.c +++ b/src/function/ether.c @@ -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) { diff --git a/src/function/ffs.c b/src/function/ffs.c index 6a579d6..f5acbe7 100644 --- a/src/function/ffs.c +++ b/src/function/ffs.c @@ -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) { diff --git a/src/function/hid.c b/src/function/hid.c index 4d075cf..024cbc2 100644 --- a/src/function/hid.c +++ b/src/function/hid.c @@ -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) { diff --git a/src/function/loopback.c b/src/function/loopback.c index 069c3fb..b12d2d4 100644 --- a/src/function/loopback.c +++ b/src/function/loopback.c @@ -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) { diff --git a/src/function/midi.c b/src/function/midi.c index 1cedb97..601d845 100644 --- a/src/function/midi.c +++ b/src/function/midi.c @@ -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) { diff --git a/src/function/ms.c b/src/function/ms.c index 4eaa563..0f89c10 100644 --- a/src/function/ms.c +++ b/src/function/ms.c @@ -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) { diff --git a/src/function/phonet.c b/src/function/phonet.c index 17e9abb..7eb1171 100644 --- a/src/function/phonet.c +++ b/src/function/phonet.c @@ -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) { diff --git a/src/function/printer.c b/src/function/printer.c index 7270dd6..5e8d395 100644 --- a/src/function/printer.c +++ b/src/function/printer.c @@ -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, \ diff --git a/src/function/serial.c b/src/function/serial.c index fa899e0..f1fa6ad 100644 --- a/src/function/serial.c +++ b/src/function/serial.c @@ -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) { diff --git a/src/function/uac2.c b/src/function/uac2.c index 9ca8b66..5bd26f0 100644 --- a/src/function/uac2.c +++ b/src/function/uac2.c @@ -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) { diff --git a/src/function/uvc.c b/src/function/uvc.c index 19d3310..c78edfa 100644 --- a/src/function/uvc.c +++ b/src/function/uvc.c @@ -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", diff --git a/src/usbg.c b/src/usbg.c index 26b5d4b..f8b5c06 100644 --- a/src/usbg.c +++ b/src/usbg.c @@ -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) {