The dipm variable is confusing. Drop the variable and inline the expression at places where it is used. This will make it easier to perform additional cleanups. No functional change. Signed-off-by: Niklas Cassel <cassel@xxxxxxxxxx> --- drivers/ata/libata-eh.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index d2ccdb9a2840..34167263af87 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -3458,13 +3458,13 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, */ ata_for_each_dev(dev, link, ENABLED) { bool hipm = ata_id_has_hipm(dev->id); - bool dipm = ata_id_has_dipm(dev->id) && !no_dipm; /* find the first enabled and LPM enabled devices */ if (!link_dev) link_dev = dev; - if (!lpm_dev && (hipm || dipm)) + if (!lpm_dev && + (hipm || (ata_id_has_dipm(dev->id) && !no_dipm))) lpm_dev = dev; hints &= ~ATA_LPM_EMPTY; @@ -3472,7 +3472,8 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, hints &= ~ATA_LPM_HIPM; /* disable DIPM before changing link config */ - if (policy < ATA_LPM_MED_POWER_WITH_DIPM && dipm) { + if (policy < ATA_LPM_MED_POWER_WITH_DIPM && + (ata_id_has_dipm(dev->id) && !no_dipm)) { err_mask = ata_dev_set_feature(dev, SETFEATURES_SATA_DISABLE, SATA_DIPM); if (err_mask && err_mask != AC_ERR_DEV) { -- 2.49.0