From patchwork Thu Dec 15 18:21:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13074440 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34014C25B04 for ; Thu, 15 Dec 2022 18:21:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229730AbiLOSVz (ORCPT ); Thu, 15 Dec 2022 13:21:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiLOSVv (ORCPT ); Thu, 15 Dec 2022 13:21:51 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E27A2A9; Thu, 15 Dec 2022 10:21:49 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 20C62B81C1F; Thu, 15 Dec 2022 18:21:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97AAAC433F1; Thu, 15 Dec 2022 18:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671128506; bh=s+PVv6GIZ4aMLHqPk5y9kyCwBokOLW/kvHRGZkXn+N4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=thYmC6RTtVWWWosTGR+CYcZL1sp3vzrIxUmm+2zmGdtSVL67EXEmGnMm6M5No+rJW FHtZx/2LNKXjNTDevEYpqnQFa/QjyJM0MapWsuKpR3OezXJ1KRcHB5fmCa821o1PIr zBsrc3stQPLfe78/HRYj3Z2RQ4iJjieLX+eXK6j2akwDXiX7fxShIjM9NpotF1IlOx /9DCsU2YPc89aQA5Hspyn7UijXp8gmuykvzuzB8dMLcBocFeWOs8XPTJdUxmFq2dHE nZmHEAW45Ju0SaHc97v5hW2Ihm4GRiGPhf5lhEuUUk0E1slqGfQKutJ7q/E/P6JVZg fSuTxO2CwVlWQ== From: Bjorn Helgaas To: Kurt Schwemmer , Logan Gunthorpe Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 1/2] PCI: switchtec: Simplify switchtec_dma_mrpc_isr() Date: Thu, 15 Dec 2022 12:21:39 -0600 Message-Id: <20221215182140.129559-2-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221215182140.129559-1-helgaas@kernel.org> References: <20221215182140.129559-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Bjorn Helgaas The "ret" variable in switchtec_dma_mrpc_isr() is superfluous. Remove it and just return the value. No functional change intended. Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe --- drivers/pci/switch/switchtec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index 75be4fe22509..d7ae84070e29 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -1480,15 +1480,13 @@ static irqreturn_t switchtec_event_isr(int irq, void *dev) static irqreturn_t switchtec_dma_mrpc_isr(int irq, void *dev) { struct switchtec_dev *stdev = dev; - irqreturn_t ret = IRQ_NONE; iowrite32(SWITCHTEC_EVENT_CLEAR | SWITCHTEC_EVENT_EN_IRQ, &stdev->mmio_part_cfg->mrpc_comp_hdr); schedule_work(&stdev->mrpc_work); - ret = IRQ_HANDLED; - return ret; + return IRQ_HANDLED; } static int switchtec_init_isr(struct switchtec_dev *stdev) From patchwork Thu Dec 15 18:21:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13074441 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0A1EC4332F for ; Thu, 15 Dec 2022 18:21:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229846AbiLOSV4 (ORCPT ); Thu, 15 Dec 2022 13:21:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbiLOSVv (ORCPT ); Thu, 15 Dec 2022 13:21:51 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C90046660; Thu, 15 Dec 2022 10:21:51 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 096D0B81C34; Thu, 15 Dec 2022 18:21:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F59FC433D2; Thu, 15 Dec 2022 18:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671128508; bh=1f7os4xVJq22jqG8ELql3guTBTtv0Z9Z/m2XWhn4W8o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LdfqgnlKJyMcTPNdQoZ6UxUpZ4Iv+vdbt7Ewp9advVoG0C3pF5kFCHFg21m1z4CE4 KqHjIEbjHcWwcRLq4v9acL2ly6sHJVxTtJlB5xYbvNKtF8Snv+9Ion9HA5Ed4NUZXx 51Tq37zfUAuxiNsRK4iGTfEYzhqQWWwNi9/nE3/49MxDjhCJbpXI+1roK+4waHgE2k LcUwaBzMPL7rLqLR1UWigY0n7kBbcRtsdrERkDE7ZY17BC1J8v9oiT4TF4qFY77Xtq y/+tdBidN75WgEyi1LMcZkHFwpatj16egwCjFlEMi4I/9Tz17wAMnqKwdIJsbF0Lth +E6CVMERgHMoA== From: Bjorn Helgaas To: Kurt Schwemmer , Logan Gunthorpe Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 2/2] PCI: switchtec: Remove useless assignments in switchtec_dev_read() Date: Thu, 15 Dec 2022 12:21:40 -0600 Message-Id: <20221215182140.129559-3-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221215182140.129559-1-helgaas@kernel.org> References: <20221215182140.129559-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Bjorn Helgaas Some switchtec_dev_read() error cases assign to "rc", then branch to "out". But the code at "out" never uses "rc". Drop the useless assignments. No functional change intended. Signed-off-by: Bjorn Helgaas --- drivers/pci/switch/switchtec.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index d7ae84070e29..c04c7ee35184 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -605,18 +605,14 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data, rc = copy_to_user(data, &stuser->return_code, sizeof(stuser->return_code)); - if (rc) { - rc = -EFAULT; + if (rc) goto out; - } data += sizeof(stuser->return_code); rc = copy_to_user(data, &stuser->data, size - sizeof(stuser->return_code)); - if (rc) { - rc = -EFAULT; + if (rc) goto out; - } stuser_set_state(stuser, MRPC_IDLE);