From: Afonso Bordado Date: Tue, 20 Dec 2016 13:55:07 +0000 (+0000) Subject: staging: emxx_udc: Remove unecessary temporary variable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7e026bfabbe479245aba4892863853ef44f8e981;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: emxx_udc: Remove unecessary temporary variable This improves code readability. Signed-off-by: Afonso Bordado Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index eab3dffd1e39..8e22c55ca698 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); } /*-------------------------------------------------------------------------*/