diff mbox series

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

Message ID 20230623161136.6270-1-michael.christie@oracle.com (mailing list archive)
State Accepted
Commit 40863cb945c93a55aeaf8a2fd2bef1c7507ee8f2
Headers show
Series [1/1] scsi: target: Quiet bool conversion warning with pr_preempt use | expand

Commit Message

Mike Christie June 23, 2023, 4:11 p.m. UTC
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.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202306221655.Kwtqi1gI-lkp@intel.com/
Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 drivers/target/target_core_iblock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maurizio Lombardi June 27, 2023, 8:18 a.m. UTC | #1
pá 23. 6. 2023 v 18:13 odesílatel Mike Christie
<michael.christie@oracle.com> napsal:
>
> 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.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202306221655.Kwtqi1gI-lkp@intel.com/
> Signed-off-by: Mike Christie <michael.christie@oracle.com>
> ---
>  drivers/target/target_core_iblock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
> index a3c5f3558a33..3d1b511ea284 100644
> --- a/drivers/target/target_core_iblock.c
> +++ b/drivers/target/target_core_iblock.c
> @@ -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) {
> --
> 2.25.1
>

Reviewed-by: Maurizio Lombardi <mlombard@redhat.com>
Martin K. Petersen June 29, 2023, 1:58 a.m. UTC | #2
Mike,

> 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!
diff mbox series

Patch

diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index a3c5f3558a33..3d1b511ea284 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -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) {