EDAC/mc_sysfs: Add missing newlines when printing {max,dimm}_location
authorXiongfeng Wang <wangxiongfeng2@huawei.com>
Mon, 14 Sep 2020 02:48:54 +0000 (10:48 +0800)
committerBorislav Petkov <bp@suse.de>
Fri, 18 Sep 2020 07:14:01 +0000 (09:14 +0200)
commite6bbde8b2b4f5aeb129c5a6cb99f0b773c871b8c
tree8a818842a684d16e5058a8eb5872fa6a23a25d1c
parent07def58717dab4ff0055c61c316df65d59c53c83
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.

  [ bp: Make len a signed int and change the check to catch wraparound.
    Increment the pointer p only when the length check passes. Use
    scnprintf(). ]

Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/1600051734-8993-1-git-send-email-wangxiongfeng2@huawei.com
drivers/edac/edac_mc_sysfs.c