Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ata: fixup ATA_PROT_NODATA

The taskfile protocol is a numeric value, and can not be ORed. Currently
this is harmless as the protocol is always zeroed before, but if it ever
has a non-zero value the ORing would create incorrect results.

Signed-off-by: Hannes Reinecke <hare@suse.de>
[hch: updated patch description]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Hannes Reinecke and committed by
Tejun Heo
bd18bc04 b38d4d85

+3 -3
+2 -2
drivers/ata/libata-core.c
··· 1238 1238 } else 1239 1239 tf.command = ATA_CMD_READ_NATIVE_MAX; 1240 1240 1241 - tf.protocol |= ATA_PROT_NODATA; 1241 + tf.protocol = ATA_PROT_NODATA; 1242 1242 tf.device |= ATA_LBA; 1243 1243 1244 1244 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); ··· 1297 1297 tf.device |= (new_sectors >> 24) & 0xf; 1298 1298 } 1299 1299 1300 - tf.protocol |= ATA_PROT_NODATA; 1300 + tf.protocol = ATA_PROT_NODATA; 1301 1301 tf.device |= ATA_LBA; 1302 1302 1303 1303 tf.lbal = (new_sectors >> 0) & 0xff;
+1 -1
drivers/ata/libata-eh.c
··· 3177 3177 } 3178 3178 3179 3179 tf.flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_ISADDR; 3180 - tf.protocol |= ATA_PROT_NODATA; 3180 + tf.protocol = ATA_PROT_NODATA; 3181 3181 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); 3182 3182 if (park && (err_mask || tf.lbal != 0xc4)) { 3183 3183 ata_dev_err(dev, "head unload failed!\n");