Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1142409pxk; Fri, 4 Sep 2020 01:28:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylSBF+D/20d/jLdD7M4QcIw+fYTk1W+hNtGNfDm+O6LuXAQTG2wPDGpa+feyOm+X4h7kl6 X-Received: by 2002:a17:906:ae8f:: with SMTP id md15mr1182831ejb.131.1599208085843; Fri, 04 Sep 2020 01:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599208085; cv=none; d=google.com; s=arc-20160816; b=Gkr8r1JxnzFkN/5QbzmqL302/74XTEwY9QJHvTHsA7WfUx7Dp86Fzd9M1RtxNhkZcj hsjT3TItnHmn4zoV18eL7X1Cbhr8MIJG9yJc/GEh3Hj3Ei0Wy6SuLd+laseml2Sd3d60 ewApVTNmkVgI4FjzxaVZYhYmDmn01UyaNEbVIZ2cmIy5FWDzL4bqfYHCa69HCNMYuVEg RkxZYGuDFvmGoHOB4awTYjahJgkaBMg/7+Ie3p/pUOtfK7ZugFqB24mTS87CuMutWDt8 ooe3iIn5UQT29j6fTr3r7IrdceLR6GGz5/ouS1JcrOQxK2dv1yR+yslm7YCGiubSHH4f HIoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=lCSYYLPYCiIsVJ7XkDHA2PO5rTw1zHjLyZeBlzYA6LU=; b=MebaxG2ZkXEXBGPqL32o3Mp44diQbgeowddSlv/i0c2WWsr5LmOaXg4eE4lJNq6BIe lFwjlijuKZ8ufmbJB7LnexArpjfGzC9QqauFe6FzVWiC4nI1yPD36ibGqsQvAaAK19KL 3S6195ixw2IaFkfFKwVGfe1x3gpHxLCyNVVoyL1ANm5nl9yOiveSxBseR5Qof1zODTZ6 qqDqC9L7USNtA9+aSsYwClpKZXMfhC2mEDlaYK6tg6xy8M5t8F8sW9Q8lQorGtQssoox lS9JUzvdkC6jtsgPxSoJflVg8sEeAlfzXPZ7YgDl4HTnbbVbS2VBbI9WEOqwPYXuU/py Am/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k18si2525887eds.468.2020.09.04.01.27.42; Fri, 04 Sep 2020 01:28:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729841AbgIDI05 (ORCPT + 99 others); Fri, 4 Sep 2020 04:26:57 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:10768 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729582AbgIDI0z (ORCPT ); Fri, 4 Sep 2020 04:26:55 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 5359180C9C0A7CA6DE60; Fri, 4 Sep 2020 16:26:53 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Fri, 4 Sep 2020 16:26:43 +0800 From: Xiongfeng Wang To: , , CC: , , Subject: [PATCH] EDAC/mc_sysfs: add missing newlines when printing 'max(dimm)_location' Date: Fri, 4 Sep 2020 16:19:23 +0800 Message-ID: <1599207563-41819-1-git-send-email-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When I cat 'max_location' and 'dimm_location' by sysfs, it displays as follows. It's better to add a newline for easy reading. [root@localhost /]# cat /sys/devices/system/edac/mc/mc0/max_location memory 3 [root@localhost /]# cat /sys/devices/system/edac/mc/mc0/dimm0/dimm_location memory 0 [root@localhost /]# Signed-off-by: Xiongfeng Wang --- I am not sure if there are some userspace tools using this file. --- drivers/edac/edac_mc_sysfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 4e6aca5..5d7b079 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c @@ -474,8 +474,12 @@ static ssize_t dimmdev_location_show(struct device *dev, struct device_attribute *mattr, char *data) { struct dimm_info *dimm = to_dimm(dev); + ssize_t count; - return edac_dimm_info_location(dimm, data, PAGE_SIZE); + count = edac_dimm_info_location(dimm, data, PAGE_SIZE); + count += snprintf(data + count, PAGE_SIZE - count, "\n"); + + return count; } static ssize_t dimmdev_label_show(struct device *dev, @@ -821,6 +825,7 @@ static ssize_t mci_max_location_show(struct device *dev, edac_layer_name[mci->layers[i].type], mci->layers[i].size - 1); } + p += sprintf(p, "\n"); return p - data; } -- 1.7.12.4