Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp644175ybh; Tue, 21 Jul 2020 04:34:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJcTQn92QC0qN5djVlHHAMTr9cHpaXnlWEW1DIKqye9aggtQecaQMY2KFMU7ERxsfGpl4I X-Received: by 2002:a05:6402:180a:: with SMTP id g10mr26231969edy.152.1595331270644; Tue, 21 Jul 2020 04:34:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595331270; cv=none; d=google.com; s=arc-20160816; b=VHS+fxWHttZ0pRSzDOv7kUhUxw51YANNQIdS2X1QSCXtPmI3izhxbLM2FNxbs2e6dC z3MncjeTiGz4RT/hVMrcdUy7CSuZfVd+X7Kp/q8ATd5Knts9AGOm7znvx2dEKxDflA0X DxY5LLrnY7bESqo0MVX3Ju2Hstha90rrCgYLXwmX3LMZmp2cYfP5XrtEsaGb4X/xsgn8 BOcH6jfaq8fdSXqOvRVI4/Pz1WryrZV+jwgQlCkmjmCTusgPIIbLUkOtOda7bSmSyDjD oFFrFM9vPGtJNNCyDlMyS7DqLlSbNrBOV8IhQ6BxcNEhcwicAyAk6bARKOQgEGsKPv9x /xGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=J8+ZzLQU1DKkGpd+nrEd6PrRxlNkrxHw8dBLLALGP/4=; b=hgiEKTNDBYqnhNN4AOVlu4PdgNm45YQYJFHB8oAv0Jalk6clmQZNUWP1p2Xiijxqq+ ma5DPZY66qWoJ903DIM/YSemGBWs+Dci+Z4qM7Q6/fWQ1Qz8dx7CnbC5FXkcEyjIgB8Z OnAH8BQr2iUYGNJpXB239q7/QqyCaKTk50vJe6WFEQdLqG9WyRhZCnUtGjPNfT4Drk37 B1xnMwvfzzmLC5coD3ifHpSF9C+MhKZx/qS7jjhsJsk0vhL32Z+Jb5pg7sIEQM5R2LyH b2nFPCBkElwCFwUNjnm14xWQNWVQK2yhWoSlaI7s5Y8P7BMpMeOq+7WLfbnKYa7WWcNe TXwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=mBmDm2wx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si12374390edt.383.2020.07.21.04.34.08; Tue, 21 Jul 2020 04:34:30 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20161025 header.b=mBmDm2wx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729624AbgGULby (ORCPT + 99 others); Tue, 21 Jul 2020 07:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726942AbgGULbx (ORCPT ); Tue, 21 Jul 2020 07:31:53 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 879E5C061794 for ; Tue, 21 Jul 2020 04:31:53 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id 95so14791132otw.10 for ; Tue, 21 Jul 2020 04:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:reply-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=J8+ZzLQU1DKkGpd+nrEd6PrRxlNkrxHw8dBLLALGP/4=; b=mBmDm2wxTdvMcm1uLvLz/S2MTRQoiNFHp26/ALu0Z15rkWakMIMMYBYSQ1m5BV8Vj7 zarNUBw1TKK0gu83LpYu8Rux5oPZ43QgrTmnPHlCs5iHAT3j5xyayvCa3FqLKLcaoLHg T8pBl7caJAByaP7IoZCvlpanEY3WucjtCrhDfgntzaBmcC7vdU5koHWDy5aUroxF8S+J 4rOYfE9AjrH4/zOL9L1/8tbNLhM8jRLeutmg664m9Fc1lMVmcHkc32gzDUx1K729SmY+ EZH/mnYbet+kTjwjCZGHyD+W0cYwQoRkWi/F6qXnKXiNfIMC0ifJG0XpR+h/2f7Dlie5 SAtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :reply-to:references:mime-version:content-disposition:in-reply-to :user-agent; bh=J8+ZzLQU1DKkGpd+nrEd6PrRxlNkrxHw8dBLLALGP/4=; b=GGMejwFj17EctgepVfkpv3dF2rnU+JCCaC4b8RqMli9BXuLSaEAhuie+Apnb9wtXoj 3U09p3EKqkEdNrWlAwRcMLwlsIGZjl2GY+YNUKIr/dj4bvWbZ2ocY7VP9YGdzjYSq21d P//IHwsIZEs9CW5j/9ttggah6MAz1HVjSyYn0ABmMa6LTB+rPEu6QGLdnPuHhJHuY2bl T7AdHDDutyQp4gwpol9NJTzH/M8PsAO9uwDDs95sJuNzKh/tXT9Vkl/xLCfd9w/BJedY b/j1GFuEW1LGmDM8mUVcm+OZfjChf2+w2q1jDyM4C4LwF75qoHn91PhQswxyJmvMaHYs XWXg== X-Gm-Message-State: AOAM532C27e3fGapzZ7qvmBkmS6eL16SGUQqFYXHiS7WUhfaLhR3UNpT Zyze0PnFAJFi8ptukNjz8Q== X-Received: by 2002:a9d:4ef:: with SMTP id 102mr23456732otm.289.1595331112867; Tue, 21 Jul 2020 04:31:52 -0700 (PDT) Received: from serve.minyard.net ([47.184.146.204]) by smtp.gmail.com with ESMTPSA id x10sm5035671ooq.13.2020.07.21.04.31.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 04:31:51 -0700 (PDT) Received: from minyard.net (unknown [IPv6:2001:470:b8f6:1b:70d6:b947:41f4:6e7e]) by serve.minyard.net (Postfix) with ESMTPSA id BDAFA18003B; Tue, 21 Jul 2020 11:31:50 +0000 (UTC) Date: Tue, 21 Jul 2020 06:31:49 -0500 From: Corey Minyard To: Xiongfeng Wang Cc: arnd@arndb.de, gregkh@linuxfoundation.org, openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, guohanjun@huawei.com, joe@perches.com Subject: Re: [PATCH v2] ipmi/watchdog: add missing newlines when printing parameters by sysfs Message-ID: <20200721113149.GH2952@minyard.net> Reply-To: minyard@acm.org References: <1595313309-43881-1-git-send-email-wangxiongfeng2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1595313309-43881-1-git-send-email-wangxiongfeng2@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 21, 2020 at 02:35:09PM +0800, Xiongfeng Wang wrote: > When I cat some ipmi_watchdog parameters by sysfs, it displays as > follows. It's better to add a newline for easy reading. > > root@(none):/# cat /sys/module/ipmi_watchdog/parameters/action > resetroot@(none):/# cat /sys/module/ipmi_watchdog/parameters/preaction > pre_noneroot@(none):/# cat /sys/module/ipmi_watchdog/parameters/preop > preop_noneroot@(none):/# > > Signed-off-by: Xiongfeng Wang Thanks, included in my queue for next release. -corey > --- > drivers/char/ipmi/ipmi_watchdog.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c > index 55986e1..f78156d 100644 > --- a/drivers/char/ipmi/ipmi_watchdog.c > +++ b/drivers/char/ipmi/ipmi_watchdog.c > @@ -232,12 +232,17 @@ static int set_param_str(const char *val, const struct kernel_param *kp) > static int get_param_str(char *buffer, const struct kernel_param *kp) > { > action_fn fn = (action_fn) kp->arg; > - int rv; > + int rv, len; > > rv = fn(NULL, buffer); > if (rv) > return rv; > - return strlen(buffer); > + > + len = strlen(buffer); > + buffer[len++] = '\n'; > + buffer[len] = 0; > + > + return len; > } > > > -- > 1.7.12.4 >