From patchwork Mon Mar 13 10:52:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 9620459 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5920360244 for ; Mon, 13 Mar 2017 10:53:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49F2B2843F for ; Mon, 13 Mar 2017 10:53:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BE8328459; Mon, 13 Mar 2017 10:53:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD71A2843F for ; Mon, 13 Mar 2017 10:53:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751763AbdCMKxX (ORCPT ); Mon, 13 Mar 2017 06:53:23 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:45787 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbdCMKxT (ORCPT ); Mon, 13 Mar 2017 06:53:19 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v2DAr2nn000355 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2017 10:53:03 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v2DAr1Qm030014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2017 10:53:02 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v2DAr1d8024818; Mon, 13 Mar 2017 10:53:01 GMT Received: from mwanda (/154.0.138.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 Mar 2017 03:53:01 -0700 Date: Mon, 13 Mar 2017 13:52:53 +0300 From: Dan Carpenter To: Kurt Schwemmer , Logan Gunthorpe Cc: Stephen Bates , Bjorn Helgaas , linux-pci@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 2/2] switchtec: fix some error codes Message-ID: <20170313105253.GB24989@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We shouldn't be changing these negative error codes to positive. Fixes: dbdb73b1e2c0 ("MicroSemi Switchtec management interface driver") Signed-off-by: Dan Carpenter diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index 82ae08956457..fcde98161d9a 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -656,7 +656,7 @@ static ssize_t switchtec_dev_write(struct file *filp, const char __user *data, rc = lock_mutex_and_test_alive(stdev); if (rc) - return -rc; + return rc; if (stuser->state != MRPC_IDLE) { rc = -EBADE; @@ -700,7 +700,7 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data, rc = lock_mutex_and_test_alive(stdev); if (rc) - return -rc; + return rc; if (stuser->state == MRPC_IDLE) { mutex_unlock(&stdev->mrpc_mutex); @@ -722,7 +722,7 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data, rc = lock_mutex_and_test_alive(stdev); if (rc) - return -rc; + return rc; if (stuser->state != MRPC_DONE) { mutex_unlock(&stdev->mrpc_mutex);