@@ -3611,7 +3611,7 @@ static int ata_mselect_caching(struct ata_queued_cmd *qc,
struct ata_taskfile *tf = &qc->tf;
struct ata_device *dev = qc->dev;
char mpage[CACHE_MPAGE_LEN];
- u8 wce;
+ u8 wce, mask;
int i;
/*
@@ -3632,8 +3632,11 @@ static int ata_mselect_caching(struct ata_queued_cmd *qc,
ata_msense_caching(dev->id, mpage, false);
for (i = 0; i < CACHE_MPAGE_LEN - 2; i++) {
if (i == 0)
- continue;
- if (mpage[i + 2] != buf[i]) {
+ mask = 0xfb;
+ else
+ mask = 0xff;
+
+ if ((mpage[i + 2] & mask) != (buf[i] & mask)) {
*fp = i;
return -EINVAL;
}
@@ -3666,7 +3669,7 @@ static int ata_mselect_control(struct ata_queued_cmd *qc,
{
struct ata_device *dev = qc->dev;
char mpage[CONTROL_MPAGE_LEN];
- u8 d_sense;
+ u8 d_sense, mask;
int i;
/*
@@ -3687,8 +3690,11 @@ static int ata_mselect_control(struct ata_queued_cmd *qc,
ata_msense_control(dev, mpage, false);
for (i = 0; i < CONTROL_MPAGE_LEN - 2; i++) {
if (i == 0)
- continue;
- if (mpage[2 + i] != buf[i]) {
+ mask = 0xfb;
+ else
+ mask = 0xff;
+
+ if ((mpage[2 + i] & mask) != (buf[i] & mask)) {
*fp = i;
return -EINVAL;
}