From patchwork Sun Jan 8 15:18:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 40517 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1745360wrt; Sun, 8 Jan 2023 07:21:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXtJVVwV5QpY+duxPt431ZaXAdysA+HvKSmokAJOZyaXIWFaAaf+S8ZJfckr5VJaFkZ+1gMH X-Received: by 2002:a05:6402:150b:b0:493:a6eb:874f with SMTP id f11-20020a056402150b00b00493a6eb874fmr11038527edw.7.1673191261439; Sun, 08 Jan 2023 07:21:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673191261; cv=none; d=google.com; s=arc-20160816; b=slMtvQw4cG+Byi9vK/guFybnEjo2fSUVnH4iIKV9Bp9NcW2XHNsfW7UHXlKoIkAF3Z PZdH5sHfUO8z6lUQrQiwn3jGRuLgINbIRPgMcVaXELqt1bobtdLl12SO+Lhmj/YObhoy uUQG6EL++o2ESJmIIwAMMSyv5PdEYKVjvqjsUkFdrHiJQafkD3mu3BdeADLzYFQLADLe 4ikO2s0hden3h3mLMQdsu4OC+0xO17KfU7B00gD7yhhWxkWuqcvZxY4yfyQRnH4i9CPD epQC4ABFDuLsn5uboZ8TkfxwXwnlmbnUPC7jku+kUjS9zg67euhQPXbOY2q1aLmtIq/O WxMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=vtyUtLgaycUUo9j9rYx2ycWRtUoH+lJFj0NSUH4i1BM=; b=TvS8zY/RttMshPG4NFfsUFKcWblNyMrfwCGYt4OaxgVETarnJMsGQhXmjhYA9yhE22 ehbPaFYyN/nrSbyML3FeTmamexm2lbW1snuHOFYmBBOKx82O+V0Mkvj7cA7EnrsVYRJm lrcU9It89xPo2QsrQmqGObG3OeQHQzTtOEsq23HpPO6k95Dscbfy5SKdRxf79xPRr+pj VkYNzXki/xxiLwhYGNHaDu4S4hXywYdwRDj8Oh/H8kkU+AAdGj7qUj7EpO/DBqPkpe+z x9oDJyI8LvicTtOxrW4sBNMQQMzNwbHkaEgVUASdiMIlinImLjF+sE1/2VuB9Mz5R6k3 g7pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=osnVmplm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cq6-20020a056402220600b004520b01a355si6008386edb.52.2023.01.08.07.20.38; Sun, 08 Jan 2023 07:21:01 -0800 (PST) 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=fail header.i=@mailo.com header.s=mailo header.b=osnVmplm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234231AbjAHPTX (ORCPT + 99 others); Sun, 8 Jan 2023 10:19:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233807AbjAHPTL (ORCPT ); Sun, 8 Jan 2023 10:19:11 -0500 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82547DF32; Sun, 8 Jan 2023 07:19:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1673191141; bh=A/eTZH7R8HYi3G8I9qn02EbBgc4fZ4a7jDAb8QMp5Ys=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=osnVmplmhvSBBoGzBLw94CL+qOdSJTKctykFzv6GB1khlj1gNR42T6cuXJ5wCiWRk D43WD9rTDMX4po3OPLawBkHpncJDRiqamwm1u29RAfaCGq0BGITF4hXvp0wBJWZNQZ AvXdJdESSornM0VrIbiTZcP3rn2wXtoCrG1WR04I= Received: by b-6.in.mailobj.net [192.168.90.16] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sun, 8 Jan 2023 16:19:01 +0100 (CET) X-EA-Auth: +LxKYHCdtFrREOXbK0ZeZCL9zE7QZ+NmrD0pJzlqCIVZmuEPfq60W4RWKXNWI4IyuKpPOJwbR5xYtnq3/cO2C8Tkc9zImSv6 Date: Sun, 8 Jan 2023 20:48:56 +0530 From: Deepak R Varma To: Brian King , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar , Praveen Kumar Subject: [PATCH] scsi: ipr: Convert ipr_probe_ioa_part2 as void Message-ID: MIME-Version: 1.0 Content-Disposition: inline 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754468200405080517?= X-GMAIL-MSGID: =?utf-8?q?1754468200405080517?= Convert function ipr_probe_ioa_part2() to return void instead of int since the current implementation always returns 0 to the caller. The transformation also eliminates the dead code when calling ipr_probe_ioa_part2() function. Issue identified using returnvar Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- drivers/scsi/ipr.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) -- 2.34.1 diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 2022ffb45041..2e3e12c83277 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -9504,12 +9504,9 @@ static pci_ers_result_t ipr_pci_error_detected(struct pci_dev *pdev, * Description: This is the second phase of adapter initialization * This function takes care of initilizing the adapter to the point * where it can accept new commands. - * Return value: - * 0 on success / -EIO on failure **/ -static int ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg) +static void ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg) { - int rc = 0; unsigned long host_lock_flags = 0; ENTER; @@ -9525,7 +9522,6 @@ static int ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg) spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags); LEAVE; - return rc; } /** @@ -10568,12 +10564,7 @@ static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) return rc; ioa_cfg = pci_get_drvdata(pdev); - rc = ipr_probe_ioa_part2(ioa_cfg); - - if (rc) { - __ipr_remove(pdev); - return rc; - } + ipr_probe_ioa_part2(ioa_cfg); rc = scsi_add_host(ioa_cfg->host, &pdev->dev);