Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3792585rdh; Tue, 28 Nov 2023 04:12:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOpkk4jJMzJVJmvXjqtvj/EZanCHgmEgs3FIeikxI0GCbGOsfqElBTd9TNojhTs/RnUNoG X-Received: by 2002:a17:90b:1001:b0:285:6f1a:4a71 with SMTP id gm1-20020a17090b100100b002856f1a4a71mr15914717pjb.32.1701173547807; Tue, 28 Nov 2023 04:12:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701173547; cv=none; d=google.com; s=arc-20160816; b=Q12tfClMYJn2QJmjVTGClg34k0xyJTL8lA9VobDSSvcTUAEopWBX+LZxcLTJzMbk+z 7+DuYLFKvc9hvuOiEakQbnyJ63RRIc08mdzVHiq/oZ2SsG/ZnLIdd7x4W9A0HPx5A6Ps sQyVd0B/5ptsuP3F2onnLgwUDbpaoeT94nnJZ95u3fTxE6qDUu1UoOQKoSH6Y+xhbqzf Kf36Fa88VLjy0HdI6URGs78B4ffs7BvyOL0Snt/oGd7qALcO2kweQy7bsKZv2q/QA9XM YlBHQ4Xza9rUDgxDmxUjNt6RjLPCtcpjWbS7RabJzGhpvDmMJPU6z4yt57F7BiOXmWbX i67w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=rKus6/tmWy03hL2eVSDHylD4Qx2+g8ihVacUxs2Oe8k=; fh=if4JcMPyfvTMQYA/DyxKwvLINLXQZQAhui1G86D/ofM=; b=vU+fxM/xTgtnw98K+UImrmxKPbiYllhRn57a/iqJKHFHsSPXwbsWy4g3urTb6mQbaO 7ON5tfzRr6wI9Ii0Y/OQQI6q6TP6zBMe8FmwtLfXuELiVA2EBOhIn2jI1OZYdBX3K1vO m1TSTIgnD8hmkwCFfTPD9mzvM/3YgtjzWe8J4aLuwJX8YnvdTTGaHWTq2hDkotomI5FX Z7sORGAdM2hWhvefSbU3ar0EivxSk1vVlATmTXgvULVCXQ2yodmiibbqZRov+eYVUfjs I7Zz9XznggCwtOFARzHjeII6AuWbo8/yasgPlKHeboh4xubrOq3/yojN9C0gLiUOkOz0 Hv3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=red-soft.ru Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id u16-20020a170902e81000b001cf7ce5e6e0si12339981plg.330.2023.11.28.04.12.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 04:12:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=red-soft.ru Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 07058804B026; Tue, 28 Nov 2023 04:12:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344623AbjK1MMB (ORCPT + 99 others); Tue, 28 Nov 2023 07:12:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344302AbjK1MMB (ORCPT ); Tue, 28 Nov 2023 07:12:01 -0500 Received: from gw.red-soft.ru (red-soft.ru [188.246.186.2]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9B09E182; Tue, 28 Nov 2023 04:12:06 -0800 (PST) Received: from localhost.biz (unknown [10.81.81.211]) by gw.red-soft.ru (Postfix) with ESMTPA id 66B1E3E1AF3; Tue, 28 Nov 2023 15:12:04 +0300 (MSK) From: Artem Chernyshev To: Artur Paszkiewicz Cc: Artem Chernyshev , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] scsi: isci: Remove redundant check in isci_task_request_build() Date: Tue, 28 Nov 2023 15:11:59 +0300 Message-Id: <20231128121159.2373975-1-artem.chernyshev@red-soft.ru> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 181653 [Nov 28 2023] X-KLMS-AntiSpam-Version: 6.0.0.2 X-KLMS-AntiSpam-Envelope-From: artem.chernyshev@red-soft.ru X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Auth: dkim=none X-KLMS-AntiSpam-Info: LuaCore: 5 0.3.5 98d108ddd984cca1d7e65e595eac546a62b0144b, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;localhost.biz:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;red-soft.ru:7.1.1, FromAlignment: s X-MS-Exchange-Organization-SCL: -1 X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, bases: 2023/11/28 09:02:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2023/11/28 07:11:00 #22560184 X-KLMS-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 28 Nov 2023 04:12:25 -0800 (PST) sci_task_request_construct_ssp() have invariant return. Change this function to void and get rid of unnecessary checks. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Artem Chernyshev --- drivers/scsi/isci/request.c | 5 +---- drivers/scsi/isci/request.h | 2 +- drivers/scsi/isci/task.c | 4 +--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c index a7b3243b471d..71f711cb0628 100644 --- a/drivers/scsi/isci/request.c +++ b/drivers/scsi/isci/request.c @@ -738,8 +738,7 @@ static enum sci_status sci_io_request_construct_basic_ssp(struct isci_request *i return SCI_SUCCESS; } -enum sci_status sci_task_request_construct_ssp( - struct isci_request *ireq) +void sci_task_request_construct_ssp(struct isci_request *ireq) { /* Construct the SSP Task SCU Task Context */ scu_ssp_task_request_construct_task_context(ireq); @@ -748,8 +747,6 @@ enum sci_status sci_task_request_construct_ssp( sci_task_request_build_ssp_task_iu(ireq); sci_change_state(&ireq->sm, SCI_REQ_CONSTRUCTED); - - return SCI_SUCCESS; } static enum sci_status sci_io_request_construct_basic_sata(struct isci_request *ireq) diff --git a/drivers/scsi/isci/request.h b/drivers/scsi/isci/request.h index 20b141739e4d..79ddfffbf73c 100644 --- a/drivers/scsi/isci/request.h +++ b/drivers/scsi/isci/request.h @@ -300,7 +300,7 @@ sci_task_request_construct(struct isci_host *ihost, struct isci_remote_device *idev, u16 io_tag, struct isci_request *ireq); -enum sci_status sci_task_request_construct_ssp(struct isci_request *ireq); +void sci_task_request_construct_ssp(struct isci_request *ireq); void sci_smp_request_copy_response(struct isci_request *ireq); static inline int isci_task_is_ncq_recovery(struct sas_task *task) diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c index c514b20293b2..3a25b1a2c52d 100644 --- a/drivers/scsi/isci/task.c +++ b/drivers/scsi/isci/task.c @@ -243,9 +243,7 @@ static struct isci_request *isci_task_request_build(struct isci_host *ihost, /* XXX convert to get this from task->tproto like other drivers */ if (dev->dev_type == SAS_END_DEVICE) { isci_tmf->proto = SAS_PROTOCOL_SSP; - status = sci_task_request_construct_ssp(ireq); - if (status != SCI_SUCCESS) - return NULL; + sci_task_request_construct_ssp(ireq); } return ireq; -- 2.37.3