Re: [PATCH v2] EDAC/mc_sysfs: Add missing newlines when printing {max,dimm}_location

2020-09-18 Thread Joe Perches
On Fri, 2020-09-18 at 09:12 +0200, Borislav Petkov wrote: > On Fri, Sep 18, 2020 at 10:37:28AM +0800, Xiongfeng Wang wrote: > > Thansk a lot. I will send another version. Also I will change the > > 'snprintf' in 'dimmdev_location_show()' to 'scnprintf' > > No need to send another one - I have ever

Re: [PATCH v2] EDAC/mc_sysfs: Add missing newlines when printing {max,dimm}_location

2020-09-18 Thread Borislav Petkov
On Fri, Sep 18, 2020 at 10:37:28AM +0800, Xiongfeng Wang wrote: > Thansk a lot. I will send another version. Also I will change the > 'snprintf' in 'dimmdev_location_show()' to 'scnprintf' No need to send another one - I have everything locally and just amended it. Thx. -- Regards/Gruss, Bo

Re: [PATCH v2] EDAC/mc_sysfs: Add missing newlines when printing {max,dimm}_location

2020-09-17 Thread Xiongfeng Wang
On 2020/9/18 0:25, Borislav Petkov wrote: > On Thu, Sep 17, 2020 at 07:38:57PM +0800, Xiongfeng Wang wrote: >> I am not sure if snprintf will return a value larger than its second input >> paramter 'size'. > > The comment over snprintf() says > > * The return value is the number of characters

Re: [PATCH v2] EDAC/mc_sysfs: Add missing newlines when printing {max,dimm}_location

2020-09-17 Thread Borislav Petkov
On Thu, Sep 17, 2020 at 07:38:57PM +0800, Xiongfeng Wang wrote: > I am not sure if snprintf will return a value larger than its second input > paramter 'size'. The comment over snprintf() says * The return value is the number of characters which would be * generated for the given input, excludi

Re: [PATCH v2] EDAC/mc_sysfs: Add missing newlines when printing {max,dimm}_location

2020-09-17 Thread Joe Perches
On Thu, 2020-09-17 at 19:38 +0800, Xiongfeng Wang wrote: > On 2020/9/17 1:00, Borislav Petkov wrote: > > On Mon, Sep 14, 2020 at 10:48:54AM +0800, Xiongfeng Wang wrote: > > > @@ -813,15 +817,21 @@ static ssize_t mci_max_location_show(struct device > > > *dev, > > >c

Re: [PATCH v2] EDAC/mc_sysfs: Add missing newlines when printing {max,dimm}_location

2020-09-17 Thread Xiongfeng Wang
Hi , On 2020/9/17 1:00, Borislav Petkov wrote: > On Mon, Sep 14, 2020 at 10:48:54AM +0800, Xiongfeng Wang wrote: >> @@ -813,15 +817,21 @@ static ssize_t mci_max_location_show(struct device >> *dev, >> char *data) >> { >> struct mem_ctl_info *mci = to_mci(de

Re: [PATCH v2] EDAC/mc_sysfs: Add missing newlines when printing {max,dimm}_location

2020-09-16 Thread Borislav Petkov
On Mon, Sep 14, 2020 at 10:48:54AM +0800, Xiongfeng Wang wrote: > @@ -813,15 +817,21 @@ static ssize_t mci_max_location_show(struct device *dev, >char *data) > { > struct mem_ctl_info *mci = to_mci(dev); > - int i; > + int i, n; > char *p = d

[PATCH v2] EDAC/mc_sysfs: Add missing newlines when printing {max,dimm}_location

2020-09-13 Thread Xiongfeng Wang
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. Signed-o