Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFD1EC433F5 for ; Mon, 3 Oct 2022 11:01:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 11DCB84DD9; Mon, 3 Oct 2022 13:01:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=proton.me header.i=@proton.me header.b="LnYRFuAd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D244D84DC8; Sat, 1 Oct 2022 09:35:01 +0200 (CEST) Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 74EEE84DBB for ; Sat, 1 Oct 2022 09:34:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=csstrong@proton.me Date: Sat, 01 Oct 2022 07:34:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1664609697; x=1664868897; bh=G4SN45yAGPw8CkCmtXKmiBg9nETqfwaI9KM0FcTL4NA=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID; b=LnYRFuAdvLVC3t8Oj9ixLPSgRMCN8yji7Jm00/TWnsWSPQNeI/bTciHujxdpmqwO9 s3k0aoYKDchqcDL72Shd65pF8bhx5zKC/FVcoGCgrpXiF4ngYs3FrPof/RqhIW78ZV INSVCjtRCshJoVp7/pH6fV8a6un3EyJg+sjgSz1cz+eCITkvTStsy2G0Hkv7dKdik+ OIbdHZvHMLwHm1y2C+CnbSQmKc9lrXVV+/67IgqorjtJrSpKOZauGed6txxbUDA38J zNlOTXY7GFlpAxQEEGianZW4yrPpcEKdLhJk5CaSdEGCsKBz65bUAc5dQVHcNv9jJH sJfsk1zyiJvMA== To: Simon Glass From: Chris Strong Cc: Chris Strong , u-boot@lists.denx.de Subject: [PATCH] dma: cosmetic: clean fsl_dma.c errors and code style Message-ID: <20221001073448.202175-1-csstrong@proton.me> Feedback-ID: 45774772:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Mon, 03 Oct 2022 13:01:04 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Cleanup of the fsl_dma.c checkpatch immediate errors, whitespace warnings and coding style. Signed-off-by: Chris Strong --- drivers/dma/fsl_dma.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/dma/fsl_dma.c b/drivers/dma/fsl_dma.c index 1864b5d88b..b0448e8b56 100644 --- a/drivers/dma/fsl_dma.c +++ b/drivers/dma/fsl_dma.c @@ -22,7 +22,6 @@ #define FSL_DMA_MR_DEFAULT (FSL_DMA_MR_BWC_DIS | FSL_DMA_MR_CTM_DIRECT) #endif - #if defined(CONFIG_MPC83xx) dma83xx_t *dma_base =3D (void *)(CONFIG_SYS_MPC83xx_DMA_ADDR); #elif defined(CONFIG_MPC85xx) @@ -42,7 +41,7 @@ static void dma_sync(void) #endif } -static void out_dma32(volatile unsigned *addr, int val) +static void out_dma32(volatile unsigned int *addr, int val) { #if defined(CONFIG_MPC83xx) =09out_le32(addr, val); @@ -51,7 +50,7 @@ static void out_dma32(volatile unsigned *addr, int val) #endif } -static uint in_dma32(volatile unsigned *addr) +static uint in_dma32(volatile unsigned int *addr) { #if defined(CONFIG_MPC83xx) =09return in_le32(addr); @@ -60,7 +59,8 @@ static uint in_dma32(volatile unsigned *addr) #endif } -static uint dma_check(void) { +static uint dma_check(void) +{ =09volatile fsl_dma_t *dma =3D &dma_base->dma[0]; =09uint status; @@ -74,13 +74,14 @@ static uint dma_check(void) { =09dma_sync(); =09if (status !=3D 0) -=09=09printf ("DMA Error: status =3D %x\n", status); +=09=09printf("DMA Error: status =3D %x\n", status); =09return status; } #if !defined(CONFIG_MPC83xx) -void dma_init(void) { +void dma_init(void) +{ =09volatile fsl_dma_t *dma =3D &dma_base->dma[0]; =09out_dma32(&dma->satr, FSL_DMA_SATR_SREAD_SNOOP); @@ -90,15 +91,16 @@ void dma_init(void) { } #endif -int dmacpy(phys_addr_t dest, phys_addr_t src, phys_size_t count) { +int dmacpy(phys_addr_t dest, phys_addr_t src, phys_size_t count) +{ =09volatile fsl_dma_t *dma =3D &dma_base->dma[0]; =09uint xfer_size; =09while (count) { =09=09xfer_size =3D min(FSL_DMA_MAX_SIZE, count); -=09=09out_dma32(&dma->dar, (u32) (dest & 0xFFFFFFFF)); -=09=09out_dma32(&dma->sar, (u32) (src & 0xFFFFFFFF)); +=09=09out_dma32(&dma->dar, (u32)(dest & 0xFFFFFFFF)); +=09=09out_dma32(&dma->sar, (u32)(src & 0xFFFFFFFF)); #if !defined(CONFIG_MPC83xx) =09=09out_dma32(&dma->satr, =09=09=09in_dma32(&dma->satr) | (u32)((u64)src >> 32)); -- 2.34.1