From patchwork Mon Jun 24 15:09:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 167605 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4347361ilk; Mon, 24 Jun 2019 08:09:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwk2z1XuyYRNXXRhdK9hpI+LKyejRvXSTjV1QTBURNWjp3jfbkdZWTzTxVwM4K0n6VXAWUK X-Received: by 2002:a17:90a:bf02:: with SMTP id c2mr25527393pjs.73.1561388960669; Mon, 24 Jun 2019 08:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561388960; cv=none; d=google.com; s=arc-20160816; b=QmhCn6//swB4a4btqTAhPgB5qpQtutrtQbiL7D/UTosoAoFkyYVL190dBtvv7L3OQ6 lBs8q5O3zMwF4hjMzsz7azuDNNxuLoh4UNoxOLiuRMbRTLhljIOUZGa25N1BYtquazao UJOhljwvqwHn/JLx5gcSsytKWT8v+eHIAg+ZwLOdQQGPZ63bOJpNuVo/L5GwWkvgOBqr wisTk25OpmpkYpbzeG30G+rHVspXbkAesPja6jG3BhnwKX1FwacGIR9oiIWlP2Ukd1ry VKrMhWV26yIzr6eywThvphMeTNmQl+FuC4r68MB0UrC3+Z3MebvRtV3WkFCkve4osvOF O2lw== ARC-Message-Signature: i=1; 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=BUZsqVL7YZsjTmOqbkH+7mTjGbV1gGSnUZ5iMdLGsmY=; b=bayx3rXFoweGcTQLfyWEXJf3ONE/yN8A0A+72qI7a1TsUxmMjvDp2ashJVZ+Hvjwl1 p/hlhZq2y7khbzXE0uGo+DeOd4hOdnQXopzkHYvEZEhDYhH51E9Lb0c+K4h6ObMDskov AEbygjkD194NyF7XufoIy/nPH99Q08ykIx1JzOK5yAd94jmxy9Q6oXygShTebQp3tz8N MNOBtCWMKvp4xZ4UMIR53dZO20O4vCWcCDD1QscKmbD3nlR4wPedZ3vM433uyAREkc6X qABAiJWFMBVVxD3bLo9rOTs8gHNbv4Te76hU1R8ZRWwnKcT80TjCrMqLm83lhd98cm+D zj4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0818 header.b=DHA0uNid; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=chrxlK5L; 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 g10si10697753pjp.74.2019.06.24.08.09.20; Mon, 24 Jun 2019 08:09:20 -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=DHA0uNid; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=chrxlK5L; 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 S1728276AbfFXPJT (ORCPT + 30 others); Mon, 24 Jun 2019 11:09:19 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:57022 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730476AbfFXPJP (ORCPT ); Mon, 24 Jun 2019 11:09:15 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5OF8FJZ025903; Mon, 24 Jun 2019 08:09:08 -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=BUZsqVL7YZsjTmOqbkH+7mTjGbV1gGSnUZ5iMdLGsmY=; b=DHA0uNidijE/Q4QvReEc4LICWqIEU5u0WR3Slx/VYMDmmuQrW8HAY6JN7dFAlP8c0d66 y3pooha4hVhkt8cdqr5YGBNWtgg8KlIMJiLfx86PesaPUDALpas10zitzunZd0DNjhGF Pn17B6hvGBrdxj8oW8grrN3y/2MvS5wpyM6nbfMRJ1Y4Nl+ZMv7KV6UUtNWYUoaqe0Im ypHLFiLbFtrMNGo+CkA3S8yiSuVfLnfgf0rcFWWmi/IWRXGuxSXggMynviR4jfJ5P59u pBE0kM9EVVaSLPiU/8XmTRGYM1jpSboPxy+jYStEMdFMZhjuRaiJdu188DRO42P+1f3H lg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2t9kujf7rg-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 24 Jun 2019 08:09:08 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 24 Jun 2019 08:09:04 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.59) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 24 Jun 2019 08:09:04 -0700 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=BUZsqVL7YZsjTmOqbkH+7mTjGbV1gGSnUZ5iMdLGsmY=; b=chrxlK5LaJuq6QzsKUybN+r4TVKtvfCrqm7UCn9kWLsgESSU9NIC4Ch1zGH9JnxlQoisPYKRI5lO4J4cPZ/NLuXIgcxj2mS+RBBXC3yrhPGVqql+uUvgz6OaT6GnTFMzyxlm8AmyaKZP0ypXeMPh1BaExmgfSe94+yTA+BTAb7c= Received: from MN2PR18MB3408.namprd18.prod.outlook.com (10.255.238.217) by MN2PR18MB3197.namprd18.prod.outlook.com (10.255.236.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.13; Mon, 24 Jun 2019 15:09:02 +0000 Received: from MN2PR18MB3408.namprd18.prod.outlook.com ([fe80::d3:794c:1b94:cf3]) by MN2PR18MB3408.namprd18.prod.outlook.com ([fe80::d3:794c:1b94:cf3%4]) with mapi id 15.20.2008.014; Mon, 24 Jun 2019 15:09:02 +0000 From: Robert Richter To: Borislav Petkov , James Morse , "Mauro Carvalho Chehab" CC: "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Robert Richter Subject: [PATCH v2 05/24] EDAC, mc: Fix and improve sysfs init functions Thread-Topic: [PATCH v2 05/24] EDAC, mc: Fix and improve sysfs init functions Thread-Index: AQHVKp7CWIyiXnaYckSK7vYUHbfuPA== Date: Mon, 24 Jun 2019 15:09:02 +0000 Message-ID: <20190624150758.6695-6-rrichter@marvell.com> References: <20190624150758.6695-1-rrichter@marvell.com> In-Reply-To: <20190624150758.6695-1-rrichter@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P190CA0035.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::24) 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: [92.254.182.202] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7701ef64-9742-4f17-b37a-08d6f8b5e477 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MN2PR18MB3197; x-ms-traffictypediagnostic: MN2PR18MB3197: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:348; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(136003)(396003)(346002)(376002)(199004)(189003)(36756003)(110136005)(107886003)(54906003)(81156014)(81166006)(68736007)(8676002)(25786009)(5660300002)(8936002)(305945005)(7736002)(4326008)(1076003)(186003)(6116002)(14454004)(476003)(486006)(2616005)(11346002)(256004)(14444005)(446003)(3846002)(50226002)(26005)(2906002)(52116002)(76176011)(71200400001)(71190400001)(99286004)(386003)(6506007)(102836004)(478600001)(316002)(86362001)(6512007)(66066001)(53936002)(6486002)(73956011)(66946007)(66476007)(66556008)(64756008)(66446008)(6436002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3197; 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: 8ZwaLMFdgAPeIdsZnmM+i1tKscNEv2hEJXchtB/8cxnpNgDuMAi4N3RQ4Hyb+dHo2m5GHNwaa5M8mWU05j4ke5sXByS2GL2Cia49opNIVN+GuC5ZwWZOS1L8I+t6vJqeB4G1806dpk5a6Aksg5+IOG5AxNcOk2LtCTtZDz628NsZsP/tBmlQmPztAl6vZZQntixdOQE1Nj28zDGS1FaiMlaEvoSk9gILCtoAbJxwV65Rzll8N54wE1oyF7NyDSTqFHQo5Uh2k8kt1VEv7TipdOQXOF1s/OOpVQ+7Eh9KyRWwUSP4prlGQBLc72FrIY53Dq/safhN2vj+ewduIrwAO1wZU4vWKY/oFz/Kb7QUpK2FvsFC678rC4pgLZINVK0KZ9rvz7ZtBl+u/sMxcK4J72Yvuq7/2Rg31VpP8f4nQ7A= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 7701ef64-9742-4f17-b37a-08d6f8b5e477 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 15:09:02.8121 (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: rrichter@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3197 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-24_10:, , signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove gotos as they just create overhead. Also, fix debug message for the case edac_create_dimm_object() is failing. Signed-off-by: Robert Richter --- drivers/edac/edac_mc_sysfs.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) -- 2.20.1 diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 7c01e1cc030c..29dd9719f82f 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c @@ -655,8 +655,9 @@ static int edac_create_dimm_object(struct mem_ctl_info *mci, err = device_add(&dimm->dev); if (err) put_device(&dimm->dev); - - edac_dbg(0, "created rank/dimm device %s\n", dev_name(&dimm->dev)); + else + edac_dbg(0, "created rank/dimm device %s\n", + dev_name(&dimm->dev)); return err; } @@ -938,7 +939,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 +988,6 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci, } device_unregister(&mci->dev); -out: return err; } @@ -1044,10 +1044,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; @@ -1056,15 +1054,10 @@ int __init edac_mc_sysfs_init(void) err = device_add(mci_pdev); if (err < 0) - goto out_put_device; - - edac_dbg(0, "device %s created\n", dev_name(mci_pdev)); - - return 0; + put_device(mci_pdev); + else + edac_dbg(0, "device %s created\n", dev_name(mci_pdev)); - out_put_device: - put_device(mci_pdev); - out: return err; }