[PATCH] usb:hub: readibility and consistency in coding style

Atul Raj atul.r at samsung.com
Wed Nov 30 11:51:39 UTC 2016


It is suggested to keep braces if there is a comment in if case as
comment also takes a line.
---
 drivers/usb/core/hub.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 82059f26..f43e6302 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5334,10 +5334,10 @@ static int descriptors_changed(struct usb_device *udev,
        }

        buf = kmalloc(len, GFP_NOIO);
-       if (!buf)
+       if (!buf) {
                /* assume the worst */
                return 1;
-
+       }
        for (index = 0; index < udev->descriptor.bNumConfigurations; index++) {
                old_length = le16_to_cpu(udev->config[index].desc.wTotalLength);
                length = usb_get_descriptor(udev, USB_DT_CONFIG, index, buf,
--
2.10.2.windows.1


More information about the dri-devel mailing list