From patchwork Mon May 31 14:53:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 450521 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp899601jao; Mon, 31 May 2021 07:55:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiV7rVDKl94avksVgjJmCr8HcaAz0Ijh9DiZD5sNQhIQZdZXDGlqWMUlXXk/D2O+vK9ckz X-Received: by 2002:a05:6402:645:: with SMTP id u5mr5799681edx.293.1622472941449; Mon, 31 May 2021 07:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622472941; cv=none; d=google.com; s=arc-20160816; b=aqMsfVXAIJtZgeBPVBP/LM+bcYODTAUAW9q2w+g0mzgsg7MvM5MRihLrBE1+AzcdZr hPRTh+rvkOQ7gvFNv3sM3L3cYRt1rMQ61oYjl0NkGbfaC5nX2vuUEWum1Mks6SfIf1vo fnlKPKGdlc9b4wpRK/yvUJa50bzSivkhECjdnVSSwdrpgK1WYlXdAm9+GWWjqD9JVp+6 yq9pDZmpeaAGkZml7xnoK+UkiVYg50hte8sW8RMdphINt4Gorn3F+apGvtfTuvMFFU+Q Z9DIvmsmZXgNmvuALXbigfOu4F+SOzAV3cLItFUyE+pmGRIkAJf8TQN3z2xjfZ5kGgaS kmDQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OSWVFNJCebZT8ZGSmSpUUTuKbt8B79WjD3NgV3mU8Kk=; b=i0H7mzgzue1XMZdTWSjbmS5OTj092764/40jzz76OwZj/dFhs47nh8qvumJkJ40Dn7 jtfVT0xTlIrK28UokONsXVewah6+M6l12Yssk2U93+A7My9LZANBY2kqTP0tF8VXSeFz oziXqrlRx9+21VM9adl1NXKNC7orax68lNRQtM2B9PcoqtgjvdpYNQ4D+DA6zQl+BZgu UUR8HJkoDDW3OlRrqchf/o4+adEg8aAOrtZvpOXZ4QJGFrc1Yg9wlaPOy0gJQoxykTJd RL4kAu5JSU3p5oVcXSQB8suFTxcYUYB1Eo+gkQWX2g0pwgJTS8nUWdNKHdRPokJy3FLo Rq0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s19si12186281edd.347.2021.05.31.07.55.41; Mon, 31 May 2021 07:55:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233734AbhEaO5N (ORCPT + 17 others); Mon, 31 May 2021 10:57:13 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:3356 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234294AbhEaOyy (ORCPT ); Mon, 31 May 2021 10:54:54 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4FtyqX5ffTz66Ql; Mon, 31 May 2021 22:49:28 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 22:53:11 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 22:53:10 +0800 From: Zhen Lei To: Borislav Petkov , Mauro Carvalho Chehab , Tony Luck , James Morse , Robert Richter , Johannes Thumshirn , Ralf Baechle , Dinh Nguyen , Jan Luebbe , Andre Przywara , Channagoud Kadabi , "Venkata Narendra Kumar Gutta" , Andy Gross , Bjorn Andersson , "Khuong Dinh" , York Sun , linux-edac , linux-mips , linux-arm-msm , linux-kernel CC: Zhen Lei Subject: [PATCH v2 1/3] edac: Fix error return code when edac_pci_add_device() fails Date: Mon, 31 May 2021 22:53:00 +0800 Message-ID: <20210531145302.9655-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210531145302.9655-1-thunder.leizhen@huawei.com> References: <20210531145302.9655-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When edac_pci_add_device() fails, fix to return -ENODEV from the error handling case instead of 0. The "goto err" in octeon_pci_probe() is removed to simplify code. Signed-off-by: Zhen Lei --- drivers/edac/amd8111_edac.c | 1 + drivers/edac/mpc85xx_edac.c | 1 + drivers/edac/octeon_edac-pci.c | 9 ++------- 3 files changed, 4 insertions(+), 7 deletions(-) -- 2.26.0.106.g9fadedd diff --git a/drivers/edac/amd8111_edac.c b/drivers/edac/amd8111_edac.c index 7508aa416ddbd7b..16b28da6489177a 100644 --- a/drivers/edac/amd8111_edac.c +++ b/drivers/edac/amd8111_edac.c @@ -480,6 +480,7 @@ static int amd8111_pci_probe(struct pci_dev *dev, if (edac_pci_add_device(pci_info->edac_dev, pci_info->edac_idx) > 0) { printk(KERN_ERR "failed to add edac_pci for %s\n", pci_info->ctl_name); + ret = -ENODEV; goto err_edac_free_ctl; } diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c index 67f7bc3fe5b3b62..312de75e66b851e 100644 --- a/drivers/edac/mpc85xx_edac.c +++ b/drivers/edac/mpc85xx_edac.c @@ -248,6 +248,7 @@ static int mpc85xx_pci_err_probe(struct platform_device *op) if (edac_pci_add_device(pci, pdata->edac_idx) > 0) { edac_dbg(3, "failed edac_pci_add_device()\n"); + res = -ENODEV; goto err; } diff --git a/drivers/edac/octeon_edac-pci.c b/drivers/edac/octeon_edac-pci.c index 28b238eecefcc9d..07995de4ea703ee 100644 --- a/drivers/edac/octeon_edac-pci.c +++ b/drivers/edac/octeon_edac-pci.c @@ -60,7 +60,6 @@ static void octeon_pci_poll(struct edac_pci_ctl_info *pci) static int octeon_pci_probe(struct platform_device *pdev) { struct edac_pci_ctl_info *pci; - int res = 0; pci = edac_pci_alloc_ctl_info(0, "octeon_pci_err"); if (!pci) @@ -76,15 +75,11 @@ static int octeon_pci_probe(struct platform_device *pdev) if (edac_pci_add_device(pci, 0) > 0) { pr_err("%s: edac_pci_add_device() failed\n", __func__); - goto err; + edac_pci_free_ctl_info(pci); + return -ENODEV; } return 0; - -err: - edac_pci_free_ctl_info(pci); - - return res; } static int octeon_pci_remove(struct platform_device *pdev) From patchwork Mon May 31 14:53:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 450520 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp899575jao; Mon, 31 May 2021 07:55:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5eYph+FM5FTD2n3vWZcATntWIFEQKyxYbN7PeF1P2EYejNTc0etpPdEzlKhe4rau8Pewi X-Received: by 2002:aa7:c4d0:: with SMTP id p16mr11134210edr.150.1622472938764; Mon, 31 May 2021 07:55:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622472938; cv=none; d=google.com; s=arc-20160816; b=XJy8islM/WwcBZMPr3rj+usvdcFVRowtB3+WnaznEwnK3EaOo3VjEKtSLAU4aV0lgm GuPa7680v1lxy9/9dQ4hZCsOwFhtefRZ13cX3GEs5VMcV7UzKsDHDHs/L2IcKBwoHNos 2VuqPxq9v1CCFzgeIn4lnKLfph63C6ckP/G77MRVEhqAuOw6cjuJZyVVQ2n4Gn27Xluy qEqMHw3E64wlR01JKAZZlPjlzDMiUmKh0KzpavHNLPUpV3Zb/FV4jo0Ai+ay3XL1zJJB 1wF3DydCmlaj0kZotvv/4iFxKSJY15s0LsA1x+MbV5fuvUcgJ2wUymR8lUJzkpgGrsTx jKqA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=D6iS+0e27Vk7Bg+KQ7mFMxMpx54+fFMg8jUj3Rh3z/8=; b=x3L/Fd0vYwndFq+LCUxMob3TI+HNUr4YSmd31s5nZUaBkQJ5M8jXUqk0BkEJn0Bhf3 oUfYcqMt6rj+fb0yGU9BMBE6akLNMfckvYgcKFfm+nDB599MOFDjx/Qg8vy21/QMWtAM urHNPW77p/gp+Zm3zV43rnm1V+u76Y8YO6maL7aR6Ei4i50PwTtw/mTR/aOi74ezO9U5 Jp6NDO3cohGxGFpTyOXAt/iTdXky620+6nzc4/rsnKQuzYke3Lp/TLzTFzmK90kylWUI KJscKEMRX2pmt4zBcm2BlS90xV1y06ClHXKE2O9zCF5bwq0MseInpniLt+LYYvJ4KtWr dl6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s19si12186281edd.347.2021.05.31.07.55.38; Mon, 31 May 2021 07:55:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232412AbhEaO5I (ORCPT + 17 others); Mon, 31 May 2021 10:57:08 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:2804 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234295AbhEaOyy (ORCPT ); Mon, 31 May 2021 10:54:54 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4FtypR4MMxzWpMh; Mon, 31 May 2021 22:48:31 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 22:53:12 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 22:53:11 +0800 From: Zhen Lei To: Borislav Petkov , Mauro Carvalho Chehab , Tony Luck , James Morse , Robert Richter , Johannes Thumshirn , Ralf Baechle , Dinh Nguyen , Jan Luebbe , Andre Przywara , Channagoud Kadabi , "Venkata Narendra Kumar Gutta" , Andy Gross , Bjorn Andersson , "Khuong Dinh" , York Sun , linux-edac , linux-mips , linux-arm-msm , linux-kernel CC: Zhen Lei Subject: [PATCH v2 2/3] edac: Fix error return code when edac_device_add_device() fails Date: Mon, 31 May 2021 22:53:01 +0800 Message-ID: <20210531145302.9655-3-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210531145302.9655-1-thunder.leizhen@huawei.com> References: <20210531145302.9655-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When edac_device_add_device() fails, fix to return -ENXIO from the error handling case instead of 0, -ENOMEM or -EINVAL. Signed-off-by: Zhen Lei --- drivers/edac/altera_edac.c | 8 +++++--- drivers/edac/amd8111_edac.c | 1 + drivers/edac/armada_xp_edac.c | 2 +- drivers/edac/highbank_l2_edac.c | 4 +++- drivers/edac/mpc85xx_edac.c | 1 + drivers/edac/qcom_edac.c | 4 +++- drivers/edac/thunderx_edac.c | 2 ++ drivers/edac/xgene_edac.c | 6 +++--- 8 files changed, 19 insertions(+), 9 deletions(-) -- 2.26.0.106.g9fadedd diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index 5f7fd79ec82fc98..50eef016a4b5a27 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -784,8 +784,10 @@ static int altr_edac_device_probe(struct platform_device *pdev) dci->dev_name = drvdata->edac_dev_name; res = edac_device_add_device(dci); - if (res) + if (res) { + res = -ENXIO; goto fail1; + } altr_create_edacdev_dbgfs(dci, drvdata->data); @@ -1555,7 +1557,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device) if (rc) { edac_printk(KERN_ERR, EDAC_DEVICE, "edac_device_add_device portB failed\n"); - rc = -ENOMEM; + rc = -ENXIO; goto err_release_group_1; } altr_create_edacdev_dbgfs(dci, prv); @@ -1963,7 +1965,7 @@ static int altr_edac_a10_device_add(struct altr_arria10_edac *edac, rc = edac_device_add_device(dci); if (rc) { dev_err(edac->dev, "edac_device_add_device failed\n"); - rc = -ENOMEM; + rc = -ENXIO; goto err_release_group1; } diff --git a/drivers/edac/amd8111_edac.c b/drivers/edac/amd8111_edac.c index 16b28da6489177a..216ef32172bc58c 100644 --- a/drivers/edac/amd8111_edac.c +++ b/drivers/edac/amd8111_edac.c @@ -388,6 +388,7 @@ static int amd8111_dev_probe(struct pci_dev *dev, if (edac_device_add_device(dev_info->edac_dev) > 0) { printk(KERN_ERR "failed to add edac_dev for %s\n", dev_info->ctl_name); + ret = -ENXIO; goto err_edac_free_ctl; } diff --git a/drivers/edac/armada_xp_edac.c b/drivers/edac/armada_xp_edac.c index e3e757513d1bc38..23b9a469f100183 100644 --- a/drivers/edac/armada_xp_edac.c +++ b/drivers/edac/armada_xp_edac.c @@ -558,7 +558,7 @@ static int aurora_l2_probe(struct platform_device *pdev) if (edac_device_add_device(dci)) { edac_device_free_ctl_info(dci); - return -EINVAL; + return -ENXIO; } #ifdef CONFIG_EDAC_DEBUG diff --git a/drivers/edac/highbank_l2_edac.c b/drivers/edac/highbank_l2_edac.c index c4549cec788b098..45dbe19c2577426 100644 --- a/drivers/edac/highbank_l2_edac.c +++ b/drivers/edac/highbank_l2_edac.c @@ -90,8 +90,10 @@ static int highbank_l2_err_probe(struct platform_device *pdev) dci->ctl_name = id ? id->compatible : "unknown"; dci->dev_name = dev_name(&pdev->dev); - if (edac_device_add_device(dci)) + if (edac_device_add_device(dci)) { + res = -ENXIO; goto err; + } drvdata->db_irq = platform_get_irq(pdev, 0); res = devm_request_irq(&pdev->dev, drvdata->db_irq, diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c index 312de75e66b851e..6f0c95b83b076e0 100644 --- a/drivers/edac/mpc85xx_edac.c +++ b/drivers/edac/mpc85xx_edac.c @@ -553,6 +553,7 @@ static int mpc85xx_l2_err_probe(struct platform_device *op) if (edac_device_add_device(edac_dev) > 0) { edac_dbg(3, "failed edac_device_add_device()\n"); + res = -ENXIO; goto err; } diff --git a/drivers/edac/qcom_edac.c b/drivers/edac/qcom_edac.c index 97a27e42dd610db..b06e0746ff28423 100644 --- a/drivers/edac/qcom_edac.c +++ b/drivers/edac/qcom_edac.c @@ -361,8 +361,10 @@ static int qcom_llcc_edac_probe(struct platform_device *pdev) edev_ctl->pvt_info = llcc_driv_data; rc = edac_device_add_device(edev_ctl); - if (rc) + if (rc) { + rc = -ENXIO; goto out_mem; + } platform_set_drvdata(pdev, edev_ctl); diff --git a/drivers/edac/thunderx_edac.c b/drivers/edac/thunderx_edac.c index 0eb5eb97fd74279..3a19560232c11ec 100644 --- a/drivers/edac/thunderx_edac.c +++ b/drivers/edac/thunderx_edac.c @@ -1421,6 +1421,7 @@ static int thunderx_ocx_probe(struct pci_dev *pdev, ret = edac_device_add_device(edac_dev); if (ret) { dev_err(&pdev->dev, "Cannot add EDAC device: %d\n", ret); + ret = -ENXIO; goto err_free; } @@ -2051,6 +2052,7 @@ static int thunderx_l2c_probe(struct pci_dev *pdev, ret = edac_device_add_device(edac_dev); if (ret) { dev_err(&pdev->dev, "Cannot add EDAC device: %d\n", ret); + ret = -ENXIO; goto err_free; } diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c index 2ccd1db5e98ff0b..1263434c155ea86 100644 --- a/drivers/edac/xgene_edac.c +++ b/drivers/edac/xgene_edac.c @@ -953,7 +953,7 @@ static int xgene_edac_pmd_add(struct xgene_edac *edac, struct device_node *np, rc = edac_device_add_device(edac_dev); if (rc > 0) { dev_err(edac->dev, "edac_device_add_device failed\n"); - rc = -ENOMEM; + rc = -ENXIO; goto err_free; } @@ -1236,7 +1236,7 @@ static int xgene_edac_l3_add(struct xgene_edac *edac, struct device_node *np, rc = edac_device_add_device(edac_dev); if (rc > 0) { dev_err(edac->dev, "failed edac_device_add_device()\n"); - rc = -ENOMEM; + rc = -ENXIO; goto err_ctl_free; } @@ -1774,7 +1774,7 @@ static int xgene_edac_soc_add(struct xgene_edac *edac, struct device_node *np, rc = edac_device_add_device(edac_dev); if (rc > 0) { dev_err(edac->dev, "failed edac_device_add_device()\n"); - rc = -ENOMEM; + rc = -ENXIO; goto err_ctl_free; } From patchwork Mon May 31 14:53:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 450519 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp899535jao; Mon, 31 May 2021 07:55:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeZFgB6myEpEYBG/4d8hFupFIuD/6birUOWoOJI4NEigjHXeY2w3ZT0F8YAuFwVI9+BNJe X-Received: by 2002:a17:906:26ce:: with SMTP id u14mr22966852ejc.187.1622472935625; Mon, 31 May 2021 07:55:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622472935; cv=none; d=google.com; s=arc-20160816; b=yesEy28xps7v0C1lNMD/mssJ/5vEmleF0w17qKcA8M/HrZQix1fDEyxQQVl05wRJsc 3peVru4C1PNEt5+292eoEjXmZGc2tqpel8AR//lQQYlBw11L+JAHy28i9P946711gb02 ksrnqlzbYFY1aXYyF0Hde+/f9RsoQN/yeQUIYf0iEP5UcvaUa3gmnI7J9mSlJ/OlcNSP blXtSCA8aN/bhgPaQif+5aOoiEDiojQ73YTPRlAxsuOD4/GWpNaq8c6sWoM+ofsEceQx L1xt4gyKOs0zNA/15hlfMiYJcWpY/pmhKg/xsGjvuIjMPEQCAijyok/PFKmPTNbsboz7 cwOQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ISAjQ5cQl4xACZM1pIeq9goMJ/ge4OCv25PhKZXks/k=; b=x2VzQV42ubTUx5oHcE9Alzp11VwpFIg73p18Dio8ZPjBndooS/fP534+R23kSRrmJ1 Dxwzdr+m0j2tn8Yn0NAMU9BoVkifKl0YQmQAcURy1wVhYMidVjWXTdLf1nvt/XYm3gzk Z3BsmDKOkKxWKjWaybMeH0ILY+yV4WN5RDdbDZaxZtdOo0o3p0sr0oZtnFQ8RUuokODa yHbTgju/J50LqRidV2FSyXcPJm3E/jyOBlPD/pOS9e2ctBJlXiNJ6kgDCNJMoBrrttOD 1U7bv2fjIM0kKtQ7c73GyDYAu0Nlm47nY6CMsNHTf7ejlGthZ002fLmLSZzspo+H01Ly z+EA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s19si12186281edd.347.2021.05.31.07.55.35; Mon, 31 May 2021 07:55:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230282AbhEaO5D (ORCPT + 17 others); Mon, 31 May 2021 10:57:03 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3482 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234310AbhEaOy4 (ORCPT ); Mon, 31 May 2021 10:54:56 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Ftyrk0D9fzYq72; Mon, 31 May 2021 22:50:30 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 22:53:13 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 22:53:12 +0800 From: Zhen Lei To: Borislav Petkov , Mauro Carvalho Chehab , Tony Luck , James Morse , Robert Richter , Johannes Thumshirn , Ralf Baechle , Dinh Nguyen , Jan Luebbe , Andre Przywara , Channagoud Kadabi , "Venkata Narendra Kumar Gutta" , Andy Gross , Bjorn Andersson , "Khuong Dinh" , York Sun , linux-edac , linux-mips , linux-arm-msm , linux-kernel CC: Zhen Lei Subject: [PATCH v2 3/3] edac: Use 'ret' instead of 'res' to store the return value Date: Mon, 31 May 2021 22:53:02 +0800 Message-ID: <20210531145302.9655-4-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210531145302.9655-1-thunder.leizhen@huawei.com> References: <20210531145302.9655-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Usually 'ret' or 'rc' is used as the abbreviation for 'return code', and 'res' is used as the abbreviation for 'resource'. Signed-off-by: Zhen Lei --- drivers/edac/altera_edac.c | 66 ++++++++++++++++----------------- drivers/edac/armada_xp_edac.c | 6 +-- drivers/edac/cpc925_edac.c | 16 ++++---- drivers/edac/fsl_ddr_edac.c | 24 ++++++------ drivers/edac/highbank_l2_edac.c | 20 +++++----- drivers/edac/highbank_mc_edac.c | 20 +++++----- drivers/edac/layerscape_edac.c | 8 ++-- drivers/edac/mpc85xx_edac.c | 48 ++++++++++++------------ drivers/edac/skx_base.c | 6 +-- drivers/edac/thunderx_edac.c | 26 ++++++------- 10 files changed, 120 insertions(+), 120 deletions(-) -- 2.26.0.106.g9fadedd diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index 50eef016a4b5a27..9e97396821f749d 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -286,7 +286,7 @@ static int altr_sdram_probe(struct platform_device *pdev) struct regmap *mc_vbase; struct dimm_info *dimm; u32 read_reg; - int irq, irq2, res = 0; + int irq, irq2, ret = 0; unsigned long mem_size, irqflags = 0; id = of_match_device(altr_sdram_ctrl_of_match, &pdev->dev); @@ -375,7 +375,7 @@ static int altr_sdram_probe(struct platform_device *pdev) if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL)) { edac_printk(KERN_ERR, EDAC_MC, "Unable to get managed device resource\n"); - res = -ENOMEM; + ret = -ENOMEM; goto free; } @@ -394,40 +394,40 @@ static int altr_sdram_probe(struct platform_device *pdev) dimm->mtype = MEM_DDR3; dimm->edac_mode = EDAC_SECDED; - res = edac_mc_add_mc(mci); - if (res < 0) + ret = edac_mc_add_mc(mci); + if (ret < 0) goto err; /* Only the Arria10 has separate IRQs */ if (of_machine_is_compatible("altr,socfpga-arria10")) { /* Arria10 specific initialization */ - res = a10_init(mc_vbase); - if (res < 0) + ret = a10_init(mc_vbase); + if (ret < 0) goto err2; - res = devm_request_irq(&pdev->dev, irq2, + ret = devm_request_irq(&pdev->dev, irq2, altr_sdram_mc_err_handler, IRQF_SHARED, dev_name(&pdev->dev), mci); - if (res < 0) { + if (ret < 0) { edac_mc_printk(mci, KERN_ERR, "Unable to request irq %d\n", irq2); - res = -ENODEV; + ret = -ENODEV; goto err2; } - res = a10_unmask_irq(pdev, A10_DDR0_IRQ_MASK); - if (res < 0) + ret = a10_unmask_irq(pdev, A10_DDR0_IRQ_MASK); + if (ret < 0) goto err2; irqflags = IRQF_SHARED; } - res = devm_request_irq(&pdev->dev, irq, altr_sdram_mc_err_handler, + ret = devm_request_irq(&pdev->dev, irq, altr_sdram_mc_err_handler, irqflags, dev_name(&pdev->dev), mci); - if (res < 0) { + if (ret < 0) { edac_mc_printk(mci, KERN_ERR, "Unable to request irq %d\n", irq); - res = -ENODEV; + ret = -ENODEV; goto err2; } @@ -436,7 +436,7 @@ static int altr_sdram_probe(struct platform_device *pdev) priv->ecc_irq_en_mask, priv->ecc_irq_en_mask)) { edac_mc_printk(mci, KERN_ERR, "Error enabling SDRAM ECC IRQ\n"); - res = -ENODEV; + ret = -ENODEV; goto err2; } @@ -453,9 +453,9 @@ static int altr_sdram_probe(struct platform_device *pdev) free: edac_mc_free(mci); edac_printk(KERN_ERR, EDAC_MC, - "EDAC Probe Failed; Error %d\n", res); + "EDAC Probe Failed; Error %d\n", ret); - return res; + return ret; } static int altr_sdram_remove(struct platform_device *pdev) @@ -707,7 +707,7 @@ static int altr_edac_device_probe(struct platform_device *pdev) struct edac_device_ctl_info *dci; struct altr_edac_device_dev *drvdata; struct resource *r; - int res = 0; + int ret = 0; struct device_node *np = pdev->dev.of_node; char *ecc_name = (char *)np->name; static int dev_instance; @@ -722,7 +722,7 @@ static int altr_edac_device_probe(struct platform_device *pdev) if (!r) { edac_printk(KERN_ERR, EDAC_DEVICE, "Unable to get mem resource\n"); - res = -ENODEV; + ret = -ENODEV; goto fail; } @@ -730,7 +730,7 @@ static int altr_edac_device_probe(struct platform_device *pdev) dev_name(&pdev->dev))) { edac_printk(KERN_ERR, EDAC_DEVICE, "%s:Error requesting mem region\n", ecc_name); - res = -EBUSY; + ret = -EBUSY; goto fail; } @@ -741,7 +741,7 @@ static int altr_edac_device_probe(struct platform_device *pdev) if (!dci) { edac_printk(KERN_ERR, EDAC_DEVICE, "%s: Unable to allocate EDAC device\n", ecc_name); - res = -ENOMEM; + ret = -ENOMEM; goto fail; } @@ -752,7 +752,7 @@ static int altr_edac_device_probe(struct platform_device *pdev) drvdata->base = devm_ioremap(&pdev->dev, r->start, resource_size(r)); if (!drvdata->base) { - res = -ENOMEM; + ret = -ENOMEM; goto fail1; } @@ -761,31 +761,31 @@ static int altr_edac_device_probe(struct platform_device *pdev) /* Check specific dependencies for the module */ if (drvdata->data->setup) { - res = drvdata->data->setup(drvdata); - if (res) + ret = drvdata->data->setup(drvdata); + if (ret) goto fail1; } drvdata->sb_irq = platform_get_irq(pdev, 0); - res = devm_request_irq(&pdev->dev, drvdata->sb_irq, + ret = devm_request_irq(&pdev->dev, drvdata->sb_irq, altr_edac_device_handler, 0, dev_name(&pdev->dev), dci); - if (res) + if (ret) goto fail1; drvdata->db_irq = platform_get_irq(pdev, 1); - res = devm_request_irq(&pdev->dev, drvdata->db_irq, + ret = devm_request_irq(&pdev->dev, drvdata->db_irq, altr_edac_device_handler, 0, dev_name(&pdev->dev), dci); - if (res) + if (ret) goto fail1; dci->mod_name = "Altera ECC Manager"; dci->dev_name = drvdata->edac_dev_name; - res = edac_device_add_device(dci); - if (res) { - res = -ENXIO; + ret = edac_device_add_device(dci); + if (ret) { + ret = -ENXIO; goto fail1; } @@ -800,9 +800,9 @@ static int altr_edac_device_probe(struct platform_device *pdev) fail: devres_release_group(&pdev->dev, NULL); edac_printk(KERN_ERR, EDAC_DEVICE, - "%s:Error setting up EDAC device: %d\n", ecc_name, res); + "%s:Error setting up EDAC device: %d\n", ecc_name, ret); - return res; + return ret; } static int altr_edac_device_remove(struct platform_device *pdev) diff --git a/drivers/edac/armada_xp_edac.c b/drivers/edac/armada_xp_edac.c index 23b9a469f100183..73d0410fe731e69 100644 --- a/drivers/edac/armada_xp_edac.c +++ b/drivers/edac/armada_xp_edac.c @@ -611,13 +611,13 @@ static struct platform_driver * const drivers[] = { static int __init armada_xp_edac_init(void) { - int res; + int ret; /* only polling is supported */ edac_op_state = EDAC_OPSTATE_POLL; - res = platform_register_drivers(drivers, ARRAY_SIZE(drivers)); - if (res) + ret = platform_register_drivers(drivers, ARRAY_SIZE(drivers)); + if (ret) pr_warn("Armada XP EDAC drivers fail to register\n"); return 0; diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c index 9797e6d60dde4d1..2d8a42341eafc8b 100644 --- a/drivers/edac/cpc925_edac.c +++ b/drivers/edac/cpc925_edac.c @@ -911,19 +911,19 @@ static int cpc925_probe(struct platform_device *pdev) void __iomem *vbase; struct cpc925_mc_pdata *pdata; struct resource *r; - int res = 0, nr_channels; + int ret = 0, nr_channels; edac_dbg(0, "%s platform device found!\n", pdev->name); if (!devres_open_group(&pdev->dev, cpc925_probe, GFP_KERNEL)) { - res = -ENOMEM; + ret = -ENOMEM; goto out; } r = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!r) { cpc925_printk(KERN_ERR, "Unable to get resource\n"); - res = -ENOENT; + ret = -ENOENT; goto err1; } @@ -932,14 +932,14 @@ static int cpc925_probe(struct platform_device *pdev) resource_size(r), pdev->name)) { cpc925_printk(KERN_ERR, "Unable to request mem region\n"); - res = -EBUSY; + ret = -EBUSY; goto err1; } vbase = devm_ioremap(&pdev->dev, r->start, resource_size(r)); if (!vbase) { cpc925_printk(KERN_ERR, "Unable to ioremap device\n"); - res = -ENOMEM; + ret = -ENOMEM; goto err2; } @@ -955,7 +955,7 @@ static int cpc925_probe(struct platform_device *pdev) sizeof(struct cpc925_mc_pdata)); if (!mci) { cpc925_printk(KERN_ERR, "No memory for mem_ctl_info\n"); - res = -ENOMEM; + ret = -ENOMEM; goto err2; } @@ -996,7 +996,7 @@ static int cpc925_probe(struct platform_device *pdev) /* get this far and it's successful */ edac_dbg(0, "success\n"); - res = 0; + ret = 0; goto out; err3: @@ -1007,7 +1007,7 @@ static int cpc925_probe(struct platform_device *pdev) err1: devres_release_group(&pdev->dev, cpc925_probe); out: - return res; + return ret; } static int cpc925_remove(struct platform_device *pdev) diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c index 6d8ea226010d2d7..1d526c5aaaeeae1 100644 --- a/drivers/edac/fsl_ddr_edac.c +++ b/drivers/edac/fsl_ddr_edac.c @@ -480,7 +480,7 @@ int fsl_mc_err_probe(struct platform_device *op) struct fsl_mc_pdata *pdata; struct resource r; u32 sdram_ctl; - int res; + int ret; if (!devres_open_group(&op->dev, fsl_mc_err_probe, GFP_KERNEL)) return -ENOMEM; @@ -512,8 +512,8 @@ int fsl_mc_err_probe(struct platform_device *op) */ little_endian = of_property_read_bool(op->dev.of_node, "little-endian"); - res = of_address_to_resource(op->dev.of_node, 0, &r); - if (res) { + ret = of_address_to_resource(op->dev.of_node, 0, &r); + if (ret) { pr_err("%s: Unable to get resource for MC err regs\n", __func__); goto err; @@ -523,14 +523,14 @@ int fsl_mc_err_probe(struct platform_device *op) pdata->name)) { pr_err("%s: Error while requesting mem region\n", __func__); - res = -EBUSY; + ret = -EBUSY; goto err; } pdata->mc_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r)); if (!pdata->mc_vbase) { pr_err("%s: Unable to setup MC err regs\n", __func__); - res = -ENOMEM; + ret = -ENOMEM; goto err; } @@ -538,7 +538,7 @@ int fsl_mc_err_probe(struct platform_device *op) if (!(sdram_ctl & DSC_ECC_EN)) { /* no ECC */ pr_warn("%s: No ECC DIMMs discovered\n", __func__); - res = -ENODEV; + ret = -ENODEV; goto err; } @@ -567,8 +567,8 @@ int fsl_mc_err_probe(struct platform_device *op) /* clear all error bits */ ddr_out32(pdata->mc_vbase + FSL_MC_ERR_DETECT, ~0); - res = edac_mc_add_mc_with_groups(mci, fsl_ddr_dev_groups); - if (res) { + ret = edac_mc_add_mc_with_groups(mci, fsl_ddr_dev_groups); + if (ret) { edac_dbg(3, "failed edac_mc_add_mc()\n"); goto err; } @@ -586,14 +586,14 @@ int fsl_mc_err_probe(struct platform_device *op) /* register interrupts */ pdata->irq = platform_get_irq(op, 0); - res = devm_request_irq(&op->dev, pdata->irq, + ret = devm_request_irq(&op->dev, pdata->irq, fsl_mc_isr, IRQF_SHARED, "[EDAC] MC err", mci); - if (res < 0) { + if (ret < 0) { pr_err("%s: Unable to request irq %d for FSL DDR DRAM ERR\n", __func__, pdata->irq); - res = -ENODEV; + ret = -ENODEV; goto err2; } @@ -612,7 +612,7 @@ int fsl_mc_err_probe(struct platform_device *op) err: devres_release_group(&op->dev, fsl_mc_err_probe); edac_mc_free(mci); - return res; + return ret; } int fsl_mc_err_remove(struct platform_device *op) diff --git a/drivers/edac/highbank_l2_edac.c b/drivers/edac/highbank_l2_edac.c index 45dbe19c2577426..5d037ebff233cfe 100644 --- a/drivers/edac/highbank_l2_edac.c +++ b/drivers/edac/highbank_l2_edac.c @@ -50,7 +50,7 @@ static int highbank_l2_err_probe(struct platform_device *pdev) struct edac_device_ctl_info *dci; struct hb_l2_drvdata *drvdata; struct resource *r; - int res = 0; + int ret = 0; dci = edac_device_alloc_ctl_info(sizeof(*drvdata), "cpu", 1, "L", 1, 2, NULL, 0, 0); @@ -67,21 +67,21 @@ static int highbank_l2_err_probe(struct platform_device *pdev) r = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!r) { dev_err(&pdev->dev, "Unable to get mem resource\n"); - res = -ENODEV; + ret = -ENODEV; goto err; } if (!devm_request_mem_region(&pdev->dev, r->start, resource_size(r), dev_name(&pdev->dev))) { dev_err(&pdev->dev, "Error while requesting mem region\n"); - res = -EBUSY; + ret = -EBUSY; goto err; } drvdata->base = devm_ioremap(&pdev->dev, r->start, resource_size(r)); if (!drvdata->base) { dev_err(&pdev->dev, "Unable to map regs\n"); - res = -ENOMEM; + ret = -ENOMEM; goto err; } @@ -91,22 +91,22 @@ static int highbank_l2_err_probe(struct platform_device *pdev) dci->dev_name = dev_name(&pdev->dev); if (edac_device_add_device(dci)) { - res = -ENXIO; + ret = -ENXIO; goto err; } drvdata->db_irq = platform_get_irq(pdev, 0); - res = devm_request_irq(&pdev->dev, drvdata->db_irq, + ret = devm_request_irq(&pdev->dev, drvdata->db_irq, highbank_l2_err_handler, 0, dev_name(&pdev->dev), dci); - if (res < 0) + if (ret < 0) goto err2; drvdata->sb_irq = platform_get_irq(pdev, 1); - res = devm_request_irq(&pdev->dev, drvdata->sb_irq, + ret = devm_request_irq(&pdev->dev, drvdata->sb_irq, highbank_l2_err_handler, 0, dev_name(&pdev->dev), dci); - if (res < 0) + if (ret < 0) goto err2; devres_close_group(&pdev->dev, NULL); @@ -116,7 +116,7 @@ static int highbank_l2_err_probe(struct platform_device *pdev) err: devres_release_group(&pdev->dev, NULL); edac_device_free_ctl_info(dci); - return res; + return ret; } static int highbank_l2_err_remove(struct platform_device *pdev) diff --git a/drivers/edac/highbank_mc_edac.c b/drivers/edac/highbank_mc_edac.c index 61b76ec226af11d..4de2e06fd8c3254 100644 --- a/drivers/edac/highbank_mc_edac.c +++ b/drivers/edac/highbank_mc_edac.c @@ -153,7 +153,7 @@ static int highbank_mc_probe(struct platform_device *pdev) void __iomem *base; u32 control; int irq; - int res = 0; + int ret = 0; id = of_match_device(hb_ddr_ctrl_of_match, &pdev->dev); if (!id) @@ -180,21 +180,21 @@ static int highbank_mc_probe(struct platform_device *pdev) r = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!r) { dev_err(&pdev->dev, "Unable to get mem resource\n"); - res = -ENODEV; + ret = -ENODEV; goto err; } if (!devm_request_mem_region(&pdev->dev, r->start, resource_size(r), dev_name(&pdev->dev))) { dev_err(&pdev->dev, "Error while requesting mem region\n"); - res = -EBUSY; + ret = -EBUSY; goto err; } base = devm_ioremap(&pdev->dev, r->start, resource_size(r)); if (!base) { dev_err(&pdev->dev, "Unable to map regs\n"); - res = -ENOMEM; + ret = -ENOMEM; goto err; } @@ -205,7 +205,7 @@ static int highbank_mc_probe(struct platform_device *pdev) control = readl(drvdata->mc_err_base + HB_DDR_ECC_OPT) & 0x3; if (!control || (control == 0x2)) { dev_err(&pdev->dev, "No ECC present, or ECC disabled\n"); - res = -ENODEV; + ret = -ENODEV; goto err; } @@ -225,14 +225,14 @@ static int highbank_mc_probe(struct platform_device *pdev) dimm->mtype = MEM_DDR3; dimm->edac_mode = EDAC_SECDED; - res = edac_mc_add_mc_with_groups(mci, highbank_dev_groups); - if (res < 0) + ret = edac_mc_add_mc_with_groups(mci, highbank_dev_groups); + if (ret < 0) goto err; irq = platform_get_irq(pdev, 0); - res = devm_request_irq(&pdev->dev, irq, highbank_mc_err_handler, + ret = devm_request_irq(&pdev->dev, irq, highbank_mc_err_handler, 0, dev_name(&pdev->dev), mci); - if (res < 0) { + if (ret < 0) { dev_err(&pdev->dev, "Unable to request irq %d\n", irq); goto err2; } @@ -244,7 +244,7 @@ static int highbank_mc_probe(struct platform_device *pdev) err: devres_release_group(&pdev->dev, NULL); edac_mc_free(mci); - return res; + return ret; } static int highbank_mc_remove(struct platform_device *pdev) diff --git a/drivers/edac/layerscape_edac.c b/drivers/edac/layerscape_edac.c index 94cac7686a56d46..959ffd072bfb3cb 100644 --- a/drivers/edac/layerscape_edac.c +++ b/drivers/edac/layerscape_edac.c @@ -36,7 +36,7 @@ static struct platform_driver fsl_ddr_mc_err_driver = { static int __init fsl_ddr_mc_init(void) { - int res; + int ret; /* make sure error reporting method is sane */ switch (edac_op_state) { @@ -48,10 +48,10 @@ static int __init fsl_ddr_mc_init(void) break; } - res = platform_driver_register(&fsl_ddr_mc_err_driver); - if (res) { + ret = platform_driver_register(&fsl_ddr_mc_err_driver); + if (ret) { pr_err("MC fails to register\n"); - return res; + return ret; } return 0; diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c index 6f0c95b83b076e0..fbd3d79f99d14d4 100644 --- a/drivers/edac/mpc85xx_edac.c +++ b/drivers/edac/mpc85xx_edac.c @@ -148,7 +148,7 @@ static int mpc85xx_pci_err_probe(struct platform_device *op) struct mpc85xx_edac_pci_plat_data *plat_data; struct device_node *of_node; struct resource r; - int res = 0; + int ret = 0; if (!devres_open_group(&op->dev, mpc85xx_pci_err_probe, GFP_KERNEL)) return -ENOMEM; @@ -173,7 +173,7 @@ static int mpc85xx_pci_err_probe(struct platform_device *op) plat_data = op->dev.platform_data; if (!plat_data) { dev_err(&op->dev, "no platform data"); - res = -ENXIO; + ret = -ENXIO; goto err; } of_node = plat_data->of_node; @@ -196,8 +196,8 @@ static int mpc85xx_pci_err_probe(struct platform_device *op) pdata->edac_idx = edac_pci_idx++; - res = of_address_to_resource(of_node, 0, &r); - if (res) { + ret = of_address_to_resource(of_node, 0, &r); + if (ret) { pr_err("%s: Unable to get resource for PCI err regs\n", __func__); goto err; } @@ -208,14 +208,14 @@ static int mpc85xx_pci_err_probe(struct platform_device *op) if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r), pdata->name)) { pr_err("%s: Error while requesting mem region\n", __func__); - res = -EBUSY; + ret = -EBUSY; goto err; } pdata->pci_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r)); if (!pdata->pci_vbase) { pr_err("%s: Unable to setup PCI err regs\n", __func__); - res = -ENOMEM; + ret = -ENOMEM; goto err; } @@ -248,21 +248,21 @@ static int mpc85xx_pci_err_probe(struct platform_device *op) if (edac_pci_add_device(pci, pdata->edac_idx) > 0) { edac_dbg(3, "failed edac_pci_add_device()\n"); - res = -ENODEV; + ret = -ENODEV; goto err; } if (edac_op_state == EDAC_OPSTATE_INT) { pdata->irq = irq_of_parse_and_map(of_node, 0); - res = devm_request_irq(&op->dev, pdata->irq, + ret = devm_request_irq(&op->dev, pdata->irq, mpc85xx_pci_isr, IRQF_SHARED, "[EDAC] PCI err", pci); - if (res < 0) { + if (ret < 0) { pr_err("%s: Unable to request irq %d for MPC85xx PCI err\n", __func__, pdata->irq); irq_dispose_mapping(pdata->irq); - res = -ENODEV; + ret = -ENODEV; goto err2; } @@ -297,7 +297,7 @@ static int mpc85xx_pci_err_probe(struct platform_device *op) err: edac_pci_free_ctl_info(pci); devres_release_group(&op->dev, mpc85xx_pci_err_probe); - return res; + return ret; } static int mpc85xx_pci_err_remove(struct platform_device *op) @@ -492,7 +492,7 @@ static int mpc85xx_l2_err_probe(struct platform_device *op) struct edac_device_ctl_info *edac_dev; struct mpc85xx_l2_pdata *pdata; struct resource r; - int res; + int ret; if (!devres_open_group(&op->dev, mpc85xx_l2_err_probe, GFP_KERNEL)) return -ENOMEM; @@ -512,8 +512,8 @@ static int mpc85xx_l2_err_probe(struct platform_device *op) edac_dev->ctl_name = pdata->name; edac_dev->dev_name = pdata->name; - res = of_address_to_resource(op->dev.of_node, 0, &r); - if (res) { + ret = of_address_to_resource(op->dev.of_node, 0, &r); + if (ret) { pr_err("%s: Unable to get resource for L2 err regs\n", __func__); goto err; } @@ -524,14 +524,14 @@ static int mpc85xx_l2_err_probe(struct platform_device *op) if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r), pdata->name)) { pr_err("%s: Error while requesting mem region\n", __func__); - res = -EBUSY; + ret = -EBUSY; goto err; } pdata->l2_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r)); if (!pdata->l2_vbase) { pr_err("%s: Unable to setup L2 err regs\n", __func__); - res = -ENOMEM; + ret = -ENOMEM; goto err; } @@ -553,20 +553,20 @@ static int mpc85xx_l2_err_probe(struct platform_device *op) if (edac_device_add_device(edac_dev) > 0) { edac_dbg(3, "failed edac_device_add_device()\n"); - res = -ENXIO; + ret = -ENXIO; goto err; } if (edac_op_state == EDAC_OPSTATE_INT) { pdata->irq = irq_of_parse_and_map(op->dev.of_node, 0); - res = devm_request_irq(&op->dev, pdata->irq, + ret = devm_request_irq(&op->dev, pdata->irq, mpc85xx_l2_isr, IRQF_SHARED, "[EDAC] L2 err", edac_dev); - if (res < 0) { + if (ret < 0) { pr_err("%s: Unable to request irq %d for MPC85xx L2 err\n", __func__, pdata->irq); irq_dispose_mapping(pdata->irq); - res = -ENODEV; + ret = -ENODEV; goto err2; } @@ -589,7 +589,7 @@ static int mpc85xx_l2_err_probe(struct platform_device *op) err: devres_release_group(&op->dev, mpc85xx_l2_err_probe); edac_device_free_ctl_info(edac_dev); - return res; + return ret; } static int mpc85xx_l2_err_remove(struct platform_device *op) @@ -691,7 +691,7 @@ static struct platform_driver * const drivers[] = { static int __init mpc85xx_mc_init(void) { - int res = 0; + int ret; u32 __maybe_unused pvr = 0; pr_info("Freescale(R) MPC85xx EDAC driver, (C) 2006 Montavista Software\n"); @@ -706,8 +706,8 @@ static int __init mpc85xx_mc_init(void) break; } - res = platform_register_drivers(drivers, ARRAY_SIZE(drivers)); - if (res) + ret = platform_register_drivers(drivers, ARRAY_SIZE(drivers)); + if (ret) pr_warn(EDAC_MOD_STR "drivers fail to register\n"); return 0; diff --git a/drivers/edac/skx_base.c b/drivers/edac/skx_base.c index 6a4f0b27c654572..7ad52659ab1e15c 100644 --- a/drivers/edac/skx_base.c +++ b/drivers/edac/skx_base.c @@ -530,11 +530,11 @@ static u8 skx_open_fine_column[] = { static int skx_bits(u64 addr, int nbits, u8 *bits) { - int i, res = 0; + int i, ret = 0; for (i = 0; i < nbits; i++) - res |= ((addr >> bits[i]) & 1) << i; - return res; + ret |= ((addr >> bits[i]) & 1) << i; + return ret; } static int skx_bank_bits(u64 addr, int b0, int b1, int do_xor, int x0, int x1) diff --git a/drivers/edac/thunderx_edac.c b/drivers/edac/thunderx_edac.c index 3a19560232c11ec..96711e70fad49f3 100644 --- a/drivers/edac/thunderx_edac.c +++ b/drivers/edac/thunderx_edac.c @@ -243,11 +243,11 @@ static ssize_t thunderx_##_type##_##_field##_write(struct file *file, \ size_t count, loff_t *ppos) \ { \ struct thunderx_##_type *pdata = file->private_data; \ - int res; \ + int ret; \ \ - res = kstrtoull_from_user(data, count, 0, &pdata->_field); \ + ret = kstrtoull_from_user(data, count, 0, &pdata->_field); \ \ - return res ? res : count; \ + return ret ? ret : count; \ } \ \ DEBUGFS_STRUCT(_field, 0600, \ @@ -273,16 +273,16 @@ static ssize_t thunderx_##_type##_##_name##_write(struct file *file, \ { \ struct thunderx_##_type *pdata = file->private_data; \ u64 val; \ - int res; \ + int ret; \ \ - res = kstrtoull_from_user(data, count, 0, &val); \ + ret = kstrtoull_from_user(data, count, 0, &val); \ \ - if (!res) { \ + if (!ret) { \ writeq(val, pdata->regs + _reg); \ - res = count; \ + ret = count; \ } \ \ - return res; \ + return ret; \ } \ \ DEBUGFS_STRUCT(_name, 0600, \ @@ -306,17 +306,17 @@ static ssize_t thunderx_lmc_inject_int_write(struct file *file, { struct thunderx_lmc *lmc = file->private_data; u64 val; - int res; + int ret; - res = kstrtoull_from_user(data, count, 0, &val); + ret = kstrtoull_from_user(data, count, 0, &val); - if (!res) { + if (!ret) { /* Trigger the interrupt */ writeq(val, lmc->regs + LMC_INT_W1S); - res = count; + ret = count; } - return res; + return ret; } static ssize_t thunderx_lmc_int_read(struct file *file,