Skip to content

Commit 6d915e2

Browse files
floatiousdamien-lemoal
authored andcommitted
ata: libata-eh: Rename no_dipm variable to be more clear
Rename the no_dipm variable to host_has_dipm, by inverting the expression, and and also having a clearer name. No functional change. Signed-off-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent 22cfba1 commit 6d915e2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/ata/libata-eh.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3432,7 +3432,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
34323432
struct ata_eh_context *ehc = &link->eh_context;
34333433
struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL;
34343434
enum ata_lpm_policy old_policy = link->lpm_policy;
3435-
bool no_dipm = link->ap->flags & ATA_FLAG_NO_DIPM;
3435+
bool host_has_dipm = !(link->ap->flags & ATA_FLAG_NO_DIPM);
34363436
unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM;
34373437
unsigned int err_mask;
34383438
int rc;
@@ -3462,7 +3462,8 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
34623462
if (!link_dev)
34633463
link_dev = dev;
34643464

3465-
if (!lpm_dev && (dev_has_hipm || (dev_has_dipm && !no_dipm)))
3465+
if (!lpm_dev &&
3466+
(dev_has_hipm || (dev_has_dipm && host_has_dipm)))
34663467
lpm_dev = dev;
34673468

34683469
hints &= ~ATA_LPM_EMPTY;
@@ -3471,7 +3472,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
34713472

34723473
/* disable DIPM before changing link config */
34733474
if (policy < ATA_LPM_MED_POWER_WITH_DIPM &&
3474-
(dev_has_dipm && !no_dipm)) {
3475+
(dev_has_dipm && host_has_dipm)) {
34753476
err_mask = ata_dev_set_feature(dev,
34763477
SETFEATURES_SATA_DISABLE, SATA_DIPM);
34773478
if (err_mask && err_mask != AC_ERR_DEV) {
@@ -3520,7 +3521,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
35203521
ata_for_each_dev(dev, link, ENABLED) {
35213522
bool dev_has_dipm = ata_id_has_dipm(dev->id);
35223523

3523-
if (policy >= ATA_LPM_MED_POWER_WITH_DIPM && !no_dipm &&
3524+
if (policy >= ATA_LPM_MED_POWER_WITH_DIPM && host_has_dipm &&
35243525
dev_has_dipm) {
35253526
err_mask = ata_dev_set_feature(dev,
35263527
SETFEATURES_SATA_ENABLE, SATA_DIPM);

0 commit comments

Comments
 (0)