]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Umem 1 of 2 - Fix compile warning in umem.c
authorNeil Brown <neilb@cse.unsw.edu.au>
Tue, 18 Jun 2002 10:38:46 +0000 (03:38 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Tue, 18 Jun 2002 10:38:46 +0000 (03:38 -0700)
Cast to u64 before >>32, incase it was only u32 - thanks to Alan Cox.

drivers/block/umem.c

index 44909021aa06e418625ca81ed4031f06ea5c303e..72d1c687c0a49b52feef23a90870d54d1ec20ac7 100644 (file)
@@ -341,8 +341,9 @@ static void mm_start_io(struct cardinfo *card)
        offset = ((char*)desc) - ((char*)page->desc);
        writel(cpu_to_le32((page->page_dma+offset)&0xffffffff),
               card->csr_remap + DMA_DESCRIPTOR_ADDR);
-       /* if sizeof(dma_addr_t) == 32, this will generate a warning, sorry */
-       writel(cpu_to_le32((page->page_dma)>>32),
+       /* Force the value to u64 before shifting otherwise >> 32 is undefined C
+        * and on some ports will do nothing ! */
+       writel(cpu_to_le32(((u64)page->page_dma)>>32),
               card->csr_remap + DMA_DESCRIPTOR_ADDR + 4);
 
        /* Go, go, go */