Skip to content

Commit

Permalink
mtd: nand: denali: use upper/lower_32_bits() macro for clean-up
Browse files Browse the repository at this point in the history
I used (uint64_t) cast to avoid "right shift count >= width of type"
warning.  <linux/kernel.h> provides nice helpers to cater to it.
The code will be cleaner, and easier to understand.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
  • Loading branch information
Masahiro Yamada authored and Boris Brezillon committed Sep 22, 2017
1 parent 8582a03 commit 5f2baae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/nand/denali.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,10 @@ static void denali_setup_dma64(struct denali_nand_info *denali,
0x01002000 | (64 << 16) | (write << 8) | page_count);

/* 2. set memory low address */
denali_host_write(denali, mode, dma_addr);
denali_host_write(denali, mode, lower_32_bits(dma_addr));

/* 3. set memory high address */
denali_host_write(denali, mode, (uint64_t)dma_addr >> 32);
denali_host_write(denali, mode, upper_32_bits(dma_addr));
}

static void denali_setup_dma32(struct denali_nand_info *denali,
Expand Down

0 comments on commit 5f2baae

Please sign in to comment.