From patchwork Mon Jun 24 15:08:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 167625 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4349156ilk; Mon, 24 Jun 2019 08:10:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0FrPWuqdZmVheF001Vqtk6ZY3QI2V3+jnbLGg/8duSUAsbu/+CK3rrHozwpNCACAtmq9Z X-Received: by 2002:a17:902:848b:: with SMTP id c11mr125845981plo.217.1561389044686; Mon, 24 Jun 2019 08:10:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561389044; cv=none; d=google.com; s=arc-20160816; b=TGSXtlL5SdAuCnGFjAFXahkgg2Dk1SekiWH+fzUSYLMg9ecT2jBETHX3dZjh+poLpg jJitDzdWlyOCDpH4z2VE5m30RbX/oqfeLaSiEmkaAxp96ixXWLWDyuhiKiuANEBGCxm4 Tj+kne7Frj3/U2rNOF0foxNe9DASGR8idXHbaA1sjDYn89vxstdAjc8Uan6pNogK6FVO vp4iQq8gcDeQmqvVE7eMmEFZCCSiwHB/mpuQfkQ80DgaBmq8Wr4MAtNxWCtYK1InFu7H c8p3X3/JqH6fPkmV7qNqTEs7I7aQ2rPTsbuPwJ3q2vjlijZU+V17ImtcAEeuXjysISy6 4BWQ== 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=g2yPZvZnZPxp7REQr2O9loNXHPznbv3ZYyA2oH/C1zg=; b=i/F5oB7ZvtjEkmmE4zrWe0QB20ISbbV0hkqsmspMZZnFDO69xrIyTgD5yMCkf9ZoM1 DPx+OreHcreCwiwbbWFxLwzRC/JngPT7hE9lQo5rJHyWneS8Upu55S/W4OWX91IqmXPk 8P35A9G44w9mftk1Tkn9CGTUbsVDmzOgUg0EbFEEuJ9GJCXs3/1HKe8iwnzY8pAJjxm6 bVQQ98wix0txfs+cS48h3TOA/WdJKQKwyD3vJQFTrv3hrJp3wYxpugq5bBagen2+FXNc uv1Pf4VcePL9/r4clyf1Xw+mBK4rRegwfIKmz0Bpobb1/l1iPSM+TgwBeKNao4ysyvmu Prhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0818 header.b=m+mrgjwB; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=qLoRbvpd; 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 t17si11531093pjw.99.2019.06.24.08.10.44; Mon, 24 Jun 2019 08:10:44 -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=m+mrgjwB; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector2-marvell-onmicrosoft-com header.b=qLoRbvpd; 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 S1730436AbfFXPJN (ORCPT + 30 others); Mon, 24 Jun 2019 11:09:13 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:46498 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730218AbfFXPJJ (ORCPT ); Mon, 24 Jun 2019 11:09:09 -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 x5OF8DQo025885; Mon, 24 Jun 2019 08:09:02 -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=g2yPZvZnZPxp7REQr2O9loNXHPznbv3ZYyA2oH/C1zg=; b=m+mrgjwBxj+EGpc3tOW+NghAUasXBXC60P4dQpbwPbD7TZ7Ji5m67+mOrg9SsTs3aR49 w7WcGqEJnMPJxh9kULwlP1R/eAxVdX8C7inB9v7y8BjBeI3W/p2WM9GVhJuewKEECc3m B0gmFo87rnrtSWRW/7yqw2wtyFiTEHrraFWEfkkXX80pG3lCcUlDjrr/Bl6vF0IQEXQb 35woqmmg285dJUIwBuGMWNiVoSL17iXkeLD2LNYjybMzP4o+Co9ZkVFkP0H4uLmAy6Ay IQ0Sa05ZiM5x9xcryaoCk84Cpx7sCrfWruqhbmHR/wCWE4HgdCfOJq2ayV8vWx2bMU9E Aw== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2t9kujf7r7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 24 Jun 2019 08:09:02 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) 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:00 -0700 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (104.47.42.54) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 24 Jun 2019 08:09:00 -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=g2yPZvZnZPxp7REQr2O9loNXHPznbv3ZYyA2oH/C1zg=; b=qLoRbvpd0b3f/NnXxFOiCDGzqdWWBNLpTE+5gqpg+7K0d+/mnWjPqB02zLc/C+OenPr0nKSCo2Gy1m0Yf3y+FjKYmzd0KkJ9ms6R/5/Lhf8qKy9MiB/NyERPWm6xyqSMw+xAemn8M/wwWGLVGePLVQLKFTgqOsJEa585rHewlkQ= Received: from MN2PR18MB3408.namprd18.prod.outlook.com (10.255.238.217) by MN2PR18MB2589.namprd18.prod.outlook.com (20.179.82.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Mon, 24 Jun 2019 15:08:59 +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:08:59 +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 03/24] EDAC, ghes: Remove pvt->detail_location string Thread-Topic: [PATCH v2 03/24] EDAC, ghes: Remove pvt->detail_location string Thread-Index: AQHVKp6/16x+WuPF8U6tQfjgZBANZg== Date: Mon, 24 Jun 2019 15:08:59 +0000 Message-ID: <20190624150758.6695-4-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: 9c5134ad-0fff-4e96-843a-08d6f8b5e23b x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MN2PR18MB2589; x-ms-traffictypediagnostic: MN2PR18MB2589: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:758; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(346002)(376002)(366004)(136003)(189003)(199004)(2906002)(2616005)(486006)(476003)(52116002)(14444005)(256004)(5660300002)(66446008)(73956011)(66946007)(1076003)(14454004)(6116002)(86362001)(3846002)(99286004)(6486002)(68736007)(81166006)(81156014)(6436002)(4326008)(305945005)(50226002)(53936002)(7736002)(8676002)(8936002)(478600001)(64756008)(66556008)(66476007)(6512007)(107886003)(71190400001)(71200400001)(36756003)(26005)(102836004)(386003)(186003)(11346002)(76176011)(6506007)(110136005)(316002)(54906003)(446003)(25786009)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2589; H:MN2PR18MB3408.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: j3ev69SxGa/6z2N5b6Ngrv3UdravwyMs4kfjBWXK0ud54QzwXl6oSuaFyqHbOuO0bvQPQeyBpp+TRD41VAuGBM2p0kM1q2MPc81J3MMbugPbZ7lMCLitfnLYXsbf2m6WSNWNWFXaIwC5+xD06zHkfcSmhIIUR6oLyd39Oa2mp4R8pY8zD1cRQwrYfCd503T6Mc/9at41xdALwSBs3EaRcidIfxjD9I+0s1DcPJg51O2d2cWJ8ShFRB2kvGp0MxmkUME0GsI4EIHI7qKPEJUqqwHMfcJeq60FwRs51XHHW0kuUM0aQhodx7s/N5/Qv3XLbRVxPCJSi7lu5VJCAMN22u8O50B40EFrETLJois6WoLqAfjGVUa/FtfMhFHLFYIFHjyTmr1OLHskiWJx3jkcqk3ygTHSg/VhyztXjWDYyYI= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 9c5134ad-0fff-4e96-843a-08d6f8b5e23b X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 15:08:59.0372 (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: MN2PR18MB2589 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 The detail_location[] string in struct ghes_edac_pvt is complete useless and data is just copied around. Put everything into e->other_detail from the beginning. Signed-off-by: Robert Richter --- drivers/edac/ghes_edac.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.20.1 Reviewed-by: James Morse diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c index d095d98d6a8d..049de73c3bad 100644 --- a/drivers/edac/ghes_edac.c +++ b/drivers/edac/ghes_edac.c @@ -21,8 +21,7 @@ struct ghes_edac_pvt { struct mem_ctl_info *mci; /* Buffers for the error handling routine */ - char detail_location[240]; - char other_detail[160]; + char other_detail[400]; char msg[80]; }; @@ -224,13 +223,14 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) e->error_count = 1; e->grain = 1; strcpy(e->label, "unknown label"); - e->msg = pvt->msg; - e->other_detail = pvt->other_detail; e->top_layer = -1; e->mid_layer = -1; e->low_layer = -1; - *pvt->other_detail = '\0'; + e->msg = pvt->msg; + e->other_detail = pvt->other_detail; + *pvt->msg = '\0'; + *pvt->other_detail = '\0'; switch (sev) { case GHES_SEV_CORRECTED: @@ -361,6 +361,8 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) /* All other fields are mapped on e->other_detail */ p = pvt->other_detail; + p += snprintf(p, sizeof(pvt->other_detail), + "APEI location: %s ", e->location); if (mem_err->validation_bits & CPER_MEM_VALID_ERROR_STATUS) { u64 status = mem_err->error_status; @@ -443,12 +445,10 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) grain_bits = fls_long(e->grain - 1); /* Generate the trace event */ - snprintf(pvt->detail_location, sizeof(pvt->detail_location), - "APEI location: %s %s", e->location, e->other_detail); trace_mc_event(type, e->msg, e->label, e->error_count, mci->mc_idx, e->top_layer, e->mid_layer, e->low_layer, (e->page_frame_number << PAGE_SHIFT) | e->offset_in_page, - grain_bits, e->syndrome, pvt->detail_location); + grain_bits, e->syndrome, e->other_detail); edac_raw_mc_handle_error(type, mci, e); spin_unlock_irqrestore(&ghes_lock, flags);