Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934322AbcLTJs4 (ORCPT ); Tue, 20 Dec 2016 04:48:56 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21364 "EHLO sender163-mail.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934302AbcLTJsx (ORCPT ); Tue, 20 Dec 2016 04:48:53 -0500 Date: Tue, 20 Dec 2016 09:48:48 +0000 From: Afonso Bordado To: gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] staging: emxx_udc: Fix styling issues Message-ID: <20161220094848.vap4t55zpv72amto@AYYLMAO> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20161126 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2124 Lines: 69 Fix CamelCase styling issues with EP0_out_PIO Remove unecessary temporary variables Signed-off-by: Afonso Bordado --- drivers/staging/emxx_udc/emxx_udc.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index 3f42fa8..b0fbd10 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -553,28 +553,23 @@ static void _nbu2ss_dma_unmap_single( /*-------------------------------------------------------------------------*/ /* Endpoint 0 OUT Transfer (PIO) */ -static int EP0_out_PIO(struct nbu2ss_udc *udc, u8 *pBuf, u32 length) +static int ep0_out_pio(struct nbu2ss_udc *udc, u8 *buf, u32 length) { - u32 i; - int nret = 0; - u32 iWordLength = 0; - union usb_reg_access *pBuf32 = (union usb_reg_access *)pBuf; - - /*------------------------------------------------------------*/ + u32 i; /* Read Length */ - iWordLength = length / sizeof(u32); + u32 numreads = length / sizeof(u32); + union usb_reg_access *buf32 = (union usb_reg_access *)buf; + + if (!numreads) + return 0; - /*------------------------------------------------------------*/ /* PIO Read */ - if (iWordLength) { - for (i = 0; i < iWordLength; i++) { - pBuf32->dw = _nbu2ss_readl(&udc->p_regs->EP0_READ); - pBuf32++; - } - nret = iWordLength * sizeof(u32); + for (i = 0; i < numreads; i++) { + buf32->dw = _nbu2ss_readl(&udc->p_regs->EP0_READ); + buf32++; } - return nret; + return numreads * sizeof(u32); } /*-------------------------------------------------------------------------*/ @@ -758,7 +753,7 @@ static int _nbu2ss_ep0_out_transfer( pBuffer = (u8 *)req->req.buf; pBuffer += req->req.actual; - result = EP0_out_PIO(udc, pBuffer + result = ep0_out_pio(udc, pBuffer , min(iRemainSize, iRecvLength)); if (result < 0) return result; -- 2.9.3 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel