linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>
Subject: Re: [linux-next:master 211/11867] drivers/target/target_core_iblock.c:892:30-35: WARNING: conversion to bool not needed here
Date: Thu, 22 Jun 2023 10:34:13 -0500	[thread overview]
Message-ID: <5faa5807-ec8f-fd8b-6a86-95cea3728ac8@oracle.com> (raw)
In-Reply-To: <202306221655.Kwtqi1gI-lkp@intel.com>

On 6/22/23 3:48 AM, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   15e71592dbae49a674429c618a10401d7f992ac3
> commit: 394f811848827ad23d2b43e94e5d72a24cfbc39f [211/11867] scsi: target: Add block PR support to iblock
> config: sparc-randconfig-c003-20230620 (https://download.01.org/0day-ci/archive/20230622/202306221655.Kwtqi1gI-lkp@intel.com/config)
> compiler: sparc-linux-gcc (GCC) 12.3.0
> reproduce: (https://download.01.org/0day-ci/archive/20230622/202306221655.Kwtqi1gI-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202306221655.Kwtqi1gI-lkp@intel.com/
> 
> cocci warnings: (new ones prefixed by >>)
>>> drivers/target/target_core_iblock.c:892:30-35: WARNING: conversion to bool not needed here
> 


>    883		case PRO_PREEMPT:
>    884		case PRO_PREEMPT_AND_ABORT:
>    885			if (!ops->pr_clear) {
>    886				pr_err("block_device does not support pr_preempt.\n");
>    887				return TCM_UNSUPPORTED_SCSI_OPCODE;
>    888			}
>    889	
>    890			ret = ops->pr_preempt(bdev, key, sa_key,
>    891					      scsi_pr_type_to_block(type),
>  > 892					      sa == PRO_PREEMPT ? false : true);


The kernel test robot is correct. I can do the patch below.

Martin, do you want me to just submit the patch below to linux-scsi or
fold it into:

commit 394f811848827ad23d2b43e94e5d72a24cfbc39f
Author: Mike Christie <michael.christie@oracle.com>
Date:   Fri Apr 7 15:05:51 2023 -0500

    scsi: target: Add block PR support to iblock

and re-submit that whole patch?


From 96f7e2fa06cd39f2e661530ae14160286f189fbb Mon Sep 17 00:00:00 2001
From: Mike Christie <michael.christie@oracle.com>
Date: Thu, 22 Jun 2023 10:30:12 -0500
Subject: [PATCH] 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 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




  reply	other threads:[~2023-06-22 15:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22  8:48 kernel test robot
2023-06-22 15:34 ` Mike Christie [this message]
2023-06-23  1:08   ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5faa5807-ec8f-fd8b-6a86-95cea3728ac8@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=martin.petersen@oracle.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox