]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ipc: remove use of seq_printf return value
authorJoe Perches <joe@perches.com>
Wed, 15 Apr 2015 23:17:54 +0000 (16:17 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 23 Feb 2017 03:54:11 +0000 (03:54 +0000)
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: Ben Hutchings <ben@decadent.org.uk>
ipc/msg.c
ipc/sem.c
ipc/shm.c
ipc/util.c

index 02e72d3db4984f2b50e8cfea1d4f430e0ce96c92..c804e11bcbf66e58e719a9897294722f5397beb2 100644 (file)
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -1046,22 +1046,24 @@ 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
 
index fb0c4c96e50ace989e34c60566a3c63a69ed2cca..258a9327e1cfbd55ac222cff3a11099cf14df717 100644 (file)
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -2191,17 +2191,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
index 9438ab9027dcac0bdef594e1195784cb8e7e4644..471f730e8640d3e081cd52145636e526334d4a4f 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -1337,25 +1337,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
index a07ec27e1bfafd8c4bd486bb6ffc6f470c21e1ea..8085966a1d747c6e8ed0191f9f26bb491bac2754 100644 (file)
@@ -877,8 +877,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);
 }