Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753765AbbFCKaX (ORCPT ); Wed, 3 Jun 2015 06:30:23 -0400 Received: from mail-la0-f44.google.com ([209.85.215.44]:34841 "EHLO mail-la0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752126AbbFCKaQ (ORCPT ); Wed, 3 Jun 2015 06:30:16 -0400 MIME-Version: 1.0 In-Reply-To: <1433260130-1604-2-git-send-email-sergei@s15v.net> References: <1433260130-1604-2-git-send-email-sergei@s15v.net> Date: Wed, 3 Jun 2015 12:30:15 +0200 Message-ID: Subject: Re: [PATCH] kdbus: remove redundant code from kdbus_conn_entry_make() From: David Herrmann To: Sergei Zviagintsev Cc: Greg Kroah-Hartman , Daniel Mack , David Herrmann , Djalal Harouni , linux-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1638 Lines: 50 Hi On Tue, Jun 2, 2015 at 5:48 PM, Sergei Zviagintsev wrote: > We don't need to check `entry' for error, as in either case it is > returned as is. Return result of kdbus_queue_entry_new() directly. > > Signed-off-by: Sergei Zviagintsev > --- > ipc/kdbus/connection.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) Reviewed-by: David Herrmann Thanks David > diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c > index ab476fa9ccca..b00872edbbc9 100644 > --- a/ipc/kdbus/connection.c > +++ b/ipc/kdbus/connection.c > @@ -775,8 +775,6 @@ kdbus_conn_entry_make(struct kdbus_conn *conn_dst, > const struct kdbus_kmsg *kmsg, > struct kdbus_user *user) > { > - struct kdbus_queue_entry *entry; > - > /* The remote connection was disconnected */ > if (!kdbus_conn_active(conn_dst)) > return ERR_PTR(-ECONNRESET); > @@ -793,11 +791,7 @@ kdbus_conn_entry_make(struct kdbus_conn *conn_dst, > kmsg->res && kmsg->res->fds_count > 0) > return ERR_PTR(-ECOMM); > > - entry = kdbus_queue_entry_new(conn_dst, kmsg, user); > - if (IS_ERR(entry)) > - return entry; > - > - return entry; > + return kdbus_queue_entry_new(conn_dst, kmsg, user); > } > > /* > -- > 1.8.3.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/