Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp5309pxk; Sat, 29 Aug 2020 13:34:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4ITCUTvrhYNi6edXu6uacAAGumI7DkZ4Zpra/AWMihuWVDCMoGuyVh5tOcqnPGUZDQrRJ X-Received: by 2002:a17:906:5f8d:: with SMTP id a13mr4843810eju.226.1598733280458; Sat, 29 Aug 2020 13:34:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598733280; cv=none; d=google.com; s=arc-20160816; b=q1+KK9sTzHZ24yasftVYbunYI3MWBq0GpRqpcfnXMn3/l2/ozqxEc2DCYw63GXsaWF m4vzehUFMJexu6RQkslJC68JZDBbtjZZ3W4Lytlq1Z9LohZxrBMbgDZvbrPiNs2zXcuB xm5ozqtgGqOkUBZVaWLGdfC12fD8uYKLO1IgvKuT8fIgwCOzB1YUWRUqUaHYCR3xc+iL dApu/yvhOAdKrCkDd2hpHeyTDCK2t9LnmwApY6I4PKcZ/etPqxMwfKs1GFbJRMjZqWtU mr7vRSspvaPhhWrZ4NZ7XMVXapjtqZ4mM+ndjwsR9Radj1fE5pZe6nVAwvzqA+SsODUc Q8oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=hdgbvezZpd7kAe6iya/QhaeZALA4G60VuFre2Txh2c4=; b=wyJF/36enjaPDnQd9l/hGYfuvm+NAF6vYiffy4xhnasb3w8tp19gu9grjkMdV+Vif3 +q+OLZJSbQNliNG9ublItjxPboeaRbzIQEd91AwGfUUy95Nza4WNku8b/V6PIQhvC6ik jtohFQzWRtoE8GnbyMDaYgQqacYsQrtP4DH97TMYZSlzTjO6nB4jtXhmjEYSFP5A64bG ldZpaY79SN1r91+FmEPGqwsZAT9D7NyylOrKIGtGDngoEsKKnWVdUQpTrs0VoQiVNcMa IOHaoHgoZVuiptNRCHlJXyj74Y0mrDobTamGCFWhQSlG0b64kXl7X/sVx+y2SusO/7hq 5dew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 v19si2091154edx.39.2020.08.29.13.34.14; Sat, 29 Aug 2020 13:34:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728539AbgH2UeH (ORCPT + 99 others); Sat, 29 Aug 2020 16:34:07 -0400 Received: from smtprelay0042.hostedemail.com ([216.40.44.42]:60978 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728464AbgH2UeF (ORCPT ); Sat, 29 Aug 2020 16:34:05 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 4AD2918225DF6; Sat, 29 Aug 2020 20:34:03 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2110:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3870:3871:3872:3874:4184:4321:5007:6691:6742:6743:10004:10400:10848:11232:11658:11914:12048:12297:12663:12740:12760:12895:13069:13311:13357:13439:14180:14181:14659:14721:21060:21080:21433:21627:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: head85_181739b27081 X-Filterd-Recvd-Size: 3499 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA; Sat, 29 Aug 2020 20:33:57 +0000 (UTC) Message-ID: Subject: Re: sysfs output without newlines From: Joe Perches To: Denis Efremov , LKML , Greg Kroah-Hartman , "Rafael J. Wysocki" , Kees Cook , "Gustavo A . R . Silva" , Julia Lawall , Alex Dewar Cc: York Sun , Borislav Petkov , Mauro Carvalho Chehab , Tony Luck , James Morse , Robert Richter , Michal Simek , Boris Brezillon , Maxim Levitsky , Alex Dubov , Ulf Hansson , Tomas Winkler , Arnd Bergmann , Madalin Bucur , "David S. Miller" , Jakub Kicinski , Douglas Miller , Stanislav Yakovlev , Kalle Valo , Darren Hart , Andy Shevchenko , Kai =?ISO-8859-1?Q?M=E4kisara?= , "James E.J. Bottomley" , "Martin K. Petersen" , Mark Brown , Oliver Neukum , Pete Zaitcev , linux-edac@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-i3c@lists.infradead.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-scsi@vger.kernel.org, linux-spi@vger.kernel.org, linux-usb@vger.kernel.org Date: Sat, 29 Aug 2020 13:33:56 -0700 In-Reply-To: <4cd6275c-6e95-3aeb-9924-141f62e00449@linux.com> References: <0f837bfb394ac632241eaac3e349b2ba806bce09.camel@perches.com> <4cd6275c-6e95-3aeb-9924-141f62e00449@linux.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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