Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754204AbbFJM0T (ORCPT ); Wed, 10 Jun 2015 08:26:19 -0400 Received: from mx6-phx2.redhat.com ([209.132.183.39]:48739 "EHLO mx6-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754176AbbFJM0F (ORCPT ); Wed, 10 Jun 2015 08:26:05 -0400 Date: Wed, 10 Jun 2015 08:26:01 -0400 (EDT) From: Bob Peterson To: Guoqing Jiang Cc: ccaulfie@redhat.com, teigland@redhat.com, cluster-devel@redhat.com, linux-kernel@vger.kernel.org Message-ID: <510231821.14079509.1433939161255.JavaMail.zimbra@redhat.com> In-Reply-To: <5577AAB4.20700@suse.com> References: <1433843172-8953-1-git-send-email-gqjiang@suse.com> <1545280635.13245793.1433851749238.JavaMail.zimbra@redhat.com> <5577A36D.5010908@suse.com> <70321158.13952725.1433904643714.JavaMail.zimbra@redhat.com> <5577AAB4.20700@suse.com> Subject: Re: [Cluster-devel] [PATCH] dlm: remove unnecessary error check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.3.113.34] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF38 (Linux)/8.0.6_GA_5922) Thread-Topic: remove unnecessary error check Thread-Index: it0VFn1PL5nFwqU+577x/AbNpABKBA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1733 Lines: 63 ----- Original Message ----- > Bob Peterson wrote: > > ----- Original Message ----- > > > >> Hi Bob, > >> > >> Bob Peterson wrote: > >> > >>> ----- Original Message ----- > >>> > >>> > >>>> We don't need the redundant logic since send_message always returns 0. > >>>> > >>>> Signed-off-by: Guoqing Jiang > >>>> --- > >>>> fs/dlm/lock.c | 10 ++-------- > >>>> 1 file changed, 2 insertions(+), 8 deletions(-) > >>>> > >>>> diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c > >>>> index 35502d4..6fc3de9 100644 > >>>> --- a/fs/dlm/lock.c > >>>> +++ b/fs/dlm/lock.c > >>>> @@ -3656,10 +3656,7 @@ static int send_common(struct dlm_rsb *r, struct > >>>> dlm_lkb *lkb, int mstype) > >>>> > >>>> send_args(r, lkb, ms); > >>>> > >>>> - error = send_message(mh, ms); > >>>> - if (error) > >>>> - goto fail; > >>>> - return 0; > >>>> + return send_message(mh, ms); Hi Guoqing, Sorry, I was momentarily confused. I think you misunderstood what I was saying. What I meant was: Instead of doing: + return send_message(mh, ms); ...where send_message returns 0, it might be better to have: static void send_message(struct dlm_mhandle *mh, struct dlm_message *ms) { dlm_message_out(ms); dlm_lowcomms_commit_buffer(mh); } ...And in send_common, do (in both places): + send_message(mh, ms); + return 0; Since it's so short, it might even be better to code send_message as a macro, or at least an "inline" function. Regards, Bob Peterson Red Hat File Systems -- 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/