mtd: denali: fix incorrect bitmask error in denali_setup_dma

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Feb 16 18:59:04 PST 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=7c272ac5eefb329501aadbd9f21f86232c0f66a9
Commit:     7c272ac5eefb329501aadbd9f21f86232c0f66a9
Parent:     a9b679bfd2820f59a0d914dad148f1fb09d3084a
Author:     Graham Moore <grmoore at opensource.altera.com>
AuthorDate: Fri Jan 9 09:32:35 2015 -0600
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Tue Jan 13 02:32:08 2015 -0800

    mtd: denali: fix incorrect bitmask error in denali_setup_dma
    
    commit 3157d1ed2309 ("mtd: denali: remove unnecessary casts") introduced
    an error by using a wrong bitmask.
    
    A uint16_t cast was replaced with & 0xff, should be & 0xffff.
    
    Signed-off-by: Graham Moore <grmoore at opensource.altera.com>
    Signed-off-by: Dinh Nguyen <dinguyen at opensource.altera.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/denali.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index b3b7ca1..5e397fb 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1041,7 +1041,7 @@ static void denali_setup_dma(struct denali_nand_info *denali, int op)
 	index_addr(denali, mode | ((addr >> 16) << 8), 0x2200);
 
 	/* 3. set memory low address bits 23:8 */
-	index_addr(denali, mode | ((addr & 0xff) << 8), 0x2300);
+	index_addr(denali, mode | ((addr & 0xffff) << 8), 0x2300);
 
 	/* 4. interrupt when complete, burst len = 64 bytes */
 	index_addr(denali, mode | 0x14000, 0x2400);



More information about the linux-mtd-cvs mailing list