All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: alua: Use access state macros
@ 2026-08-04 11:16 John Garry
  2026-08-04 11:30 ` sashiko-bot
  2026-08-04 17:56 ` Bart Van Assche
  0 siblings, 2 replies; 3+ messages in thread
From: John Garry @ 2026-08-04 11:16 UTC (permalink / raw)
  To: James.Bottomley, martin.petersen, hare; +Cc: linux-scsi, John Garry, John Garry

From: John Garry <john.garry@linux.dev>

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

Signed-off-by: John Garry <john.g.garry@oracle.com>

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 80ab0ff921d43..4258c48d93339 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -693,8 +693,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 = desc[0] & SCSI_ACCESS_STATE_MASK;
+					tmp_pg->pref = desc[0] >> __fls(SCSI_ACCESS_STATE_PREFERRED);
 					rcu_read_lock();
 					list_for_each_entry_rcu(h,
 						&tmp_pg->dh_list, node) {
-- 
2.43.7


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-04 17:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04 11:16 [PATCH] scsi: alua: Use access state macros John Garry
2026-08-04 11:30 ` sashiko-bot
2026-08-04 17:56 ` Bart Van Assche

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.