Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp95718pxk; Fri, 11 Sep 2020 01:07:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytVE3rhKrXZNuQglGYN1eWg+NJydKBO2PskIF8HBb8+Kwg7zaOxvdcnz9i4iZj/Hkgl+kS X-Received: by 2002:a17:906:829a:: with SMTP id h26mr934543ejx.11.1599811663108; Fri, 11 Sep 2020 01:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599811663; cv=none; d=google.com; s=arc-20160816; b=GSV9lfuPpCPmyjDhBHOuQ+r81YNIaMofwUpJalpZ19G9a/2728hQNIUY2o6CMXo9Wi IneUiV/7SuUQJY0Nk2x/eE3VvkRm3G0BVsuO99YBPuDmOhP8wbYOatX9/wx726pAZ/9x xFlKyCZA8ip6vRsoFaa93rcwfkEFnPMuNm782uTMpaELbg2J9JAjKSTMxfoKbDF7EZeB X207jzd6HY3XHytbAFbKbPecGe/NV+wsGN3A4y1pR2yJEIrf+SPfF/NctLpdYjVAHcRh cNzQMJT7wUBghT6uwqAfoC1/SMYVX1uHGbg4QBr80Q86MVxpcRSqhxxO0gQYe1ZACSRw 5JAg== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=XTAui4mcCkwilo+g9OVy7aOwoaGD9oBkEzTukl44m5U=; b=DTvWR0q+V1YvMoTMxENWK6L1Sf0ueRnsffQnxlRxpPUkD3QSQzFWTn+RPj3uxAQpaX CI1COSCnewMxbJI6M8XnTSF6/da8fcVdbzZWp137KQh6mZJnC7Bonupjc9EIHCXweZ72 rzuhwxnKNRgX5sjPiCVCmN83AO2BY3PvdWyt0fxfITeUxgYue1YHqm14nsGGgWYjI8kg Zz+by5IKwgYnWyZVzkt8ZkzZV71uGDPbsnUHWZOrmc99Gnv4VQZHHjGa7L+bNKafuFis WU/JPdoPylGTz/AjNiiqPyXPCZZtzHxpGufFEFN+jup7/AIWw9zIaM0X049KGj2JuHDf FWyw== 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 a3si768959ejx.587.2020.09.11.01.07.19; Fri, 11 Sep 2020 01:07:43 -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 S1725767AbgIKIFz (ORCPT + 99 others); Fri, 11 Sep 2020 04:05:55 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:34250 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725875AbgIKIFq (ORCPT ); Fri, 11 Sep 2020 04:05:46 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8762F3D7A56EBE70361F; Fri, 11 Sep 2020 16:05:42 +0800 (CST) Received: from [127.0.0.1] (10.174.178.16) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Fri, 11 Sep 2020 16:05:41 +0800 Subject: Re: [PATCH] EDAC/mc_sysfs: add missing newlines when printing 'max(dimm)_location' To: Borislav Petkov CC: , , , References: <1599207563-41819-1-git-send-email-wangxiongfeng2@huawei.com> <20200910110012.GD8357@zn.tnic> From: Xiongfeng Wang Message-ID: Date: Fri, 11 Sep 2020 16:05:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200910110012.GD8357@zn.tnic> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.16] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/9/10 19:00, Borislav Petkov wrote: > On Fri, Sep 04, 2020 at 04:19:23PM +0800, Xiongfeng Wang wrote: >> 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 /]# > > Please use this commit message for your next version: > > EDAC/mc_sysfs: Add missing newlines when printing {max,dimm}_location > > Reading those sysfs entries gives: > > [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 /]# > > Add newlines after the value it prints for better readability. Thanks for your advice. I will add it in the next version. > >> @@ -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"); > > No size checking here? I can check if it's larger than PAGE_SIZE. Thanks, Xiongfeng >