Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp802990pxb; Tue, 3 Nov 2020 12:59:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyc/qLHan+g+FOTvQ87PvpNazh898A+Uup3mIqAMX8wEzDFw4OKbi4ZYyUebehBgz0foLBN X-Received: by 2002:a17:906:578b:: with SMTP id k11mr12896272ejq.330.1604437168636; Tue, 03 Nov 2020 12:59:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437168; cv=none; d=google.com; s=arc-20160816; b=IZYOgvEx41QmCJQ0pdA+5MOlXgalJ4GgDnPGStwUhFKcsP0+a7A4T3NDKD/rsKYyCd fLWYNYcbCAgEdtev8xZxlMsNGivJ8GhzM+AY7RQCUH5C/5MGeFcrRZSVsoJd6Xjq/Br5 yq6maVoEBtZPBGDfi7+02oe+8+EGJiL6972LF4aE51Wq6c4oMKuWfnoGBzT4ekRJQzFU 68WdiprLJfEmpTKfsW6FnNQrrUZXfDM0CKnQhzZPvRrnbFw8roLWOx6ZmlIArHQUOh/7 XUonLIdzXsccZdQdFsGOE/8nz/u+jVai76FwaGI/hdmNSFejBKCXuiwdAxoU+G4uDEZK WWCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WeJvZdgj3K2jxhQmjRnjvlDKqfJIOi8p5ID+LIyoDds=; b=Ma7ith9VAVurjzTwDOt4rFEhwVPB0JhxmI8sSywzdHKNG/wy7cJLvmOec3uzR8N62C Dj+M8ajCIdorJGQ8UtsunGPFcqT64aIoRXs1NRwrzGl/a5zqVtXdsayWwCH/aY9l293h NCYMA76TqSuDBUpWtSi6wD7rICpBAtfCE/E5tt1Z9S6Chvh4KCCv7dKZ+EHrqS+UO0Ay 86nhu2NdMKgQQ95UBajWpnVUVTy1nncumFE4APti46hKoWMMbNSCnNzcTAK0t04qpZRw u/jEpueGU0qc7NHAFIyD8l1xcqR6dNFiZ/EZyoHlZA+jOUSjA7bFUqoZAWeS6T0Q7Vu6 Dujg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DGvibOXQ; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k22si14668969edr.463.2020.11.03.12.59.04; Tue, 03 Nov 2020 12:59:28 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=DGvibOXQ; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732322AbgKCUzg (ORCPT + 99 others); Tue, 3 Nov 2020 15:55:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:56048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732318AbgKCUza (ORCPT ); Tue, 3 Nov 2020 15:55:30 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AF3ED223BF; Tue, 3 Nov 2020 20:55:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436929; bh=e96ElzH4qHjRxBT24OfmOK6z68omUfbEfRe3bZg8ZNQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DGvibOXQcOwBLmVYva3g59Se7BRffRzelQ1VnTPuHAeUaYoCtovKfZB0UcIDKfLze 4JvcvjC2TXPnQoqbzjlvQ+AgbavKi2I194IbPBDlQEBBmYfhYCZDHgIQK7WuYUs/dj 1pfeC7t/s02dus3zGgAhoEoUjzV0Sbk4Ua4ewN38= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiongfeng Wang , Sebastian Reichel , Sasha Levin Subject: [PATCH 5.4 070/214] power: supply: test_power: add missing newlines when printing parameters by sysfs Date: Tue, 3 Nov 2020 21:35:18 +0100 Message-Id: <20201103203256.962911591@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiongfeng Wang [ Upstream commit c07fa6c1631333f02750cf59f22b615d768b4d8f ] When I cat some module parameters by sysfs, it displays as follows. It's better to add a newline for easy reading. root@syzkaller:~# cd /sys/module/test_power/parameters/ root@syzkaller:/sys/module/test_power/parameters# cat ac_online onroot@syzkaller:/sys/module/test_power/parameters# cat battery_present trueroot@syzkaller:/sys/module/test_power/parameters# cat battery_health goodroot@syzkaller:/sys/module/test_power/parameters# cat battery_status dischargingroot@syzkaller:/sys/module/test_power/parameters# cat battery_technology LIONroot@syzkaller:/sys/module/test_power/parameters# cat usb_online onroot@syzkaller:/sys/module/test_power/parameters# Signed-off-by: Xiongfeng Wang Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/supply/test_power.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/power/supply/test_power.c b/drivers/power/supply/test_power.c index c3cad2b6dabae..1139ca7251952 100644 --- a/drivers/power/supply/test_power.c +++ b/drivers/power/supply/test_power.c @@ -341,6 +341,7 @@ static int param_set_ac_online(const char *key, const struct kernel_param *kp) static int param_get_ac_online(char *buffer, const struct kernel_param *kp) { strcpy(buffer, map_get_key(map_ac_online, ac_online, "unknown")); + strcat(buffer, "\n"); return strlen(buffer); } @@ -354,6 +355,7 @@ static int param_set_usb_online(const char *key, const struct kernel_param *kp) static int param_get_usb_online(char *buffer, const struct kernel_param *kp) { strcpy(buffer, map_get_key(map_ac_online, usb_online, "unknown")); + strcat(buffer, "\n"); return strlen(buffer); } @@ -368,6 +370,7 @@ static int param_set_battery_status(const char *key, static int param_get_battery_status(char *buffer, const struct kernel_param *kp) { strcpy(buffer, map_get_key(map_status, battery_status, "unknown")); + strcat(buffer, "\n"); return strlen(buffer); } @@ -382,6 +385,7 @@ static int param_set_battery_health(const char *key, static int param_get_battery_health(char *buffer, const struct kernel_param *kp) { strcpy(buffer, map_get_key(map_health, battery_health, "unknown")); + strcat(buffer, "\n"); return strlen(buffer); } @@ -397,6 +401,7 @@ static int param_get_battery_present(char *buffer, const struct kernel_param *kp) { strcpy(buffer, map_get_key(map_present, battery_present, "unknown")); + strcat(buffer, "\n"); return strlen(buffer); } @@ -414,6 +419,7 @@ static int param_get_battery_technology(char *buffer, { strcpy(buffer, map_get_key(map_technology, battery_technology, "unknown")); + strcat(buffer, "\n"); return strlen(buffer); } -- 2.27.0