Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp676817rwd; Mon, 12 Jun 2023 21:23:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7sewWGG5Vftkzbv2SOIa2FoZNZDY1spugOHXBp6Y3pGgRYj/jPl2UHlMadSwMl7s/jJMcV X-Received: by 2002:a17:907:9285:b0:96f:678:d2e2 with SMTP id bw5-20020a170907928500b0096f0678d2e2mr10160122ejc.11.1686630189154; Mon, 12 Jun 2023 21:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686630189; cv=none; d=google.com; s=arc-20160816; b=iW9jc6RazFn0SnKb5loYcd4arnD0ZBJB0ZryfGL9iNPUd+nprZpdx3BqgGkPnqEFw2 AADLtaOnwioxkqd7wYA89Gq0pzQXBEzD+42cJfqSO20FktRMK5/NkF9ROqXcFWuYr4PE gEUw+thRTgGffTFQowjkz2Pb4BzPOWPbY+lgkojb6QmprWehLVG+PK/3PDsTTLMDzIWT mEDH2/szVEXggjbbo4fPTCUVZMQoWwlrVJWYuvGxwh2JRDFcxdthInJxCdvYRjrzurBb aNa0o2Ib17lzri8FWV8Ja9AmPJPoNw3jj1LWnYTuvLFEo5y9Oedp7yHAqFqfeVsz73QQ /Zww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature:dkim-filter; bh=hYGehE7r0HhDytRHf6zPyx5C9S2nk+Q2I/xRg8qXwGg=; b=yrZBVOJhSFZdykBUqNTOTvKyyMNDnjsyohT5g7IthWIaElfMnA3BBTGt5Cq2usyDQu gO33DW6hQ821tFcv0QPR7ZQKvHWQq48GMxInxvNsgigU9uCwPlwoBgBt6u+IdmBxXScW bE03CIM4OcoF74hhIbY4EHE89TFGshciCFNQ0qrzANc5p0OW15gWU/lJfRMRNwlsMayi BTBuFtIl0XmgmmkurcvrI7IjQsutLZQyWbJ9VVXwj4ECb1oZAeloqPSh8PchplMajMOz DphA5qkjTIVNoOpNvC19xl8GBsqKuHr155oj4oWKLJceGzaMPi26V1ntyTRwZ/+q4Lby 5Skg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yadro.com header.s=mta-04 header.b=F+nmwkSN; dkim=pass header.i=@yadro.com header.s=mta-03 header.b=FndQIiYX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yadro.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a1709067e0200b0094f712dac55si6018812ejr.734.2023.06.12.21.22.44; Mon, 12 Jun 2023 21:23:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@yadro.com header.s=mta-04 header.b=F+nmwkSN; dkim=pass header.i=@yadro.com header.s=mta-03 header.b=FndQIiYX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yadro.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235728AbjFMERo (ORCPT + 99 others); Tue, 13 Jun 2023 00:17:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjFMERm (ORCPT ); Tue, 13 Jun 2023 00:17:42 -0400 X-Greylist: delayed 601 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 12 Jun 2023 21:17:39 PDT Received: from mta-04.yadro.com (mta-04.yadro.com [89.207.88.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 761F110DA; Mon, 12 Jun 2023 21:17:39 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 mta-04.yadro.com EFD47C002A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yadro.com; s=mta-04; t=1686628876; bh=hYGehE7r0HhDytRHf6zPyx5C9S2nk+Q2I/xRg8qXwGg=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:From; b=F+nmwkSN/kZ4YeuZU3eFJSHQAgtGNz1j0besBJFBBlG6USanrPzbxKpyp7w5Smons aYzlYXcKscesobR0ihSaWUhIoI4n8hVJB2wIKWrBcOrKJ+AHbG8effFlv0BAgNrftE +4sszgfZ7gzaxAaniUHKTcy3sVSA3utYaul2wyGq9PhsleX0Eajldyj9lbsEmv05i/ w/BzwpTp86tHHGWHxsbY0hvD8l80SKwha3Hkp45V5EMBby0v+dNfjTTo56AzLqH6p1 cV+ydvxV1xmY0Bphpy94aEtsaeZ0nEqKkRUfDRN8jJgQpvVm4Qsth1yWbGpriNTpy2 rVwjNZtytciYw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yadro.com; s=mta-03; t=1686628876; bh=hYGehE7r0HhDytRHf6zPyx5C9S2nk+Q2I/xRg8qXwGg=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:From; b=FndQIiYXMryMf/74RQSyKwaYVv0P5ta6504JcMlSABrpteMR9vyqkAvPQlFUA5s0W TXztXK2aYQVeh+9tOjngFezUL+090HLfRxvGJXr1w0hSjAK2YKHk0OuxfcKX1ch7eA cCRZ1GV2orcworpPdHsZ18IiLxutwuNeB0rjy0ssO5lCfupuoWtKt0k//gdBJ8+FZl ouXuha57RQlgxtALFfQo7o0Fbatbo/c6AjU+1fNNOCYtYsRt5oroayjCZMmc726plO m0umgcF6zxhzNJW6l0ZE5k/FAHWyIXhnpeGUZdfbp9JTuJ9Pj8YApCO/zGHogjSIZv Ttdh3mcrGhYGA== Date: Tue, 13 Jun 2023 07:01:15 +0300 From: Konstantin Shelekhin To: Chaitanya Kulkarni CC: Lu Hongfei , "Martin K. Petersen" , "open list:SCSI TARGET SUBSYSTEM" , "open list:SCSI TARGET SUBSYSTEM" , open list , "opensource.kernel@vivo.com" Subject: Re: [PATCH] drivers: target: Fix the conversion to bool in iblock_execute_pr_out Message-ID: References: <20230612081006.40821-1-luhongfei@vivo.com> <53382bf3-69eb-b297-70ea-22571b877a2f@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <53382bf3-69eb-b297-70ea-22571b877a2f@nvidia.com> X-ClientProxiedBy: T-EXCH-09.corp.yadro.com (172.17.11.59) To T-EXCH-09.corp.yadro.com (172.17.11.59) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 12, 2023 at 10:04:28AM +0000, Chaitanya Kulkarni wrote: > On 6/12/23 01:10, Lu Hongfei wrote: > > The return value of the '==' or '!=' operator are bool, so there's > > no need to convert it to bool again in iblock_execute_pr_out. > > > > Signed-off-by: Lu Hongfei > > --- > > 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 254c33c9788e..ea42cb5d06d4 > > --- a/drivers/target/target_core_iblock.c > > +++ b/drivers/target/target_core_iblock.c > > @@ -889,7 +889,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); > > break; > > case PRO_RELEASE: > > if (!ops->pr_clear) { > > this not a fix as current code is not broken .. It looks much better though. And it's easier to understand.