[PATCH] staging: emxx_udc: fix various function invocations indentation issues

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

 



Fix various warnings and checks issued by checkpatch.pl.

Signed-off-by: Emiliano Ingrassia <ingrassia.emiliano@xxxxxxxxx>
---
 Task 10 of the Eudyptula challenge.

 drivers/staging/emxx_udc/emxx_udc.c | 122 ++++++++++++++--------------
 1 file changed, 63 insertions(+), 59 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index a913d40f0801..51b1590b5d93 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -145,8 +145,9 @@ static void _nbu2ss_ep0_complete(struct usb_ep *_ep, struct usb_request *_req)
 		if (p_ctrl->bRequest == USB_REQ_SET_FEATURE) {
 			/*-------------------------------------------------*/
 			/* SET_FEATURE */
-			recipient = (u8)(p_ctrl->bRequestType & USB_RECIP_MASK);
-			selector  = le16_to_cpu(p_ctrl->wValue);
+			recipient =
+			    (u8)(p_ctrl->bRequestType & USB_RECIP_MASK);
+			selector = le16_to_cpu(p_ctrl->wValue);
 			if ((recipient == USB_RECIP_DEVICE) &&
 			    (selector == USB_DEVICE_TEST_MODE)) {
 				wIndex = le16_to_cpu(p_ctrl->wIndex);
@@ -459,22 +460,22 @@ static void _nbu2ss_dma_map_single(struct nbu2ss_udc *udc,
 		if (req->unaligned) {
 			req->req.dma = ep->phys_buf;
 		} else {
-			req->req.dma = dma_map_single(
-				udc->gadget.dev.parent,
-				req->req.buf,
-				req->req.length,
-				(direct == USB_DIR_IN)
-				? DMA_TO_DEVICE : DMA_FROM_DEVICE);
+			req->req.dma = dma_map_single(udc->gadget.dev.parent,
+						      req->req.buf,
+						      req->req.length,
+						      (direct == USB_DIR_IN)
+						      ? DMA_TO_DEVICE :
+						      DMA_FROM_DEVICE);
 		}
 		req->mapped = 1;
 	} else {
 		if (!req->unaligned)
-			dma_sync_single_for_device(
-				udc->gadget.dev.parent,
-				req->req.dma,
-				req->req.length,
-				(direct == USB_DIR_IN)
-				? DMA_TO_DEVICE : DMA_FROM_DEVICE);
+			dma_sync_single_for_device(udc->gadget.dev.parent,
+						   req->req.dma,
+						   req->req.length,
+						   (direct == USB_DIR_IN)
+						   ? DMA_TO_DEVICE :
+						   DMA_FROM_DEVICE);

 		req->mapped = 0;
 	}
@@ -506,9 +507,8 @@ static void _nbu2ss_dma_unmap_single(struct nbu2ss_udc *udc,
 		} else {
 			dma_unmap_single(udc->gadget.dev.parent,
 					 req->req.dma, req->req.length,
-				(direct == USB_DIR_IN)
-				? DMA_TO_DEVICE
-				: DMA_FROM_DEVICE);
+					 (direct == USB_DIR_IN)
+					 ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
 		}
 		req->req.dma = DMA_ADDR_INVALID;
 		req->mapped = 0;
@@ -516,9 +516,9 @@ static void _nbu2ss_dma_unmap_single(struct nbu2ss_udc *udc,
 		if (!req->unaligned)
 			dma_sync_single_for_cpu(udc->gadget.dev.parent,
 						req->req.dma, req->req.length,
-				(direct == USB_DIR_IN)
-				? DMA_TO_DEVICE
-				: DMA_FROM_DEVICE);
+						(direct == USB_DIR_IN)
+						? DMA_TO_DEVICE
+						: DMA_FROM_DEVICE);
 	}

 	if (count) {
@@ -728,8 +728,9 @@ static int _nbu2ss_ep0_out_transfer(struct nbu2ss_udc *udc,
 		p_buffer = (u8 *)req->req.buf;
 		p_buffer += req->req.actual;

-		result = ep0_out_pio(udc, p_buffer
-					, min(i_remain_size, i_recv_length));
+		result =
+		    ep0_out_pio(udc, p_buffer,
+				min(i_remain_size, i_recv_length));
 		if (result < 0)
 			return result;

@@ -740,8 +741,10 @@ static int _nbu2ss_ep0_out_transfer(struct nbu2ss_udc *udc,
 			p_buffer += result;
 			i_remain_size -= result;

-			result = ep0_out_overbytes(udc, p_buffer
-					, min(i_remain_size, i_recv_length));
+			result =
+			    ep0_out_overbytes(udc, p_buffer,
+					      min(i_remain_size,
+						  i_recv_length));
 			req->req.actual += result;
 		}
 	} else {
@@ -830,8 +833,7 @@ static int _nbu2ss_out_dma(struct nbu2ss_udc *udc, struct nbu2ss_req *req,
 		_nbu2ss_writel(&preg->EP_REGS[num].EP_LEN_DCNT, 0);
 		_nbu2ss_bitclr(&preg->EP_REGS[num].EP_DMA_CTRL, EPN_BURST_SET);
 	} else {
-		_nbu2ss_writel(&preg->EP_REGS[num].EP_LEN_DCNT
-				, (dmacnt << 16));
+		_nbu2ss_writel(&preg->EP_REGS[num].EP_LEN_DCNT, (dmacnt << 16));
 		_nbu2ss_bitset(&preg->EP_REGS[num].EP_DMA_CTRL, EPN_BURST_SET);
 	}
 	_nbu2ss_bitset(&preg->EP_REGS[num].EP_DMA_CTRL, EPN_DMA_EN);
@@ -870,7 +872,8 @@ static int _nbu2ss_epn_out_pio(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep,
 		/* Copy of every four bytes */
 		for (i = 0; i < i_word_length; i++) {
 			p_buf_32->dw =
-			_nbu2ss_readl(&preg->EP_REGS[ep->epnum - 1].EP_READ);
+				_nbu2ss_readl(
+					&preg->EP_REGS[ep->epnum - 1].EP_READ);
 			p_buf_32++;
 		}
 		result = i_word_length * sizeof(u32);
@@ -881,8 +884,8 @@ static int _nbu2ss_epn_out_pio(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep,
 		/*---------------------------------------------------------*/
 		/* Copy of fraction byte */
 		temp_32.dw =
-			_nbu2ss_readl(&preg->EP_REGS[ep->epnum - 1].EP_READ);
-		for (i = 0 ; i < data ; i++)
+		    _nbu2ss_readl(&preg->EP_REGS[ep->epnum - 1].EP_READ);
+		for (i = 0; i < data; i++)
 			p_buf_32->byte.DATA[i] = temp_32.byte.DATA[i];
 		result += data;
 	}
@@ -940,8 +943,8 @@ static int _nbu2ss_epn_out_transfer(struct nbu2ss_udc *udc,

 	/*-------------------------------------------------------------*/
 	/* Receive Length */
-	i_recv_length
-		= _nbu2ss_readl(&preg->EP_REGS[num].EP_LEN_DCNT) & EPN_LDATA;
+	i_recv_length =
+		_nbu2ss_readl(&preg->EP_REGS[num].EP_LEN_DCNT) & EPN_LDATA;

 	if (i_recv_length != 0) {
 		result = _nbu2ss_epn_out_data(udc, ep, req, i_recv_length);
@@ -1072,9 +1075,8 @@ static int _nbu2ss_epn_in_pio(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep,
 		if (i_word_length > 0) {
 			for (i = 0; i < i_word_length; i++) {
 				_nbu2ss_writel(
-					&preg->EP_REGS[ep->epnum - 1].EP_WRITE
-					, p_buf_32->dw
-				);
+					&preg->EP_REGS[ep->epnum - 1].EP_WRITE,
+					p_buf_32->dw);

 				p_buf_32++;
 			}
@@ -1224,7 +1226,8 @@ static void _nbu2ss_restert_transfer(struct nbu2ss_ep *ep)
 		return;

 	if (ep->epnum > 0) {
-		length = _nbu2ss_readl(
+		length =
+		    _nbu2ss_readl(
 			&ep->udc->p_regs->EP_REGS[ep->epnum - 1].EP_LEN_DCNT);

 		length &= EPN_LDATA;
@@ -1292,17 +1295,18 @@ static void _nbu2ss_set_endpoint_stall(struct nbu2ss_udc *udc,
 			/* Clear STALL */
 			ep->stalled = FALSE;
 			if (ep_adrs & USB_DIR_IN) {
-				_nbu2ss_bitclr(&preg->EP_REGS[num].EP_CONTROL
-						, EPN_ISTL);
+				_nbu2ss_bitclr(&preg->EP_REGS[num].EP_CONTROL,
+					       EPN_ISTL);
 			} else {
 				data =
-				_nbu2ss_readl(&preg->EP_REGS[num].EP_CONTROL);
+				    _nbu2ss_readl(
+					&preg->EP_REGS[num].EP_CONTROL);

 				data &= ~EPN_OSTL;
 				data |= EPN_OSTL_EN;

-				_nbu2ss_writel(&preg->EP_REGS[num].EP_CONTROL
-						, data);
+				_nbu2ss_writel(&preg->EP_REGS[num].EP_CONTROL,
+					       data);
 			}

 			ep->stalled = FALSE;
@@ -1406,7 +1410,7 @@ static inline int _nbu2ss_req_feature(struct nbu2ss_udc *udc, bool bset)
 	case USB_RECIP_DEVICE:
 		if (bset)
 			result =
-			_nbu2ss_set_feature_device(udc, selector, wIndex);
+			    _nbu2ss_set_feature_device(udc, selector, wIndex);
 		break;

 	case USB_RECIP_ENDPOINT:
@@ -1414,12 +1418,11 @@ static inline int _nbu2ss_req_feature(struct nbu2ss_udc *udc, bool bset)
 			if (selector == USB_ENDPOINT_HALT) {
 				ep_adrs = wIndex & 0xFF;
 				if (!bset) {
-					_nbu2ss_endpoint_toggle_reset(
-						udc, ep_adrs);
+					_nbu2ss_endpoint_toggle_reset(udc,
+								      ep_adrs);
 				}

-				_nbu2ss_set_endpoint_stall(
-					udc, ep_adrs, bset);
+				_nbu2ss_set_endpoint_stall(udc, ep_adrs, bset);

 				result = 0;
 			}
@@ -1460,10 +1463,10 @@ static void _nbu2ss_epn_set_stall(struct nbu2ss_udc *udc,
 	struct fc_regs __iomem *preg = udc->p_regs;

 	if (ep->direct == USB_DIR_IN) {
-		for (limit_cnt = 0
-			; limit_cnt < IN_DATA_EMPTY_COUNT
-			; limit_cnt++) {
-			regdata = _nbu2ss_readl(
+		for (limit_cnt = 0; limit_cnt < IN_DATA_EMPTY_COUNT;
+		     limit_cnt++) {
+			regdata =
+			    _nbu2ss_readl(
 				&preg->EP_REGS[ep->epnum - 1].EP_STATUS);

 			if ((regdata & EPN_IN_DATA) == 0)
@@ -1879,7 +1882,8 @@ static inline void _nbu2ss_epn_in_int(struct nbu2ss_udc *udc,
 	} else {
 		if (req->zero && ((req->req.actual % ep->ep.maxpacket) == 0)) {
 			status =
-			_nbu2ss_readl(&preg->EP_REGS[ep->epnum - 1].EP_STATUS);
+			    _nbu2ss_readl(
+				&preg->EP_REGS[ep->epnum - 1].EP_STATUS);

 			if ((status & EPN_IN_FULL) == 0) {
 				/*-----------------------------------------*/
@@ -1968,8 +1972,8 @@ static inline void _nbu2ss_epn_out_dma_int(struct nbu2ss_udc *udc,
 		}
 	}

-	ep_dmacnt = _nbu2ss_readl(&preg->EP_REGS[num].EP_LEN_DCNT)
-		 & EPN_DMACNT;
+	ep_dmacnt =
+		_nbu2ss_readl(&preg->EP_REGS[num].EP_LEN_DCNT) & EPN_DMACNT;
 	ep_dmacnt >>= 16;

 	for (i = 0; i < EPC_PLL_LOCK_COUNT; i++) {
@@ -2166,8 +2170,8 @@ static int _nbu2ss_enable_controller(struct nbu2ss_udc *udc)

 	_nbu2ss_writel(&udc->p_regs->AHBSCTR, WAIT_MODE);

-		_nbu2ss_writel(&udc->p_regs->AHBMCTR,
-			       HBUSREQ_MODE | HTRANS_MODE | WBURST_TYPE);
+	_nbu2ss_writel(&udc->p_regs->AHBMCTR,
+		       HBUSREQ_MODE | HTRANS_MODE | WBURST_TYPE);

 	while (!(_nbu2ss_readl(&udc->p_regs->EPCTR) & PLL_LOCK)) {
 		waitcnt++;
@@ -2178,7 +2182,7 @@ static int _nbu2ss_enable_controller(struct nbu2ss_udc *udc)
 		}
 	}

-		_nbu2ss_bitset(&udc->p_regs->UTMI_CHARACTER_1, USB_SQUSET);
+	_nbu2ss_bitset(&udc->p_regs->UTMI_CHARACTER_1, USB_SQUSET);

 	_nbu2ss_bitset(&udc->p_regs->USB_CONTROL, (INT_SEL | SOF_RCV));

@@ -2595,10 +2599,10 @@ static int nbu2ss_ep_queue(struct usb_ep *_ep,

 	if (req->unaligned) {
 		if (!ep->virt_buf)
-			ep->virt_buf = dma_alloc_coherent(
-				NULL, PAGE_SIZE,
-				&ep->phys_buf, GFP_ATOMIC | GFP_DMA);
-		if (ep->epnum > 0)  {
+			ep->virt_buf = dma_alloc_coherent(NULL, PAGE_SIZE,
+							  &ep->phys_buf,
+							  GFP_ATOMIC | GFP_DMA);
+		if (ep->epnum > 0) {
 			if (ep->direct == USB_DIR_IN)
 				memcpy(ep->virt_buf, req->req.buf,
 				       req->req.length);
--
2.21.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux