X86 platform drivers
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Denis Efremov <efremov@linux.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	"Gustavo A . R . Silva" <gustavoars@kernel.org>,
	Julia Lawall <julia.lawall@inria.fr>,
	Alex Dewar <alex.dewar90@gmail.com>
Cc: York Sun <york.sun@nxp.com>, Borislav Petkov <bp@alien8.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Tony Luck <tony.luck@intel.com>,
	James Morse <james.morse@arm.com>,
	Robert Richter <rric@kernel.org>,
	Michal Simek <michal.simek@xilinx.com>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Maxim Levitsky <maximlevitsky@gmail.com>,
	Alex Dubov <oakad@yahoo.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Tomas Winkler <tomas.winkler@intel.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Madalin Bucur <madalin.bucur@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Douglas Miller <dougmill@linux.ibm.com>,
	Stanislav Yakovlev <stas.yakovlev@gmail.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	Darren Hart <dvhart@infradead.org>,
	An
Subject: Re: sysfs output without newlines
Date: Sat, 29 Aug 2020 13:33:56 -0700	[thread overview]
Message-ID: <b64a4cb0ee68fee01973616e5ef0f299ac191f6d.camel@perches.com> (raw)
In-Reply-To: <4cd6275c-6e95-3aeb-9924-141f62e00449@linux.com>

On Sat, 2020-08-29 at 23:23 +0300, Denis Efremov wrote:
> Hi,
> 
> On 8/29/20 9:23 PM, Joe Perches wrote:
> > While doing an investigation for a possible treewide conversion of
> > sysfs output using sprintf/snprintf/scnprintf, I discovered
> > several instances of sysfs output without terminating newlines.
> > 
> > It seems likely all of these should have newline terminations
> > or have the \n\r termination changed to a single newline.
> 
> I think that it could break badly written scripts in rare cases.

Maybe.

Is sysfs output a nominally unchangeable api like seq_?
Dunno.  seq_ output is extended all the time.

I think whitespace isn't generally considered part of
sscanf type input content awareness.

> > Anyone have any objection to patches adding newlines to these
> > in their original forms using sprintf/snprintf/scnprintf?
> 
> I'm not sure about existing cases, but I think it's a good
> checkpatch.pl warning for new patches. It should be 
> possible to check sysfs_emit() calls.

Eventually, yes.

cheers, Joe

  reply	other threads:[~2020-08-29 20:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-29 18:23 sysfs output without newlines Joe Perches
     [not found] ` <0f837bfb394ac632241eaac3e349b2ba806bce09.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2020-08-29 20:23   ` Denis Efremov
2020-08-29 20:33     ` Joe Perches [this message]
     [not found]       ` <b64a4cb0ee68fee01973616e5ef0f299ac191f6d.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2020-09-01  9:07         ` David Laight
2020-09-01 22:22           ` Pete Zaitcev
2020-09-02  7:57             ` Andy Shevchenko
2020-08-30  9:11 ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b64a4cb0ee68fee01973616e5ef0f299ac191f6d.camel@perches.com \
    --to=joe@perches.com \
    --cc=alex.dewar90@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bbrezillon@kernel.org \
    --cc=bp@alien8.de \
    --cc=davem@davemloft.net \
    --cc=dougmill@linux.ibm.com \
    --cc=dvhart@infradead.org \
    --cc=efremov@linux.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavoars@kernel.org \
    --cc=james.morse@arm.com \
    --cc=julia.lawall@inria.fr \
    --cc=keescook@chromium.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madalin.bucur@nxp.com \
    --cc=maximlevitsky@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=oakad@yahoo.com \
    --cc=rafael@kernel.org \
    --cc=rric@kernel.org \
    --cc=stas.yakovlev@gmail.com \
    --cc=tomas.winkler@intel.com \
    --cc=tony.luck@intel.com \
    --cc=ulf.hansson@linaro.org \
    --cc=york.sun@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox