netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kcm: remove redundant -ve error check and return path
@ 2016-07-22 18:04 Colin King
  2016-07-25 18:17 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-07-22 18:04 UTC (permalink / raw)
  To: David S . Miller, Tom Herbert, Jiri Slaby, netdev; +Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The check for a -ve error is redundant, remove it and just
immediately return the return value from the call to
seq_open_net.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/kcm/kcmproc.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/net/kcm/kcmproc.c b/net/kcm/kcmproc.c
index fda7f47..16c2e03 100644
--- a/net/kcm/kcmproc.c
+++ b/net/kcm/kcmproc.c
@@ -88,13 +88,9 @@ struct kcm_proc_mux_state {
 static int kcm_seq_open(struct inode *inode, struct file *file)
 {
 	struct kcm_seq_muxinfo *muxinfo = PDE_DATA(inode);
-	int err;
 
-	err = seq_open_net(inode, file, &muxinfo->seq_ops,
+	return seq_open_net(inode, file, &muxinfo->seq_ops,
 			   sizeof(struct kcm_proc_mux_state));
-	if (err < 0)
-		return err;
-	return err;
 }
 
 static void kcm_format_mux_header(struct seq_file *seq)
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kcm: remove redundant -ve error check and return path
  2016-07-22 18:04 [PATCH] kcm: remove redundant -ve error check and return path Colin King
@ 2016-07-25 18:17 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-07-25 18:17 UTC (permalink / raw)
  To: colin.king; +Cc: tom, jslaby, netdev, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Fri, 22 Jul 2016 19:04:12 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> The check for a -ve error is redundant, remove it and just
> immediately return the return value from the call to
> seq_open_net.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-25 18:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-22 18:04 [PATCH] kcm: remove redundant -ve error check and return path Colin King
2016-07-25 18:17 ` David Miller

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).