--- 13_atapi_pio_trailing_data_handling/drivers/scsi/libata-core.c 2005-06-09 11:05:10.000000000 +0800 +++ 14_atapi_pio_odd_handling/drivers/scsi/libata-core.c 2005-06-09 11:04:09.000000000 +0800 @@ -2491,7 +2491,7 @@ unsigned int buflen, int write_data) { unsigned int i; - unsigned int words = buflen >> 1; + unsigned int words = (buflen+1) >> 1; u16 *buf16 = (u16 *) buf; void __iomem *mmio = (void __iomem *)ap->ioaddr.data_addr; @@ -2507,7 +2507,7 @@ static void ata_pio_data_xfer(struct ata_port *ap, unsigned char *buf, unsigned int buflen, int write_data) { - unsigned int dwords = buflen >> 1; + unsigned int dwords = (buflen+1) >> 1; if (write_data) outsw(ap->ioaddr.data_addr, buf, dwords);