>>>>> On Thu, 1 Jul 2004 15:59:19 +0200, Ralf Baechle <ralf@linux-mips.org>
>>>>> said:
>> The loop contains paranoid out_of_line_bug, so it never be
>> optimized to empty.
ralf> Indeed and I think that's a bit of overkill. I've never seen
ralf> these assertions catch any bugs - and 2.4 isn't exactly new
ralf> anymore. Anyway, even if the loop was empty gcc would not
ralf> eleminate it.
Then how about this?
Index: pci.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/pci.h,v
retrieving revision 1.24.2.16
diff -u -r1.24.2.16 pci.h
--- pci.h 17 Nov 2003 01:07:45 -0000 1.24.2.16
+++ pci.h 3 Jul 2004 12:30:36 -0000
@@ -281,8 +281,16 @@
/* Make sure that gcc doesn't leave the empty loop body. */
#ifdef CONFIG_NONCOHERENT_IO
- for (i = 0; i < nelems; i++, sg++)
- dma_cache_wback_inv((unsigned long)sg->address, sg->length);
+ for (i = 0; i < nelems; i++, sg++) {
+ if (sg->address) {
+ dma_cache_wback_inv((unsigned long)sg->address,
+ sg->length);
+ } else {
+ dma_cache_wback_inv((unsigned long)
+ (page_address(sg->page) + sg->offset),
+ sg->length);
+ }
+ }
#endif
}
|