Re: [PATCH v2 04/11] usb:hsotg:samsung: NAK management for EP0 (Setup stage of control transfers)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 03/05/2012 02:47 PM, Lukasz Majewski wrote:

On 05-03-2012 15:11, Lukasz Majewski wrote:

For SETUP stage of USB control transmission, the NAK shall NOT be
CLEAR.

The SNAK/CNAK control is crucial for this type of driver,
since data arrives to earlier defined requests.

Tested with:
- DFU gadget (various size of the sent data - also packet = MPS)
- Ethernet gadget (CDC and RNDIS)
- Multi Function Gadget (g_multi)

HW:
- Samsung's C210 Universal rev.0

Signed-off-by: Lukasz Majewski<l.majewski@xxxxxxxxxxx>
Signed-off-by: Kyungmin Park<kyungmin.park@xxxxxxxxxxx>
---
   drivers/usb/gadget/s3c-hsotg.c |   21 +++++++++++++++++++--
   1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsotg.c
b/drivers/usb/gadget/s3c-hsotg.c index b35c657..0492c20 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
[...]
@@ -1530,6 +1541,12 @@ static void s3c_hsotg_handle_outdone(struct
s3c_hsotg *hsotg, if (req->actual<   req->length&&   size_left == 0) {
   		s3c_hsotg_start_req(hsotg, hs_ep, hs_req, true);
   		return;
+	} else {
+		if (epnum == 0) {

      Collapse this to *else if* please and save on {}.

Frankly speaking, I know, that those {} can be collapsed.

But for readability I'd prefer to keep those parenthesis, especially
for the included comment and the fact that those are embedded at other
if/else statement.

Note that I'm asking you only to remove external braces (which are completely useless), not internal. Use of *else if* as in K&R style promoted by Documentation/CodingStyle will also save one level of indentation.

Can be fixed anyway, above just my thoughts and motivation for the {}

  Thanks.

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux