Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3212178pxb; Mon, 9 Nov 2020 05:43:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLC1K52X6VZXxFIstaDFgm/ey0QBGv7RgWfVe/m4ASXop4zuxZNaPlLdH/UqfULbqzCGEA X-Received: by 2002:a50:cd84:: with SMTP id p4mr3466197edi.81.1604929425456; Mon, 09 Nov 2020 05:43:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929425; cv=none; d=google.com; s=arc-20160816; b=YoAAhN2fIjVaVPb05e/y8Sdn7TPJywY21DU1pV00tlpkUHwll9ePX5qefxBE0iTi3Y zRjczojtRcO0rHpRQhbJKcgrRPerb1AM2dYV4ou6JPE5LI9lu+rkHoXoO54wmyD17Di8 8OEbB3cPlFE/IdVlz980xxvgoU0k+6JzpEFxF+rS/cXlPWoqp3mYXUhzQEOnaN3gPmv3 3Y7zzKXdRB9yy71bgr3ilt8a6c+SOHKYAynlNApHdkqutm5WwyYz9QAaMJtiqVDvIvCD M17qG+KGCN4JZ3P0+oWn0A+x6dp/nJNckOxdYLplV12vYghHFssagwe7cJ16DJ4m2FU7 6+Hw== 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=Lk19uIiL3qnfw7S+WUqGMatyphrvmaNeW66PfMvK3ic=; b=URJ/sKvnkGR4RGuzSnWf5GHg1ZwD0IMiiOgxpNcQ51Mehgb+ncKX8OxHk4I6WAMiVg N+EtR9OBIVVwWn50zhq2l5BzyQJ97X6C2/d/hJKMyaR7EJ0C1HuhxLG9zmbnCuf3V4tM RKHBzU2V7zWDr4Z7MIEHiChsOII8jTwJiBDXCQSz3wWZqMdKfHwyPGqy5gwSncxA86uT Jsvaz9EZCCzlVA8L0iODiSZ4G/lbL0LXCJZp+9B2grZEWIPPBSxvowLUhuvTcr1EQrpy RBT8Eo+ElktGBxXEVhOb9Q07KhMnusUGEWibC/VYWPCAnbeGiD9zjatQrVgbReAEkDzR Uw3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="2E/SynQk"; 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 cz20si3464337edb.203.2020.11.09.05.43.22; Mon, 09 Nov 2020 05:43:45 -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="2E/SynQk"; 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 S1732417AbgKINmB (ORCPT + 99 others); Mon, 9 Nov 2020 08:42:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:55292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730032AbgKINBQ (ORCPT ); Mon, 9 Nov 2020 08:01:16 -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 92A1620684; Mon, 9 Nov 2020 13:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926876; bh=TOlrAhGQzu7ICQWJ38bWKmZt9tSLQ3MxzMWP0Ou4oxc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2E/SynQk+pgdsmXD0i/lep7V245TeAznTMHYCCOOC+ONr+YtZ2MF+9yG+GQehq2Ig /rsqJ8QwKrqOr0e+l18Q+2Mfdgr+ACJqGCyAa89rF0WiphGNxh3P7VZFtGmRcSYlBN aGyjKom0wTtFhwXIBJxKpjGBV8TYBur/Waw/pCoA= 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 4.9 034/117] power: supply: test_power: add missing newlines when printing parameters by sysfs Date: Mon, 9 Nov 2020 13:54:20 +0100 Message-Id: <20201109125027.269842327@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@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 57246cdbd0426..925abec45380f 100644 --- a/drivers/power/supply/test_power.c +++ b/drivers/power/supply/test_power.c @@ -344,6 +344,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); } @@ -357,6 +358,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); } @@ -371,6 +373,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); } @@ -385,6 +388,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); } @@ -400,6 +404,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); } @@ -417,6 +422,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