From: pr.jung Date: Fri, 9 Dec 2016 01:35:51 +0000 (+0900) Subject: Apply Tizen coding rule X-Git-Tag: submit/tizen_3.0/20161209.130513^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F90%2F103590%2F1;p=platform%2Fcore%2Fapi%2Fusb-host.git Apply Tizen coding rule Change-Id: I548833719dc6748049be232b47b45111e02678ba Signed-off-by: pr.jung --- diff --git a/doc/usb_host_doc.h b/doc/usb_host_doc.h index 4bd9288..e8e602f 100644 --- a/doc/usb_host_doc.h +++ b/doc/usb_host_doc.h @@ -66,19 +66,19 @@ * n = usb_host_get_device_list(ctx, &devs); * * for (i = 0; i < n; ++i) { - * if (check(devs[i]) { - * found = devs[i]; - * break; - * } + * if (check(devs[i]) { + * found = devs[i]; + * break; + * } * } * * if (found) { - * usb_host_device_open(found); + * usb_host_device_open(found); * - * //perform communication - * ... + * //perform communication + * ... * - * usb_host_device_close(dev); + * usb_host_device_close(dev); * } * * usb_host_free_devices(devs); @@ -208,7 +208,7 @@ * * ret = usb_host_transfer(ep, data, length, &transfered, 0); * if (ret < 0) - * error(); + * error(); * @endcode * * In this example data buffer contains data received from device. Value of transfered diff --git a/include/common.h b/include/common.h index 4a23b5c..acdaf1c 100644 --- a/include/common.h +++ b/include/common.h @@ -26,8 +26,8 @@ extern "C" { #define container_of(ptr, type, field) ({ \ const typeof(((type *)0)->field) *member = (ptr); \ - (type *)( (char *)member - offsetof(type, field) ); \ - }) + (type *)((char *)member - offsetof(type, field)); \ + }) #define ARRAY_SIZE(a) (sizeof(a)/sizeof(*a)) diff --git a/src/usb_host.c b/src/usb_host.c index 764f8f1..6f6e24e 100644 --- a/src/usb_host.c +++ b/src/usb_host.c @@ -260,7 +260,7 @@ static int dump_altsetting(struct usb_host_altsetting_s *dest, return 0; //LCOV_EXCL_START System Error -free_eps: +free_eps : while (--i >= 0) free_ep(eps + i); free(eps); @@ -300,7 +300,7 @@ static int dump_interface(struct usb_host_interface_s *dest, return 0; //LCOV_EXCL_START System Error -free_alts: +free_alts : while (--i >= 0) free_altsetting(alts + i); free(alts); @@ -357,7 +357,7 @@ static int dump_config_desc(struct usb_host_config_s *dest, return 0; //LCOV_EXCL_START System Error -free_interfaces: +free_interfaces : while (--i >= 0) free_interface(interfaces + i); free(interfaces); @@ -401,7 +401,7 @@ int usb_host_create(usb_host_context_h *ctx) return USB_HOST_ERROR_NONE; //LCOV_EXCL_START System Error -free_ctx: +free_ctx : free(_ctx); ret = translate_error(ret); out: @@ -511,7 +511,7 @@ int usb_host_device_open_with_vid_pid(usb_host_context_h ctx, return USB_HOST_ERROR_NONE; //LCOV_EXCL_START System Error -close_handle: +close_handle : libusb_close(ldev_handle); out: _E("Failed to open device with given parameters"); @@ -623,7 +623,7 @@ int usb_host_get_device_list(usb_host_context_h context, usb_host_device_h **dev return USB_HOST_ERROR_NONE; //LCOV_EXCL_START System Error -free_dev_list: +free_dev_list : while (--i >= 0) usb_host_unref_device(list[i]); free(list); @@ -829,7 +829,7 @@ claim_interface: return 0; //LCOV_EXCL_START System Error -claim_failed: +claim_failed : if (driver_detached) libusb_attach_kernel_driver(lusb_dev_handle, interface_number);