Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp749354ybh; Sat, 3 Aug 2019 09:01:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSd/SipPb6sg8wdllC9H3k7g8UClnQmxS5Vvb8+Z5zJUXbu41gWZo2QHAAoY9j2BoWp9Oc X-Received: by 2002:a17:902:4501:: with SMTP id m1mr8137617pld.264.1564848117174; Sat, 03 Aug 2019 09:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564848117; cv=none; d=google.com; s=arc-20160816; b=L8oBRzpmeKc0Ae0WsAWTVjpTkytTX/KnC6m0llw2Q5lKvBpH4LYnUw8480QFbcSMh1 oKx6kWzo3IEIckFrezPi3D3+iO9nqhMBoEjJM6Fk6wD8YQSSOgMmJq4nN2LZ1EA+59LN cjd9Iug4nJ6Mw3HTtHsGRBLVBX24c4icTIF5FfKS7kS6eC5Ytq9+MEWiqajk5GEL2RZe Eayq4+gMnaDf1uYvkrVEqkquuZPh7xDCW704ArtkB1LAEKUAEzuwsnJrp7TGaD6qa7eg xw4nwwtws/UQz+g0F2UDghMT02WbSTnfhW6MFsbi2IANQcDV07awwrC4UD/rle0lI2EC 8sKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=i5KvXVAig/Q2ZcECLKSS1/KviJKkqltqg9/SB/L/D/c=; b=moetF1mkeYMZrO7fGOTvHZRpJ/w+ayJ0M4JMMY6yIA08EV1VCc8vyG2hB9/ME85abo mSrgD6+/vJY2fiL4aU+NQP5AqnDW2I2Pn+iz3v8IkUh/jymlrdQuyFY4/8hiieoRQ22b xxaSXjxH8URMoiSIUIGr+Vcq7Y1N32rvmtPx3OVEcfdv5XtUZmv6OAm5QXRT5uK6R6Xv DL6Yhee1S3Xeum1j8X9rtuboWQLpZ5fQOIhjb/dOqIYT3LAItRmlaPCqZUADs0Ayq5cM oK8c/rC9kWogsZkt3ST1jXWxryrEyXCGLUohvNryF5wf8FZemo+etS6BN5WEmcWX1WIs RqWw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6si23540217pgq.473.2019.08.03.09.01.42; Sat, 03 Aug 2019 09:01:57 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403991AbfHBREt (ORCPT + 99 others); Fri, 2 Aug 2019 13:04:49 -0400 Received: from foss.arm.com ([217.140.110.172]:55210 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731663AbfHBREt (ORCPT ); Fri, 2 Aug 2019 13:04:49 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4A9D2344; Fri, 2 Aug 2019 10:04:48 -0700 (PDT) Received: from [10.1.196.105] (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 983793F575; Fri, 2 Aug 2019 10:04:47 -0700 (PDT) Subject: Re: [PATCH v2 03/24] EDAC, ghes: Remove pvt->detail_location string To: Robert Richter Cc: Borislav Petkov , Mauro Carvalho Chehab , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20190624150758.6695-1-rrichter@marvell.com> <20190624150758.6695-4-rrichter@marvell.com> From: James Morse Message-ID: Date: Fri, 2 Aug 2019 18:04:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190624150758.6695-4-rrichter@marvell.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robert, On 24/06/2019 16:08, Robert Richter wrote: > 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 > --- > 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); After a game of spot-the-difference: you added a newline. Reviewed-by: James Morse Previously here: https://lore.kernel.org/linux-edac/7017c91e-8923-c8d2-26ca-875328ab855a@arm.com/ Please pick up tags when posting a new version. Thanks, James