scsi: alua: Use access state macros

Use the SCSI access state macros in alua_rtpg(), which is better than
hardcoding.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260805145906.2825553-1-john.g.garry@oracle.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
This commit is contained in:
John Garry
2026-08-05 14:59:06 +00:00
committed by Martin K. Petersen (Oracle)
parent b854c2e6b9
commit 610bece660

View File

@@ -5,6 +5,7 @@
* Copyright (C) 2007-2010 Hannes Reinecke, SUSE Linux Products GmbH.
* All rights reserved.
*/
#include <linux/bitfield.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/module.h>
@@ -693,8 +694,8 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
!(tmp_pg->flags & ALUA_PG_RUNNING)) {
struct alua_dh_data *h;
tmp_pg->state = desc[0] & 0x0f;
tmp_pg->pref = desc[0] >> 7;
tmp_pg->state = FIELD_GET(SCSI_ACCESS_STATE_MASK, desc[0]);
tmp_pg->pref = FIELD_GET(SCSI_ACCESS_STATE_PREFERRED, desc[0]);
rcu_read_lock();
list_for_each_entry_rcu(h,
&tmp_pg->dh_list, node) {