cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Guoqing Jiang <gqJiang@suse.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] dlm: remove unnecessary error check
Date: Thu, 11 Jun 2015 10:39:16 +0800	[thread overview]
Message-ID: <5578F4D4.2080308@suse.com> (raw)
In-Reply-To: <510231821.14079509.1433939161255.JavaMail.zimbra@redhat.com>

Bob Peterson wrote:
>
>>>>     
>>>>         
>>>>> ----- Original Message -----
>>>>>   
>>>>>       
>>>>>           
>>>>>> We don't need the redundant logic since send_message always returns 0.
>>>>>>
>>>>>> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
>>>>>> ---
>>>>>>  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.
>
>   
Hi Bob,

Got it, thanks. It is a better solution but it is not a bug fix or
similar thing, so maybe just leave it as it is.

Regards,
Guoqing




  reply	other threads:[~2015-06-11  2:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-09  9:46 [Cluster-devel] [PATCH] dlm: remove unnecessary error check Guoqing Jiang
2015-06-09 12:09 ` Bob Peterson
2015-06-10  2:39   ` Guoqing Jiang
2015-06-10  2:50     ` Bob Peterson
2015-06-10  3:10       ` Guoqing Jiang
2015-06-10 12:26         ` Bob Peterson
2015-06-11  2:39           ` Guoqing Jiang [this message]
2015-06-10 15:24         ` David Teigland
2015-06-11  9:47           ` Guoqing Jiang
2015-06-11 16:18             ` David Teigland
2015-06-17  2:14               ` Guoqing Jiang

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=5578F4D4.2080308@suse.com \
    --to=gqjiang@suse.com \
    /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).