On Sunday 13 August 2006 15:03, Denis Vlasenko wrote: > Basically, patches deinline some functions, mainly those > which perform port I/O. Comment says "Read high byte first as some registers increment..." but code doesn't guarantee that, I think: return ((ahd_inb(ahd, port+1) << 8) | ahd_inb(ahd, port)); Compiler can reorder it. Make the order explicit. -- vda
diff -urpN -U4 linux-2.6.17.8.aic3/drivers/scsi/aic7xxx/aic79xx_core.c linux-2.6.17.8.aic4/drivers/scsi/aic7xxx/aic79xx_core.c --- linux-2.6.17.8.aic3/drivers/scsi/aic7xxx/aic79xx_core.c 2006-08-13 12:01:42.000000000 +0200 +++ linux-2.6.17.8.aic4/drivers/scsi/aic7xxx/aic79xx_core.c 2006-08-13 12:14:13.000000000 +0200 @@ -341,9 +341,11 @@ ahd_inw(struct ahd_softc *ahd, u_int por * Read high byte first as some registers increment * or have other side effects when the low byte is * read. */ - return ((ahd_inb(ahd, port+1) << 8) | ahd_inb(ahd, port)); + uint16_t r = ahd_inb(ahd, port+1) << 8; + r |= ahd_inb(ahd, port); + return r; } void ahd_outw(struct ahd_softc *ahd, u_int port, u_int value)