linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: LKML <linux-kernel@vger.kernel.org>,
	Denis Efremov <efremov@linux.com>,
	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>,
	"Andy Shevchenko" <andy@infradead.org>,
	"Kai Mäkisara" <Kai.Makisara@kolumbus.fi>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Oliver Neukum" <oneukum@suse.com>,
	"Pete Zaitcev" <zaitcev@redhat.com>,
	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
Subject: sysfs output without newlines
Date: Sat, 29 Aug 2020 11:23:43 -0700	[thread overview]
Message-ID: <0f837bfb394ac632241eaac3e349b2ba806bce09.camel@perches.com> (raw)

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.

Anyone have any objection to patches adding newlines to these
in their original forms using sprintf/snprintf/scnprintf?

A few of these might be false positives as
	"%s", string
might already have string with a newline termination.

+++ drivers/edac/fsl_ddr_edac.c
+	return sysfs_emit(data, "0x%08x",
+	return sysfs_emit(data, "0x%08x",
+	return sysfs_emit(data, "0x%08x",
+++ drivers/edac/synopsys_edac.c
+	return sysfs_emit(data, "Data Poisoning: %s\n\r",
+		return sysfs_emit(buf, "1");
+		return sysfs_emit(buf, "0");
+		return sysfs_emit(buf, "1");
+		return sysfs_emit(buf, "0");
+		return sysfs_emit(buf, "0");
+		return sysfs_emit(buf, "1");
+		return sysfs_emit(buf, "0");
+	return sysfs_emit(buf, "%u", !!(data->status & mask));
+	return sysfs_emit(buf, "%u", data->tcrit2[index] * 1000);
+	return sysfs_emit(buf, "%d",
+	return sysfs_emit(buf, "%u", data->tcrit1[index] * 1000);
+	return sysfs_emit(buf, "%d",
+	return sysfs_emit(buf, "%d", data->toffset[index] * 500);
+++ drivers/i3c/master.c
+		return sysfs_emit(buf, "i3c:dcr%02Xmanuf%04X", devinfo.dcr,
+	return sysfs_emit(buf, "i3c:dcr%02Xmanuf%04Xpart%04Xext%04X",
+	return sysfs_emit(buf, "%s", dd->boardversion);
+	return sysfs_emit(buf, "%s", dd->serial);
+	return sysfs_emit(buf, "%s", (char *)ib_qib_version);
+	return sysfs_emit(buf, "%s", dd->boardversion);
+	return sysfs_emit(buf, "%s", dd->lbus_info);
+	return sysfs_emit(buf, "ipac:f%02Xv%08Xd%08X", idev->id_format,
+++ drivers/memstick/core/mspro_block.c
+	return sysfs_emit(buffer, "%s", (char *)s_attr->data);
+	return sysfs_emit(buf, "%s",
+	return sysfs_emit(buf, "%s",
+++ drivers/misc/mei/bus.c
+	return sysfs_emit(buf, "%s", cldev->name);
+	return sysfs_emit(buf, "%pUl", uuid);
+	return sysfs_emit(buf, "%02X", version);
+	return sysfs_emit(buf, "mei:%s:%pUl:%02X:",
+	return sysfs_emit(buf, "%d", maxconn);
+	return sysfs_emit(buf, "%d", fixed);
+	return sysfs_emit(buf, "%d", vt);
+	return sysfs_emit(buf, "%u", maxlen);
+	return sysfs_emit(buf, "%s", mei_dev_state_str(dev_state));
+++ drivers/misc/tifm_core.c
+	return sysfs_emit(buf, "%x", sock->type);
+			return sysfs_emit(buf, "%s",
+	return sysfs_emit(buf, "%d", dev->net_count);
+++ drivers/net/ethernet/freescale/dpaa/dpaa_eth_sysfs.c
+		return sysfs_emit(buf, "%llx",
+		return sysfs_emit(buf, "none");
+++ drivers/net/ethernet/ibm/ehea/ehea_main.c
+	return sysfs_emit(buf, "%d", port->logical_port_id);
+++ drivers/net/wireless/intel/ipw2x00/ipw2200.c
+		return sysfs_emit(buf, "%s", priv->prom_net_dev->name);
+	return sysfs_emit(buf, "0x%04X",
+	return sysfs_emit(buf, "%d", il->retry_rate);
+	return sysfs_emit(buf, "%pOF", np);
+	return sysfs_emit(buf, "pcmcia:m%04Xc%04Xf%02Xfn%02Xpfn%02X"
+++ drivers/platform/x86/dell-smbios-base.c
+		return sysfs_emit(buf, "%08x", da_tokens[i].location);
+		return sysfs_emit(buf, "%08x", da_tokens[i].value);
+	return sysfs_emit(buf, "%08x",
+++ drivers/scsi/st.c
+	return sysfs_emit(buf, "%lld",
+	return sysfs_emit(buf, "%lld",
+	return sysfs_emit(buf, "%lld",
+	return sysfs_emit(buf, "%lld",
+	return sysfs_emit(buf, "%lld",
+	return sysfs_emit(buf, "%lld",
+	return sysfs_emit(buf, "%lld",
+	return sysfs_emit(buf, "%lld",
+	return sysfs_emit(buf, "%lld",
+	return sysfs_emit(buf, "%lld",
+++ drivers/spi/spi-tle62x0.c
+	return sysfs_emit(buf, "%d", value);
+++ drivers/usb/class/cdc-acm.c
+	return sysfs_emit(buf, "%d", acm->ctrl_caps);
+	return sysfs_emit(buf, "%d", acm->country_rel_date);
+++ drivers/usb/class/usblp.c
+	return sysfs_emit(buf, "%s", usblp->device_id_string+2);
+	return sysfs_emit(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02X"
+++ drivers/usb/misc/cytherm.c
+	return sysfs_emit(buf, "%i", cytherm->brightness);
+	return sysfs_emit(buf, "%c%i.%i", sign ? '-' : '+', temp >> 1,
+		return sysfs_emit(buf, "1");
+		return sysfs_emit(buf, "0");
+	return sysfs_emit(buf, "%d", retval);
+	return sysfs_emit(buf, "%d", retval);



             reply	other threads:[~2020-08-29 18:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-29 18:23 Joe Perches [this message]
2020-08-29 20:23 ` sysfs output without newlines Denis Efremov
2020-08-29 20:33   ` Joe Perches
2020-09-01  9:07     ` David Laight
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=0f837bfb394ac632241eaac3e349b2ba806bce09.camel@perches.com \
    --to=joe@perches.com \
    --cc=Kai.Makisara@kolumbus.fi \
    --cc=alex.dewar90@gmail.com \
    --cc=andy@infradead.org \
    --cc=arnd@arndb.de \
    --cc=bbrezillon@kernel.org \
    --cc=bp@alien8.de \
    --cc=broonie@kernel.org \
    --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=jejb@linux.ibm.com \
    --cc=julia.lawall@inria.fr \
    --cc=keescook@chromium.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=madalin.bucur@nxp.com \
    --cc=martin.petersen@oracle.com \
    --cc=maximlevitsky@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=oakad@yahoo.com \
    --cc=oneukum@suse.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --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 \
    --cc=zaitcev@redhat.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;
as well as URLs for NNTP newsgroup(s).