Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1959283pxa; Sat, 29 Aug 2020 09:05:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGKnaVMOACrdFvPKtzbnqeFJZrW1cRWLjs3xRT6+gLZbg3VjF1mcW3/NrLYDEX7fKL/GSq X-Received: by 2002:aa7:c611:: with SMTP id h17mr3908749edq.219.1598717100324; Sat, 29 Aug 2020 09:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598717100; cv=none; d=google.com; s=arc-20160816; b=YRoJRvGSkxEGRepz1+wncTW+1CzCiO3RmjO5a4tmew5HoPSlbAofVMj9Nw9Tgn6qz2 FQeOxD7r9TBeCVPN58iBwcSuI2/mpaFu++vSptRN/5AfammMqgYDNhY0olyFgTb83176 kOO6l91LQBZlz3TCtei8zVF/ZE0H57nOqRcDolGVxO4kcxDadkvaeBdNQLLbsQDHdXGM 17DWDsQobyCoKm4TJ7yBb40er9Yjum85BDW9Mr++NeCR6vBJmAhDjhYQTxBXGkgfNL0O wXfsKo4cyjbt4h6mq7ELG/xe6jud/pkdvwIcpoJEQ0sQbSv7uGJ4M1gdxSpwcwpFN1FI yK5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=XnHgP98eHPxq19/JouzDoQB7Aoo91QNSgUyEcMxGjKo=; b=kwbAgSF2c1iiJ0kqky3usulk1e0XChRYwBND9PX4uC34MFRNFuPCptgxkvG6HgAzyW n/sZnhfmYpyYRzeLr1td/qBpo3OVXi7hEo1T70ih6C7vFRQOEyaBqNgy/7T520bPhUJD 464ci8VAz3crSleHTMLRSPNEoq6vReMPfOPkhYWUJrac/D4FniFSfC0xmqEsMsBFSANF AaetWznuMa9Mrm2NXvx+3xfZt/hJU6OQ6u/2d+Lun8sDf3qifX1v4XohOFlJvjia6JTR nPgcMzqC6zeuqJHXxx3bH/Hd4tf/qSlerUVbobIckvs/Qs8srnbn8KnLDxtjxw4P+BoT b7IQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v16si2284903ejk.264.2020.08.29.09.04.37; Sat, 29 Aug 2020 09:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728496AbgH2QBf (ORCPT + 99 others); Sat, 29 Aug 2020 12:01:35 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:50538 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728373AbgH2P6z (ORCPT ); Sat, 29 Aug 2020 11:58:55 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4Bf1NS3lsKz9v7Dc; Sat, 29 Aug 2020 17:58:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id AZI3cKIA-s-O; Sat, 29 Aug 2020 17:58:48 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4Bf1NS1r4Pz9v7Db; Sat, 29 Aug 2020 17:58:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id EECD58B7B5; Sat, 29 Aug 2020 17:58:49 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id qSw0-iSMqS91; Sat, 29 Aug 2020 17:58:49 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 29E728B767; Sat, 29 Aug 2020 17:58:49 +0200 (CEST) Subject: Re: [PATCH] fsldma: fsl_ioread64*() do not need lower_32_bits() To: Guenter Roeck , Luc Van Oostenryck Cc: Herbert Xu , Joerg Roedel , linuxppc-dev@lists.ozlabs.org, Li Yang , Zhang Wei , Vinod Koul , dmaengine@vger.kernel.org, Andrew Morton , Linus Torvalds , Dan Williams , linux-kernel@vger.kernel.org References: <20200829150551.GA27225@roeck-us.net> From: Christophe Leroy Message-ID: Date: Sat, 29 Aug 2020 17:58:24 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200829150551.GA27225@roeck-us.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 29/08/2020 à 17:05, Guenter Roeck a écrit : > On Sat, Aug 29, 2020 at 02:45:38PM +0200, Luc Van Oostenryck wrote: >> For ppc32, the functions fsl_ioread64() & fsl_ioread64be() >> use lower_32_bits() as a fancy way to cast the pointer to u32 >> in order to do non-atomic 64-bit IO. >> >> But the pointer is already 32-bit, so simply cast the pointer to u32. >> >> This fixes a compile error introduced by >> ef91bb196b0d ("kernel.h: Silence sparse warning in lower_32_bits") >> >> Fixes: ef91bb196b0db1013ef8705367bc2d7944ef696b > > checkpatch complains about this and prefers > > Fixes: ef91bb196b0d ("kernel.h: Silence sparse warning in lower_32_bits") Checkpatch also complains about spacing: CHECK:SPACING: No space is necessary after a cast #39: FILE: drivers/dma/fsldma.h:208: + u32 fsl_addr = (u32) addr; CHECK:SPACING: No space is necessary after a cast #48: FILE: drivers/dma/fsldma.h:222: + u32 fsl_addr = (u32) addr; total: 0 errors, 0 warnings, 2 checks, 16 lines checked Christophe > > Otherwise > > Tested-by: Guenter Roeck > >> Reported-by: Guenter Roeck >> Cc: Li Yang >> Cc: Zhang Wei >> Cc: Dan Williams >> Cc: Vinod Koul >> Cc: Herbert Xu >> Cc: linuxppc-dev@lists.ozlabs.org >> Cc: dmaengine@vger.kernel.org >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: Luc Van Oostenryck >> --- >> drivers/dma/fsldma.h | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h >> index 56f18ae99233..6f6fa7641fa2 100644 >> --- a/drivers/dma/fsldma.h >> +++ b/drivers/dma/fsldma.h >> @@ -205,7 +205,7 @@ struct fsldma_chan { >> #else >> static u64 fsl_ioread64(const u64 __iomem *addr) >> { >> - u32 fsl_addr = lower_32_bits(addr); >> + u32 fsl_addr = (u32) addr; >> u64 fsl_addr_hi = (u64)in_le32((u32 *)(fsl_addr + 1)) << 32; >> >> return fsl_addr_hi | in_le32((u32 *)fsl_addr); >> @@ -219,7 +219,7 @@ static void fsl_iowrite64(u64 val, u64 __iomem *addr) >> >> static u64 fsl_ioread64be(const u64 __iomem *addr) >> { >> - u32 fsl_addr = lower_32_bits(addr); >> + u32 fsl_addr = (u32) addr; >> u64 fsl_addr_hi = (u64)in_be32((u32 *)fsl_addr) << 32; >> >> return fsl_addr_hi | in_be32((u32 *)(fsl_addr + 1)); >> -- >> 2.28.0 >>