Skip to content

Commit 22cfba1

Browse files
floatiousdamien-lemoal
authored andcommitted
ata: libata-eh: Rename hipm and dipm variables
Rename the hipm and dipm variables to have a clearer name. Also fold in the usage of no_dipm, as that is required in order to give the dipm variable a more descriptive name. No functional change. Signed-off-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent 62eef53 commit 22cfba1

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

drivers/ata/libata-eh.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3455,22 +3455,23 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
34553455
* some devices misbehave when the host NACKs transition to SLUMBER.
34563456
*/
34573457
ata_for_each_dev(dev, link, ENABLED) {
3458-
bool hipm = ata_id_has_hipm(dev->id);
3459-
bool dipm = ata_id_has_dipm(dev->id) && !no_dipm;
3458+
bool dev_has_hipm = ata_id_has_hipm(dev->id);
3459+
bool dev_has_dipm = ata_id_has_dipm(dev->id);
34603460

34613461
/* find the first enabled and LPM enabled devices */
34623462
if (!link_dev)
34633463
link_dev = dev;
34643464

3465-
if (!lpm_dev && (hipm || dipm))
3465+
if (!lpm_dev && (dev_has_hipm || (dev_has_dipm && !no_dipm)))
34663466
lpm_dev = dev;
34673467

34683468
hints &= ~ATA_LPM_EMPTY;
3469-
if (!hipm)
3469+
if (!dev_has_hipm)
34703470
hints &= ~ATA_LPM_HIPM;
34713471

34723472
/* disable DIPM before changing link config */
3473-
if (policy < ATA_LPM_MED_POWER_WITH_DIPM && dipm) {
3473+
if (policy < ATA_LPM_MED_POWER_WITH_DIPM &&
3474+
(dev_has_dipm && !no_dipm)) {
34743475
err_mask = ata_dev_set_feature(dev,
34753476
SETFEATURES_SATA_DISABLE, SATA_DIPM);
34763477
if (err_mask && err_mask != AC_ERR_DEV) {
@@ -3517,8 +3518,10 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
35173518
* ATA_LPM_MED_POWER_WITH_DIPM.
35183519
*/
35193520
ata_for_each_dev(dev, link, ENABLED) {
3521+
bool dev_has_dipm = ata_id_has_dipm(dev->id);
3522+
35203523
if (policy >= ATA_LPM_MED_POWER_WITH_DIPM && !no_dipm &&
3521-
ata_id_has_dipm(dev->id)) {
3524+
dev_has_dipm) {
35223525
err_mask = ata_dev_set_feature(dev,
35233526
SETFEATURES_SATA_ENABLE, SATA_DIPM);
35243527
if (err_mask && err_mask != AC_ERR_DEV) {

0 commit comments

Comments
 (0)