lkml.org 
[lkml]   [2020]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] EDAC/mc_sysfs: add missing newlines when printing 'max(dimm)_location'
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.

> @@ -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?

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette
\
 
 \ /
  Last update: 2020-09-10 13:04    [W:0.037 / U:1.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site