mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/5] staging: emxx_udc: emxx_udc.c checkpatch modifications
@ 2016-11-21 15:05 Walt Feasel
  2016-11-21 15:05 ` [PATCH 1/5] staging: emxx_udc: emxx_udc.c Blank lines after { Walt Feasel
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Walt Feasel @ 2016-11-21 15:05 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Walt Feasel

Make Linux kernel style modifications for emxx_udc.c to include:

Blank lines after {
Logical continuation
Single statement blocks
Spaces preferred around operators
Align parenthesis

Walt Feasel (5):
  staging: emxx_udc: emxx_udc.c Blank lines after {
  staging: emxx_udc: emxx_udc.c Logical continuation
  staging: emxx_udc: emxx_udc.c {} Single statement blocks
  staging: emxx_udc: emxx_udc.c Spaces preferred around operators
  staging: emxx_udc: emxx_udc.c Align parenthesis

 drivers/staging/emxx_udc/emxx_udc.c | 57 ++++++++++++-------------------------
 1 file changed, 18 insertions(+), 39 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/5] staging: emxx_udc: emxx_udc.c Blank lines after {
  2016-11-21 15:05 [PATCH 0/5] staging: emxx_udc: emxx_udc.c checkpatch modifications Walt Feasel
@ 2016-11-21 15:05 ` Walt Feasel
  2016-11-21 15:05 ` [PATCH 2/5] staging: emxx_udc: emxx_udc.c Logical continuation Walt Feasel
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Walt Feasel @ 2016-11-21 15:05 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Walt Feasel

Make suggested checkpatch modification for
CHECK: Blank lines aren't necessary after an
open brace '{'

Signed-off-by: Walt Feasel <waltfeasel@gmail.com>
---
 drivers/staging/emxx_udc/emxx_udc.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index 31f4206..409761a 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -153,7 +153,6 @@ static void _nbu2ss_ep0_complete(struct usb_ep *_ep, struct usb_request *_req)
 	udc = (struct nbu2ss_udc *)_req->context;
 	p_ctrl = &udc->ctrl;
 	if ((p_ctrl->bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
-
 		if (p_ctrl->bRequest == USB_REQ_SET_FEATURE) {
 			/*-------------------------------------------------*/
 			/* SET_FEATURE */
@@ -753,7 +752,6 @@ static int _nbu2ss_ep0_out_transfer(
 	/* Receive data confirmation */
 	iRecvLength = _nbu2ss_readl(&udc->p_regs->EP0_LENGTH) & EP0_LDATA;
 	if (iRecvLength != 0) {
-
 		fRcvZero = 0;
 
 		iRemainSize = req->req.length - req->req.actual;
@@ -930,7 +928,6 @@ static int _nbu2ss_epn_out_pio(
 
 	if ((req->req.actual == req->req.length)
 			|| ((req->req.actual % ep->ep.maxpacket) != 0)) {
-
 		result = 0;
 	}
 
@@ -1001,7 +998,6 @@ static int _nbu2ss_epn_out_transfer(
 	} else {
 		if ((req->req.actual == req->req.length)
 			|| ((req->req.actual % ep->ep.maxpacket) != 0)) {
-
 			result = 0;
 		}
 	}
@@ -1557,7 +1553,6 @@ static void _nbu2ss_epn_set_stall(
 		for (limit_cnt = 0
 			; limit_cnt < IN_DATA_EMPTY_COUNT
 			; limit_cnt++) {
-
 			regdata = _nbu2ss_readl(
 				&preg->EP_REGS[ep->epnum - 1].EP_STATUS);
 
@@ -1584,7 +1579,6 @@ static int std_req_get_status(struct nbu2ss_udc *udc)
 
 	if ((udc->ctrl.wValue != 0x0000)
 		|| (direction != USB_DIR_IN)) {
-
 		return result;
 	}
 
@@ -1982,7 +1976,6 @@ static inline void _nbu2ss_epn_in_int(
 
 	} else {
 		if (req->zero && ((req->req.actual % ep->ep.maxpacket) == 0)) {
-
 			status =
 			_nbu2ss_readl(&preg->EP_REGS[ep->epnum - 1].EP_STATUS);
 
@@ -2330,7 +2323,6 @@ static inline void _nbu2ss_check_vbus(struct nbu2ss_udc *udc)
 	/* VBUS ON Check*/
 	reg_dt = gpio_get_value(VBUS_VALUE);
 	if (reg_dt == 0) {
-
 		udc->linux_suspended = 0;
 
 		_nbu2ss_reset_controller(udc);
@@ -2502,7 +2494,6 @@ static irqreturn_t _nbu2ss_udc_irq(int irq, void *_udc)
 			int_bit = status >> 8;
 
 			for (epnum = 0; epnum < NUM_ENDPOINTS; epnum++) {
-
 				if (0x01 & int_bit)
 					_nbu2ss_ep_int(udc, epnum);
 
@@ -2548,7 +2539,6 @@ static int nbu2ss_ep_enable(
 	ep_type = usb_endpoint_type(desc);
 	if ((ep_type == USB_ENDPOINT_XFER_CONTROL)
 		|| (ep_type == USB_ENDPOINT_XFER_ISOC)) {
-
 		pr_err(" *** %s, bat bmAttributes\n", __func__);
 		return -EINVAL;
 	}
@@ -2559,7 +2549,6 @@ static int nbu2ss_ep_enable(
 
 	if ((!udc->driver)
 		|| (udc->gadget.speed == USB_SPEED_UNKNOWN)) {
-
 		dev_err(ep->udc->dev, " *** %s, udc !!\n", __func__);
 		return -ESHUTDOWN;
 	}
@@ -2677,7 +2666,6 @@ static int nbu2ss_ep_queue(
 	if (unlikely
 	    (!_req->complete || !_req->buf
 	     || !list_empty(&req->queue))) {
-
 		if (!_req->complete)
 			pr_err("udc: %s --- !_req->complete\n", __func__);
 
@@ -2736,7 +2724,6 @@ static int nbu2ss_ep_queue(
 	list_add_tail(&req->queue, &ep->queue);
 
 	if (bflag && !ep->stalled) {
-
 		result = _nbu2ss_start_transfer(udc, ep, req, FALSE);
 		if (result < 0) {
 			dev_err(udc->dev, " *** %s, result = %d\n", __func__,
-- 
2.1.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/5] staging: emxx_udc: emxx_udc.c Logical continuation
  2016-11-21 15:05 [PATCH 0/5] staging: emxx_udc: emxx_udc.c checkpatch modifications Walt Feasel
  2016-11-21 15:05 ` [PATCH 1/5] staging: emxx_udc: emxx_udc.c Blank lines after { Walt Feasel
@ 2016-11-21 15:05 ` Walt Feasel
  2016-11-21 15:05 ` [PATCH 3/5] staging: emxx_udc: emxx_udc.c {} Single statement blocks Walt Feasel
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Walt Feasel @ 2016-11-21 15:05 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Walt Feasel

Make suggested checkpatch modification for
CHECK: Logical continuations should be on the
previous line

Signed-off-by: Walt Feasel <waltfeasel@gmail.com>
---
 drivers/staging/emxx_udc/emxx_udc.c | 37 +++++++++++++++----------------------
 1 file changed, 15 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index 409761a..de8f065 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -926,8 +926,8 @@ static int _nbu2ss_epn_out_pio(
 
 	req->req.actual += result;
 
-	if ((req->req.actual == req->req.length)
-			|| ((req->req.actual % ep->ep.maxpacket) != 0)) {
+	if ((req->req.actual == req->req.length) ||
+	    ((req->req.actual % ep->ep.maxpacket) != 0)) {
 		result = 0;
 	}
 
@@ -953,9 +953,8 @@ static int _nbu2ss_epn_out_data(
 
 	iBufSize = min((req->req.length - req->req.actual), data_size);
 
-	if ((ep->ep_type != USB_ENDPOINT_XFER_INT)
-		&& (req->req.dma != 0)
-		&& (iBufSize  >= sizeof(u32))) {
+	if ((ep->ep_type != USB_ENDPOINT_XFER_INT) && (req->req.dma != 0) &&
+	    (iBufSize  >= sizeof(u32))) {
 		nret = _nbu2ss_out_dma(udc, req, num, iBufSize);
 	} else {
 		iBufSize = min_t(u32, iBufSize, ep->ep.maxpacket);
@@ -996,8 +995,8 @@ static int _nbu2ss_epn_out_transfer(
 			}
 		}
 	} else {
-		if ((req->req.actual == req->req.length)
-			|| ((req->req.actual % ep->ep.maxpacket) != 0)) {
+		if ((req->req.actual == req->req.length) ||
+		    ((req->req.actual % ep->ep.maxpacket) != 0)) {
 			result = 0;
 		}
 	}
@@ -1166,9 +1165,8 @@ static int _nbu2ss_epn_in_data(
 
 	num = ep->epnum - 1;
 
-	if ((ep->ep_type != USB_ENDPOINT_XFER_INT)
-		&& (req->req.dma != 0)
-		&& (data_size >= sizeof(u32))) {
+	if ((ep->ep_type != USB_ENDPOINT_XFER_INT) && (req->req.dma != 0) &&
+	    (data_size >= sizeof(u32))) {
 		nret = _nbu2ss_in_dma(udc, ep, req, num, data_size);
 	} else {
 		data_size = min_t(u32, data_size, ep->ep.maxpacket);
@@ -1577,8 +1575,7 @@ static int std_req_get_status(struct nbu2ss_udc *udc)
 	u8	ep_adrs;
 	int	result = -EINVAL;
 
-	if ((udc->ctrl.wValue != 0x0000)
-		|| (direction != USB_DIR_IN)) {
+	if ((udc->ctrl.wValue != 0x0000) || (direction != USB_DIR_IN)) {
 		return result;
 	}
 
@@ -1891,9 +1888,8 @@ static inline void _nbu2ss_ep0_int(struct nbu2ss_udc *udc)
 			break;
 
 		case EP0_OUT_STATUS_PAHSE:
-			if ((status & STG_END_INT)
-			|| (status & SETUP_INT)
-			|| (status & EP0_OUT_NULL_INT)) {
+			if ((status & STG_END_INT) || (status & SETUP_INT) ||
+			    (status & EP0_OUT_NULL_INT)) {
 				status &= ~(STG_END_INT
 						| EP0_OUT_INT
 						| EP0_OUT_NULL_INT);
@@ -2537,8 +2533,8 @@ static int nbu2ss_ep_enable(
 	}
 
 	ep_type = usb_endpoint_type(desc);
-	if ((ep_type == USB_ENDPOINT_XFER_CONTROL)
-		|| (ep_type == USB_ENDPOINT_XFER_ISOC)) {
+	if ((ep_type == USB_ENDPOINT_XFER_CONTROL) ||
+	    (ep_type == USB_ENDPOINT_XFER_ISOC)) {
 		pr_err(" *** %s, bat bmAttributes\n", __func__);
 		return -EINVAL;
 	}
@@ -2547,8 +2543,7 @@ static int nbu2ss_ep_enable(
 	if (udc->vbus_active == 0)
 		return -ESHUTDOWN;
 
-	if ((!udc->driver)
-		|| (udc->gadget.speed == USB_SPEED_UNKNOWN)) {
+	if ((!udc->driver) || (udc->gadget.speed == USB_SPEED_UNKNOWN)) {
 		dev_err(ep->udc->dev, " *** %s, udc !!\n", __func__);
 		return -ESHUTDOWN;
 	}
@@ -2663,9 +2658,7 @@ static int nbu2ss_ep_queue(
 	}
 
 	req = container_of(_req, struct nbu2ss_req, req);
-	if (unlikely
-	    (!_req->complete || !_req->buf
-	     || !list_empty(&req->queue))) {
+	if (unlikely(!_req->complete || !_req->buf || !list_empty(&req->queue))) {
 		if (!_req->complete)
 			pr_err("udc: %s --- !_req->complete\n", __func__);
 
-- 
2.1.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/5] staging: emxx_udc: emxx_udc.c {} Single statement blocks
  2016-11-21 15:05 [PATCH 0/5] staging: emxx_udc: emxx_udc.c checkpatch modifications Walt Feasel
  2016-11-21 15:05 ` [PATCH 1/5] staging: emxx_udc: emxx_udc.c Blank lines after { Walt Feasel
  2016-11-21 15:05 ` [PATCH 2/5] staging: emxx_udc: emxx_udc.c Logical continuation Walt Feasel
@ 2016-11-21 15:05 ` Walt Feasel
  2016-11-21 15:05 ` [PATCH 4/5] staging: emxx_udc: emxx_udc.c Spaces preferred around operators Walt Feasel
  2016-11-21 15:05 ` [PATCH 5/5] staging: emxx_udc: emxx_udc.c Align parenthesis Walt Feasel
  4 siblings, 0 replies; 6+ messages in thread
From: Walt Feasel @ 2016-11-21 15:05 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Walt Feasel

Make suggested checkpatch modification for
WARNING: braces {} are not necessary for single
statement blocks

Signed-off-by: Walt Feasel <waltfeasel@gmail.com>
---
 drivers/staging/emxx_udc/emxx_udc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index de8f065..3a29f38 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -1575,9 +1575,8 @@ static int std_req_get_status(struct nbu2ss_udc *udc)
 	u8	ep_adrs;
 	int	result = -EINVAL;
 
-	if ((udc->ctrl.wValue != 0x0000) || (direction != USB_DIR_IN)) {
+	if ((udc->ctrl.wValue != 0x0000) || (direction != USB_DIR_IN))
 		return result;
-	}
 
 	length = min_t(u16, udc->ctrl.wLength, sizeof(status_data));
 
-- 
2.1.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4/5] staging: emxx_udc: emxx_udc.c Spaces preferred around operators
  2016-11-21 15:05 [PATCH 0/5] staging: emxx_udc: emxx_udc.c checkpatch modifications Walt Feasel
                   ` (2 preceding siblings ...)
  2016-11-21 15:05 ` [PATCH 3/5] staging: emxx_udc: emxx_udc.c {} Single statement blocks Walt Feasel
@ 2016-11-21 15:05 ` Walt Feasel
  2016-11-21 15:05 ` [PATCH 5/5] staging: emxx_udc: emxx_udc.c Align parenthesis Walt Feasel
  4 siblings, 0 replies; 6+ messages in thread
From: Walt Feasel @ 2016-11-21 15:05 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Walt Feasel

Make suggested checkpatch modification for
CHECK: spaces preferred around that '|'

Signed-off-by: Walt Feasel <waltfeasel@gmail.com>
---
 drivers/staging/emxx_udc/emxx_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index 3a29f38..65672b5 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -262,7 +262,7 @@ static int _nbu2ss_ep_init(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep)
 	}
 
 	_nbu2ss_bitset(&udc->p_regs->EP_REGS[num].EP_CONTROL, data);
-	_nbu2ss_endpoint_toggle_reset(udc, (ep->epnum|ep->direct));
+	_nbu2ss_endpoint_toggle_reset(udc, (ep->epnum | ep->direct));
 
 	if (ep->direct == USB_DIR_OUT) {
 		/*---------------------------------------------------------*/
-- 
2.1.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 5/5] staging: emxx_udc: emxx_udc.c Align parenthesis
  2016-11-21 15:05 [PATCH 0/5] staging: emxx_udc: emxx_udc.c checkpatch modifications Walt Feasel
                   ` (3 preceding siblings ...)
  2016-11-21 15:05 ` [PATCH 4/5] staging: emxx_udc: emxx_udc.c Spaces preferred around operators Walt Feasel
@ 2016-11-21 15:05 ` Walt Feasel
  4 siblings, 0 replies; 6+ messages in thread
From: Walt Feasel @ 2016-11-21 15:05 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Walt Feasel

Make suggested checkpatch modification for
CHECK: Alignment should match open parenthesis

Signed-off-by: Walt Feasel <waltfeasel@gmail.com>
---
 drivers/staging/emxx_udc/emxx_udc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index 65672b5..3f42fa8 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -3284,8 +3284,8 @@ static int nbu2ss_drv_remove(struct platform_device *pdev)
 	for (i = 0; i < NUM_ENDPOINTS; i++) {
 		ep = &udc->ep[i];
 		if (ep->virt_buf)
-			dma_free_coherent(NULL, PAGE_SIZE,
-				(void *)ep->virt_buf, ep->phys_buf);
+			dma_free_coherent(NULL, PAGE_SIZE, (void *)ep->virt_buf,
+					  ep->phys_buf);
 	}
 
 	/* Interrupt Handler - Release */
-- 
2.1.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-11-21 15:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-21 15:05 [PATCH 0/5] staging: emxx_udc: emxx_udc.c checkpatch modifications Walt Feasel
2016-11-21 15:05 ` [PATCH 1/5] staging: emxx_udc: emxx_udc.c Blank lines after { Walt Feasel
2016-11-21 15:05 ` [PATCH 2/5] staging: emxx_udc: emxx_udc.c Logical continuation Walt Feasel
2016-11-21 15:05 ` [PATCH 3/5] staging: emxx_udc: emxx_udc.c {} Single statement blocks Walt Feasel
2016-11-21 15:05 ` [PATCH 4/5] staging: emxx_udc: emxx_udc.c Spaces preferred around operators Walt Feasel
2016-11-21 15:05 ` [PATCH 5/5] staging: emxx_udc: emxx_udc.c Align parenthesis Walt Feasel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome