mtd: nand: cafe: clean up DMA address setup
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 5 Dec 2017 08:49:56 +0000 (17:49 +0900)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Thu, 14 Dec 2017 12:34:20 +0000 (13:34 +0100)
Use macros from <linux/kernel.h> to make the code readable.
The compiler warning will be kept suppressed.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/cafe_nand.c

index a438b711405375ad90feba113256b4f236ea9947..567ff972d5fcef110b71fa45a25d5b630c42136c 100644 (file)
@@ -729,12 +729,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);