From patchwork Mon Sep 2 12:33:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 172744 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp4273652ily; Mon, 2 Sep 2019 05:34:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyRL5G64h6bASjuDZuygpPfyE+HGAHoXXmJFhgPYgsoZiFZHnUTf/WyU4ceMpoKvZXS45q X-Received: by 2002:aa7:9303:: with SMTP id 3mr13851321pfj.29.1567427653515; Mon, 02 Sep 2019 05:34:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1567427653; cv=pass; d=google.com; s=arc-20160816; b=MsF9IRiSwra0005tp+Dkr3foOdTdhO0/LMVgjJLVzoAwYNLQeH2xz/MD3VtaeQaChl ODjB2sv9XESoVOQKILX9dRGpoKLWDa3Ehk5go2KP35gS7MflghL9LenSwWkyKVf1srNX d9jPbtNx6D/PFTFHBYEALkLDeNhs4Zo/mgfW+5zauTApuXRh9BLvcxh61Fw5FoNC6hfS DFUksGU6DBywHDecBEKgPKpNbow68tdKlQEjbKmG23l9LyzuuLTOFqztLv9mnFKtpPZr 4NiAP7hTgl28+ttKHU1ut+Z1i0gGmmaJLUpvdw6JKF/GC7W/2F3iinFXRg3AzLKMmVad p6fw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :dkim-signature; bh=q+UcsD8AVJ2yD4QdTpH5jA/xu0OUWHpb/y8uAIk8s68=; b=sHAh1BCE7n1HEJTl/8iDoWDPnbvtM5wTEtNXBBS/GDuwIxr7e6G+Cyy9XkbeshvrhD Gr9Mc8wLvmw5/4SWZTqMuG76NyIyWFQZcwzw4rR8fQan7KGpsDNBj9kj7vQPHfysziI1 GOVMO8ToP8/8EmNwuBz/gdJSvfk8XPiLFe2XZgESoJ2RUwKLRVShfhOURuVahHGDNRhX Re8pfmY0Y73ylIvECbalxTAHvXQrrZpyNdnNtl20CsQCoANiAFVzFk8z6JQZtpom5kFP GwpeNqh7W8+3m0Yh6V2L/HXGSj5kawgBPgxrsDfasGYdkQ2LbFGye6h1M86nXANKioV/ 078g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0818 header.b=uH7TfZw9; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=KD6arz5p; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=marvell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w14si5930822plq.38.2019.09.02.05.34.13; Mon, 02 Sep 2019 05:34:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0818 header.b=uH7TfZw9; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=KD6arz5p; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731660AbfIBMd6 (ORCPT + 28 others); Mon, 2 Sep 2019 08:33:58 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:4330 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730628AbfIBMd5 (ORCPT ); Mon, 2 Sep 2019 08:33:57 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x82CUiGp029652; Mon, 2 Sep 2019 05:33:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=q+UcsD8AVJ2yD4QdTpH5jA/xu0OUWHpb/y8uAIk8s68=; b=uH7TfZw9MChh4IMaSpbFwDUsQ6Pfj4/W87Yws3/du9h4oXPl48Dd/mSckexyi9curGGe z0gbHQ9tXSzrL8UHXW33uEwy2fxK+lL0Th2jVTMkACxox5G3cdH058t6UvDAP2SdkQ2f m+WxD2d8V7MRv/8WvZux6HQRuJXsjxBJPELo6yzAVZ8057VBIKIsXZoNT2a3du1TheE8 L+z9LSRfR19dK0FAVjlva2KJYnhjiiXFCLVCYbdaD1c+tTxknRqN5Yysy3YTARerRhdM u2gdkuWhVoUdhV1YHufUYuKIdgQp9KI1kuOJqnjO4RmSnpYjNImXRkDUz+tlQW6mt1Zl GA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2uqrdm603b-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 02 Sep 2019 05:33:49 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 2 Sep 2019 05:33:46 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.51) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 2 Sep 2019 05:33:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fh4Bxq5c2UexNaPKIZCCyFLH7Y1aifXekWglF0cOOCVdDZ3zf5l5+14zvzXSCtvBMLDzSf28+yFYezN+evc9nXYH78btJ1QD1TqdI3Ox2MpnCl+Ycgrzm7sEobgoW1pLiXPdBFSKvlxSv3zXNjahGfm79G0mR+Oq8EaV2caL9TXwETd/JXjW85xt3gtSuK+WRJVCN+3XcxCUtp/ede+r37jO4G7MeTvGxC2kXun3kXUnGwrhu723BjhH1BpFDIGbSzChjdpFPnSSQEWyt9I6wRk/9blRGKNJfNGOyrlpxCrodGT9Uwl3HGerlKeS6MjC0G6BbSpCs8QPVATqPkDT1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q+UcsD8AVJ2yD4QdTpH5jA/xu0OUWHpb/y8uAIk8s68=; b=HeZCymd4TksqxOQtVoRdObWYtq3TGHvedO6WZKVuoY4+nPvHjs8aY0KmgYEUrz76xL46NhvE5cbCAgcTm6nGIetUH4iIXxgRHAGTgLphNqIgzZlh+gZAYqRZMsgg6xzR8K76I2Gc/S+mA/vbIzbKoQuprl56vC57uWOESu3rhC28/woh4SndsWb2+wAOSqc+/CKqIKbQKMucUhQ76je8AA8y3pxAaW9k7GCYXfV6BcN4vnBmhUpS13ycoAeEVEZbpGYAzwzYzFVFkY4a1KAAk3FtHEyXgMFkuiuqdT7sUzpJtkcffmVtgdIM7Z47+K3ZkR7ds0k7pBJw0m2Ciq55Zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q+UcsD8AVJ2yD4QdTpH5jA/xu0OUWHpb/y8uAIk8s68=; b=KD6arz5pfDr7GufXAhRVRz3Nns3QhODeZjHxv9UF8HJPE5IFQPTI6Of34Pvoh6kDL7m4LksjlFCkIeUEMOEDrk+OuLXcz6de+SKo1j2kE2Ny7Tjar45Z4PWpgdIN90WO3mbPQS3DE7i4akwY5rOFBNHmXZGwO2e66SPIWV+QaeQ= Received: from MN2PR18MB3408.namprd18.prod.outlook.com (10.255.238.217) by MN2PR18MB2480.namprd18.prod.outlook.com (20.179.82.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2220.20; Mon, 2 Sep 2019 12:33:45 +0000 Received: from MN2PR18MB3408.namprd18.prod.outlook.com ([fe80::8162:62e8:aeeb:ec7b]) by MN2PR18MB3408.namprd18.prod.outlook.com ([fe80::8162:62e8:aeeb:ec7b%3]) with mapi id 15.20.2220.013; Mon, 2 Sep 2019 12:33:45 +0000 From: Robert Richter To: Borislav Petkov , Mauro Carvalho Chehab , Tony Luck CC: Robert Richter , James Morse , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH 3/5] EDAC, mc_sysfs: Remove pointless gotos Thread-Topic: [PATCH 3/5] EDAC, mc_sysfs: Remove pointless gotos Thread-Index: AQHVYYqpgvER4zlKe0KU5vpskR3bNg== Date: Mon, 2 Sep 2019 12:33:45 +0000 Message-ID: <20190902123216.9809-4-rrichter@marvell.com> References: <20190902123216.9809-1-rrichter@marvell.com> In-Reply-To: <20190902123216.9809-1-rrichter@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR07CA0027.eurprd07.prod.outlook.com (2603:10a6:7:66::13) To MN2PR18MB3408.namprd18.prod.outlook.com (2603:10b6:208:16c::25) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [31.208.96.227] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7b02db0a-334c-4ac2-f2df-08d72fa1cbc8 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MN2PR18MB2480; x-ms-traffictypediagnostic: MN2PR18MB2480: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:82; x-forefront-prvs: 01480965DA x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(39850400004)(396003)(136003)(366004)(199004)(189003)(6486002)(8676002)(186003)(110136005)(81166006)(81156014)(71190400001)(66066001)(6506007)(386003)(1076003)(71200400001)(26005)(6512007)(53936002)(256004)(478600001)(50226002)(54906003)(86362001)(36756003)(8936002)(14444005)(52116002)(66556008)(66476007)(486006)(5660300002)(64756008)(66446008)(11346002)(2616005)(4326008)(316002)(476003)(2906002)(7736002)(76176011)(6436002)(305945005)(6116002)(3846002)(99286004)(102836004)(14454004)(446003)(66946007)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2480; H:MN2PR18MB3408.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: uAkVfy0j3B7glonPo475z/1JTiVwMj+bgixN5I7PkMC27Cy666Jt9Ls4w666hobHigYaZeaYC3tYq+sKQkck+Io/o/TdUdHhYMC1aJLTJeDfz8p3UAp7XHBVntTh95qLdSK7L74Xu7eJBgquLI+J10ValZXlRphXpT3dgVYP5Z7ktd3rtisEnIo6DnorWzznLL6KOH2PW9VvsgiQIz8zWiXTE/lWDlUhEd48lkPJ/wLgHURdBv4l2wOXbaRtBQa/TxTlvG62Oaym1S+ogW5TAmRz3iLxopZQAWVwrgYsHEEPBPreUD9TZpYy11d5+p8PSZMILlB/0SIVFDRB1yFcohGIozDawkkYUgyUPgMtCfjonVsuDWvXEyEf7fCeJik8yFE/Bfzua/HCoz85krkCtIRe2GUbq2xKN/D+mo5noq4= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 7b02db0a-334c-4ac2-f2df-08d72fa1cbc8 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2019 12:33:45.3057 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nj3Fu1uBejGQhu55V+cItKvFWM8s25QR16qgbYnNXvTlxzi23yJmrWcmTdWEZGIuF5b5HRa7x9Z5x3rqbTua9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2480 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-02_04:2019-08-29,2019-09-02 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use direct returns instead of gotos. Error handling code becomes smaller and better readable. Signed-off-by: Robert Richter --- drivers/edac/edac_mc_sysfs.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) -- 2.20.1 diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 4eb8c5ceb973..309fc24339b0 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c @@ -938,7 +938,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci, if (err < 0) { edac_dbg(1, "failure: create device %s\n", dev_name(&mci->dev)); put_device(&mci->dev); - goto out; + return err; } /* @@ -987,7 +987,6 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci, } device_unregister(&mci->dev); -out: return err; } @@ -1044,10 +1043,8 @@ int __init edac_mc_sysfs_init(void) int err; mci_pdev = kzalloc(sizeof(*mci_pdev), GFP_KERNEL); - if (!mci_pdev) { - err = -ENOMEM; - goto out; - } + if (!mci_pdev) + return -ENOMEM; mci_pdev->bus = edac_get_sysfs_subsys(); mci_pdev->type = &mc_attr_type; @@ -1055,17 +1052,14 @@ int __init edac_mc_sysfs_init(void) dev_set_name(mci_pdev, "mc"); err = device_add(mci_pdev); - if (err < 0) - goto out_put_device; + if (err < 0) { + put_device(mci_pdev); + return err; + } edac_dbg(0, "device %s created\n", dev_name(mci_pdev)); return 0; - - out_put_device: - put_device(mci_pdev); - out: - return err; } void edac_mc_sysfs_exit(void)