Skip to contentSkip to conversation

Fix style in s3c-hsotg.c

DISCUSSION Jingoo Han 1 participant 1 message Sep 4, 2013 Arm Samsung Exynos

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw
Quoted 8 lines · Pavel Machek

Hi!

checkpatch.pl has some valid complaints about style in s3c-hsotg.c :
macro with if should be really enclosed in do {} while, and puts is going to be slightly faster.

Here's suggested patch. I don't have the hardware, so it is completely untested.

CC'ed [email protected], Kukjin Kim

Hi Pavel Machek,

I have the hardware. :-)
Also, I am developing USB stuff of Samsung SoCs.

Quoted 9 lines
drivers/usb/gadget/s3c-hsotg.c +0 -0
index af22f24..f8e762a 100644
@@ -2091,12 +2091,14 @@ static void kill_all_requests(struct s3c_hsotg *hsotg,
 }

drivers/usb/gadget/s3c-hsotg.c static void kill_all_requests(struct s3c_hsotg *hsotg, · line 2101

Quoted 10 lines
drivers/usb/gadget/s3c-hsotg.c +2 -0
 
 #define call_gadget(_hs, _entry) \
+do { \
 	if ((_hs)->gadget.speed != USB_SPEED_UNKNOWN &&	\
 	    (_hs)->driver && (_hs)->driver->_entry) { \
 		spin_unlock(&_hs->lock); \
 		(_hs)->driver->_entry(&(_hs)->gadget); \
 		spin_lock(&_hs->lock); \
 		}
+} while (0)

It makes build error.
Thus, it should be fixed as below:

	} \
} while(0)

Other things look good.
Thank you for sending the patch. :)

Best regards,
Jingoo Han