Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764095AbcLTNz2 (ORCPT ); Tue, 20 Dec 2016 08:55:28 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21410 "EHLO sender163-mail.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763778AbcLTNzW (ORCPT ); Tue, 20 Dec 2016 08:55:22 -0500 From: Afonso Bordado To: gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/4] staging: emxx_udc: Remove unecessary temporary variable Date: Tue, 20 Dec 2016 13:55:07 +0000 Message-Id: X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1198 Lines: 43 This improves code readability. Signed-off-by: Afonso Bordado --- drivers/staging/emxx_udc/emxx_udc.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index 0963533..45808ed 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -556,21 +556,19 @@ static void _nbu2ss_dma_unmap_single( static int ep0_out_pio(struct nbu2ss_udc *udc, u8 *pBuf, u32 length) { u32 i; - int nret = 0; u32 numreads = length / sizeof(u32); union usb_reg_access *pBuf32 = (union usb_reg_access *)pBuf; - /*------------------------------------------------------------*/ + if (!numreads) + return 0; + /* PIO Read */ - if (numreads) { - for (i = 0; i < numreads; i++) { - pBuf32->dw = _nbu2ss_readl(&udc->p_regs->EP0_READ); - pBuf32++; - } - nret = numreads * sizeof(u32); + for (i = 0; i < numreads; i++) { + pBuf32->dw = _nbu2ss_readl(&udc->p_regs->EP0_READ); + pBuf32++; } - return nret; + return numreads * sizeof(u32); } /*-------------------------------------------------------------------------*/ -- 2.9.3