Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1162970

Re: [Cluster-devel] [PATCH] dlm: remove unnecessary error check

From Guoqing Jiang <gqJiang@suse.com>
Newsgroups linux.kernel
Subject Re: [Cluster-devel] [PATCH] dlm: remove unnecessary error check
Date 2015-06-11 04:50 +0200
Message-ID <pA0J4-AO-9@gated-at.bofh.it> (permalink)
References (1 earlier) <pzqvU-682-29@gated-at.bofh.it> <pzEfw-10X-13@gated-at.bofh.it> <pzEpb-1dn-5@gated-at.bofh.it> <pzEIx-1Sc-3@gated-at.bofh.it> <pzNiN-65G-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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


--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [Cluster-devel] [PATCH] dlm: remove unnecessary error check Guoqing Jiang <gqJiang@suse.com> - 2015-06-10 04:50 +0200
  Re: [Cluster-devel] [PATCH] dlm: remove unnecessary error check Bob Peterson <rpeterso@redhat.com> - 2015-06-10 05:00 +0200
    Re: [Cluster-devel] [PATCH] dlm: remove unnecessary error check Guoqing Jiang <gqJiang@suse.com> - 2015-06-11 04:50 +0200
    Re: [Cluster-devel] [PATCH] dlm: remove unnecessary error check Guoqing Jiang <gqJiang@suse.com> - 2015-06-11 12:00 +0200

csiph-web