Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752749AbdLEIvo (ORCPT ); Tue, 5 Dec 2017 03:51:44 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:57878 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751840AbdLEIvn (ORCPT ); Tue, 5 Dec 2017 03:51:43 -0500 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com vB58nwKG015565 X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Boris Brezillon Cc: Masahiro Yamada , Cyrille Pitchen , linux-kernel@vger.kernel.org, Marek Vasut , Brian Norris , Richard Weinberger , David Woodhouse Subject: [PATCH] mtd: nand: cafe: clean up DMA address setup Date: Tue, 5 Dec 2017 17:49:56 +0900 Message-Id: <1512463796-29174-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1077 Lines: 30 Use macros from to make the code readable. The compiler warning will be kept suppressed. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/cafe_nand.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c index add4613..2af5e35 100644 --- a/drivers/mtd/nand/cafe_nand.c +++ b/drivers/mtd/nand/cafe_nand.c @@ -737,12 +737,8 @@ static int cafe_nand_probe(struct pci_dev *pdev, } /* Set up DMA address */ - cafe_writel(cafe, cafe->dmaaddr & 0xffffffff, NAND_DMA_ADDR0); - if (sizeof(cafe->dmaaddr) > 4) - /* Shift in two parts to shut the compiler up */ - cafe_writel(cafe, (cafe->dmaaddr >> 16) >> 16, NAND_DMA_ADDR1); - else - cafe_writel(cafe, 0, NAND_DMA_ADDR1); + cafe_writel(cafe, lower_32_bits(cafe->dmaaddr), NAND_DMA_ADDR0); + cafe_writel(cafe, upper_32_bits(cafe->dmaaddr), NAND_DMA_ADDR1); cafe_dev_dbg(&cafe->pdev->dev, "Set DMA address to %x (virt %p)\n", cafe_readl(cafe, NAND_DMA_ADDR0), cafe->dmabuf); -- 2.7.4