linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Joe Perches <joe@perches.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 3.12 08/72] ipc: remove use of seq_printf return value
Date: Mon,  7 Nov 2016 14:04:15 +0100	[thread overview]
Message-ID: <dbeba38c64b4918d8c33ca2fd2af6001b4f9b4d1.1478523828.git.jslaby@suse.cz> (raw)
In-Reply-To: <0f3caac741164dcff670ae0f4d1cfcb0a7026a1c.1478523828.git.jslaby@suse.cz>
In-Reply-To: <cover.1478523828.git.jslaby@suse.cz>

From: Joe Perches <joe@perches.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 7f032d6ef6154868a2a5d5f6b2c3f8587292196c upstream.

The seq_printf return value, because it's frequently misused,
will eventually be converted to void.

See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 ipc/msg.c  | 34 ++++++++++++++++++----------------
 ipc/sem.c  | 26 ++++++++++++++------------
 ipc/shm.c  | 42 ++++++++++++++++++++++--------------------
 ipc/util.c |  6 ++++--
 4 files changed, 58 insertions(+), 50 deletions(-)

diff --git a/ipc/msg.c b/ipc/msg.c
index f8c22afff450..b92acb6a138c 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -1046,21 +1046,23 @@ static int sysvipc_msg_proc_show(struct seq_file *s, void *it)
 	struct user_namespace *user_ns = seq_user_ns(s);
 	struct msg_queue *msq = it;
 
-	return seq_printf(s,
-			"%10d %10d  %4o  %10lu %10lu %5u %5u %5u %5u %5u %5u %10lu %10lu %10lu\n",
-			msq->q_perm.key,
-			msq->q_perm.id,
-			msq->q_perm.mode,
-			msq->q_cbytes,
-			msq->q_qnum,
-			msq->q_lspid,
-			msq->q_lrpid,
-			from_kuid_munged(user_ns, msq->q_perm.uid),
-			from_kgid_munged(user_ns, msq->q_perm.gid),
-			from_kuid_munged(user_ns, msq->q_perm.cuid),
-			from_kgid_munged(user_ns, msq->q_perm.cgid),
-			msq->q_stime,
-			msq->q_rtime,
-			msq->q_ctime);
+	seq_printf(s,
+		   "%10d %10d  %4o  %10lu %10lu %5u %5u %5u %5u %5u %5u %10lu %10lu %10lu\n",
+		   msq->q_perm.key,
+		   msq->q_perm.id,
+		   msq->q_perm.mode,
+		   msq->q_cbytes,
+		   msq->q_qnum,
+		   msq->q_lspid,
+		   msq->q_lrpid,
+		   from_kuid_munged(user_ns, msq->q_perm.uid),
+		   from_kgid_munged(user_ns, msq->q_perm.gid),
+		   from_kuid_munged(user_ns, msq->q_perm.cuid),
+		   from_kgid_munged(user_ns, msq->q_perm.cgid),
+		   msq->q_stime,
+		   msq->q_rtime,
+		   msq->q_ctime);
+
+	return 0;
 }
 #endif
diff --git a/ipc/sem.c b/ipc/sem.c
index 7fb486739cbb..9e963c28a214 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -2174,17 +2174,19 @@ static int sysvipc_sem_proc_show(struct seq_file *s, void *it)
 
 	sem_otime = get_semotime(sma);
 
-	return seq_printf(s,
-			  "%10d %10d  %4o %10u %5u %5u %5u %5u %10lu %10lu\n",
-			  sma->sem_perm.key,
-			  sma->sem_perm.id,
-			  sma->sem_perm.mode,
-			  sma->sem_nsems,
-			  from_kuid_munged(user_ns, sma->sem_perm.uid),
-			  from_kgid_munged(user_ns, sma->sem_perm.gid),
-			  from_kuid_munged(user_ns, sma->sem_perm.cuid),
-			  from_kgid_munged(user_ns, sma->sem_perm.cgid),
-			  sem_otime,
-			  sma->sem_ctime);
+	seq_printf(s,
+		   "%10d %10d  %4o %10u %5u %5u %5u %5u %10lu %10lu\n",
+		   sma->sem_perm.key,
+		   sma->sem_perm.id,
+		   sma->sem_perm.mode,
+		   sma->sem_nsems,
+		   from_kuid_munged(user_ns, sma->sem_perm.uid),
+		   from_kgid_munged(user_ns, sma->sem_perm.gid),
+		   from_kuid_munged(user_ns, sma->sem_perm.cuid),
+		   from_kgid_munged(user_ns, sma->sem_perm.cgid),
+		   sem_otime,
+		   sma->sem_ctime);
+
+	return 0;
 }
 #endif
diff --git a/ipc/shm.c b/ipc/shm.c
index 02f7125c8a0f..4066519acc64 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -1340,25 +1340,27 @@ static int sysvipc_shm_proc_show(struct seq_file *s, void *it)
 #define SIZE_SPEC "%21lu"
 #endif
 
-	return seq_printf(s,
-			  "%10d %10d  %4o " SIZE_SPEC " %5u %5u  "
-			  "%5lu %5u %5u %5u %5u %10lu %10lu %10lu "
-			  SIZE_SPEC " " SIZE_SPEC "\n",
-			  shp->shm_perm.key,
-			  shp->shm_perm.id,
-			  shp->shm_perm.mode,
-			  shp->shm_segsz,
-			  shp->shm_cprid,
-			  shp->shm_lprid,
-			  shp->shm_nattch,
-			  from_kuid_munged(user_ns, shp->shm_perm.uid),
-			  from_kgid_munged(user_ns, shp->shm_perm.gid),
-			  from_kuid_munged(user_ns, shp->shm_perm.cuid),
-			  from_kgid_munged(user_ns, shp->shm_perm.cgid),
-			  shp->shm_atim,
-			  shp->shm_dtim,
-			  shp->shm_ctim,
-			  rss * PAGE_SIZE,
-			  swp * PAGE_SIZE);
+	seq_printf(s,
+		   "%10d %10d  %4o " SIZE_SPEC " %5u %5u  "
+		   "%5lu %5u %5u %5u %5u %10lu %10lu %10lu "
+		   SIZE_SPEC " " SIZE_SPEC "\n",
+		   shp->shm_perm.key,
+		   shp->shm_perm.id,
+		   shp->shm_perm.mode,
+		   shp->shm_segsz,
+		   shp->shm_cprid,
+		   shp->shm_lprid,
+		   shp->shm_nattch,
+		   from_kuid_munged(user_ns, shp->shm_perm.uid),
+		   from_kgid_munged(user_ns, shp->shm_perm.gid),
+		   from_kuid_munged(user_ns, shp->shm_perm.cuid),
+		   from_kgid_munged(user_ns, shp->shm_perm.cgid),
+		   shp->shm_atim,
+		   shp->shm_dtim,
+		   shp->shm_ctim,
+		   rss * PAGE_SIZE,
+		   swp * PAGE_SIZE);
+
+	return 0;
 }
 #endif
diff --git a/ipc/util.c b/ipc/util.c
index 735342570a87..cc106890784b 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -904,8 +904,10 @@ static int sysvipc_proc_show(struct seq_file *s, void *it)
 	struct ipc_proc_iter *iter = s->private;
 	struct ipc_proc_iface *iface = iter->iface;
 
-	if (it == SEQ_START_TOKEN)
-		return seq_puts(s, iface->header);
+	if (it == SEQ_START_TOKEN) {
+		seq_puts(s, iface->header);
+		return 0;
+	}
 
 	return iface->show(s, it);
 }
-- 
2.10.2

  parent reply	other threads:[~2016-11-07 13:24 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20161107130417epcas3p4869f405f9f73d6336d5dbfd0e118b62b@epcas3p4.samsung.com>
2016-11-07 13:04 ` [PATCH 3.12 00/72] 3.12.67-stable review Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 01/72] i40e: avoid NULL pointer dereference and recursive errors on early PCI error Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 02/72] reiserfs: Unlock superblock before calling reiserfs_quota_on_mount() Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 03/72] scsi: ibmvfc: Fix I/O hang when port is not mapped Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 04/72] ext4: reinforce check of i_dtime when clearing high fields of uid and gid Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 05/72] ext4: allow DAX writeback for hole punch Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 06/72] cfq: fix starvation of asynchronous writes Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 07/72] pstore: Fix buffer overflow while write offset equal to buffer size Jiri Slaby
2016-11-07 13:04   ` Jiri Slaby [this message]
2016-11-07 13:04   ` [PATCH 3.12 09/72] gpio: mpc8xxx: Correct irq handler function Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 10/72] regulator: tps65910: Work around silicon erratum SWCZ010 Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 11/72] mmc: block: don't use CMD23 with very old MMC cards Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 12/72] pstore/core: drop cmpxchg based updates Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 13/72] pstore/ram: Use memcpy_toio instead of memcpy Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 14/72] pstore/ram: Use memcpy_fromio() to save old buffer Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 15/72] dm: mark request_queue dead before destroying the DM device Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 16/72] powerpc/vdso64: Use double word compare on pointers Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 17/72] powerpc/powernv: Use CPU-endian PEST in pnv_pci_dump_p7ioc_diag_data() Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 18/72] powerpc/64: Fix incorrect return value from __copy_tofrom_user Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 19/72] powerpc/pseries: Fix stack corruption in htpe code Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 20/72] zfcp: fix fc_host port_type with NPIV Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 21/72] zfcp: fix ELS/GS request&response length for hardware data router Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 22/72] zfcp: close window with unblocked rport during rport gone Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 23/72] zfcp: retain trace level for SCSI and HBA FSF response records Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 24/72] zfcp: restore: Dont use 0 to indicate invalid LUN in rec trace Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 25/72] zfcp: trace on request for open and close of WKA port Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 26/72] zfcp: restore tracing of handle for port and LUN with HBA records Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 27/72] zfcp: fix D_ID field with actual value on tracing SAN responses Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 28/72] zfcp: fix payload trace length for SAN request&response Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 29/72] zfcp: trace full payload of all SAN records (req,resp,iels) Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 30/72] scsi: zfcp: spin_lock_irqsave() is not nestable Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 31/72] fbdev/efifb: Fix 16 color palette entry calculation Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 32/72] mb86a20s: fix the locking logic Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 33/72] mb86a20s: fix demod settings Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 34/72] cx231xx: don't return error on success Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 35/72] cx231xx: fix GPIOs for Pixelview SBTVD hybrid Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 36/72] MIPS: ptrace: Fix regs_return_value for kernel context Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 37/72] Input: elantech - force needed quirks on Fujitsu H760 Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 38/72] Input: elantech - add Fujitsu Lifebook E556 to force crc_enabled Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 39/72] NFSv4: Open state recovery must account for file permission changes Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 40/72] scsi: Fix use-after-free Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 41/72] metag: Only define atomic_dec_if_positive conditionally Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 42/72] compiler: Allow 1- and 2-byte smp_load_acquire() and smp_store_release() Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 43/72] ipc/sem.c: fix complex_count vs. simple op race Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 44/72] arc: don't leak bits of kernel stack into coredump Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 45/72] fs/super.c: fix race between freeze_super() and thaw_super() Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 46/72] cifs: Limit the overall credit acquired Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 47/72] Clarify locking of cifs file and tcon structures and make more granular Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 48/72] Display number of credits available Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 49/72] Set previous session id correctly on SMB3 reconnect Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 50/72] SMB3: GUIDs should be constructed as random but valid uuids Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 51/72] Do not send SMB3 SET_INFO request if nothing is changing Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 52/72] net/mlx4_core: Allow resetting VF admin mac to zero Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 53/72] isofs: Do not return EACCES for unknown filesystems Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 54/72] mmc: core: Annotate cmd_hdr as __le32 Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 55/72] ubifs: Fix xattr_names length in exit paths Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 56/72] drm/radeon: narrow asic_init for virtualization Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 57/72] drm/radeon/si/dpm: fix phase shedding setup Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 58/72] drm/radeon: change vblank_time's calculation method to reduce computational error Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 59/72] mm/hugetlb: fix memory offline with hugepage size > memory block size Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 60/72] introduce NETIF_F_GSO_ENCAP_ALL helper mask Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 61/72] tunnels: Remove encapsulation offloads on decap Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 62/72] powerpc/eeh: Null check uses of eeh_pe_bus_get Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 63/72] genirq/generic_chip: Add irq_unmap callback Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 64/72] uio: fix dmem_region_start computation Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 65/72] crypto: gcm - Fix IV buffer size in crypto_gcm_setkey Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 66/72] hwrng: omap - Only fail if pm_runtime_get_sync returns < 0 Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 67/72] perf symbols: Fixup symbol sizes before picking best ones Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 68/72] powerpc/nvram: Fix an incorrect partition merge Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 69/72] Revert "fix minor infoleak in get_user_ex()" Jiri Slaby
2016-11-07 16:45     ` Linus Torvalds
2016-11-08 10:36       ` Greg KH
2016-11-07 13:30   ` [PATCH 3.12 70/72] i2c: core: fix NULL pointer dereference under race condition Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 71/72] scsi: arcmsr: Buffer overflow in arcmsr_iop_message_xfer() Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 72/72] usb: hub: change CLEAR_FEATURE to SET_FEATURE Jiri Slaby
2016-11-07 17:16   ` [PATCH 3.12 00/72] 3.12.67-stable review Guenter Roeck
2016-11-08 15:40     ` Jiri Slaby
2016-11-09  4:14       ` Guenter Roeck
2016-11-10 18:50         ` Jiri Slaby
2016-11-07 18:34   ` Shuah Khan
2016-11-10 18:51     ` Jiri Slaby

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=dbeba38c64b4918d8c33ca2fd2af6001b4f9b4d1.1478523828.git.jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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).