From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oren Laadan Subject: Re: [PATCH] [RFC] Factor out shared portion of [_]ckpt_read_obj Date: Wed, 28 Oct 2009 21:03:21 -0400 Message-ID: <4AE8E9D9.5010304@librato.com> References: <1256710435-3266-1-git-send-email-matthltc@us.ibm.com> <20091028203504.GA26291@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20091028203504.GA26291-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: "Serge E. Hallyn" Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: containers.vger.kernel.org Serge E. Hallyn wrote: > Quoting Matt Helsley (matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org): >> It looked like a portion of one of these functions was missing >> the block "dispatching" errors so I factored this section out >> and called it from both functions. Was there a good reason it >> was missing? >> >> Signed-off-by: Matt Helsley > > Good catch, but wouldn't it be better to instead factor the code > from label again: up to > > /* if len specified, enforce, else if maximum specified, enforce */ > if ((len && h->len != len) || (!len && max && h->len > max)) > return -EINVAL; > > out of both into one function? This feels more artificial, and I don't > see any other meaningful differences. > Yes, I'll do just that. (Thanks for the fix, Matt). Oren.