Skip to contentSkip to conversation

scsi: target: Quiet bool conversion warning with pr_preempt use

PATCH Applied Mike Christie 3 participants 3 messages Jun 23, 2023 – Jun 29, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: target: Quiet bool conversion warning with pr_preempt use

We want to pass in true for pr_preempt's argument if we are doing a PRO_PREEMPT_AND_ABORT, so just test sa against PRO_PREEMPT_AND_ABORT, and pass the result directly to pr_preempt.

---
 drivers/target/target_core_iblock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/target/target_core_iblock.c +1 -1
index a3c5f3558a33..3d1b511ea284 100644
@@ -888,7 +888,7 @@ static sense_reason_t iblock_execute_pr_out(struct se_cmd *cmd, u8 sa, u64 key,
 
 		ret = ops->pr_preempt(bdev, key, sa_key,
 				      scsi_pr_type_to_block(type),
-				      sa == PRO_PREEMPT ? false : true);
+				      sa == PRO_PREEMPT_AND_ABORT);
 		break;
 	case PRO_RELEASE:
 		if (!ops->pr_clear) {
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

pá 23. 6. 2023 v 18:13 odesílatel Mike Christie
<[email protected]> napsal:

Quoted 26 lines

We want to pass in true for pr_preempt's argument if we are doing a PRO_PREEMPT_AND_ABORT, so just test sa against PRO_PREEMPT_AND_ABORT, and pass the result directly to pr_preempt.

---
 drivers/target/target_core_iblock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/target/target_core_iblock.c +1 -2
index a3c5f3558a33..3d1b511ea284 100644
@@ -888,7 +888,7 @@ static sense_reason_t iblock_execute_pr_out(struct se_cmd *cmd, u8 sa, u64 key,
 
                ret = ops->pr_preempt(bdev, key, sa_key,
                                      scsi_pr_type_to_block(type),
-                                     sa == PRO_PREEMPT ? false : true);
+                                     sa == PRO_PREEMPT_AND_ABORT);
                break;
        case PRO_RELEASE:
                if (!ops->pr_clear) {
--
Quoted 2 lines

2.25.1

#2 lore raw
In reply to Mike Christie

Mike,

Quoted 3 lines

We want to pass in true for pr_preempt's argument if we are doing a PRO_PREEMPT_AND_ABORT, so just test sa against PRO_PREEMPT_AND_ABORT, and pass the result directly to pr_preempt.

Applied to 6.5/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering