From: Stefano Stabellini Subject: Re: [PATCH 1/2] xen: move perform_gunzip to common Date: Wed, 12 Aug 2015 17:15:23 +0100 Message-ID: References: <1439390875-21256-1-git-send-email-stefano.stabellini@eu.citrix.com> <55CB7EF3020000780009A35C@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZPYi8-0007CW-Ut for xen-devel@lists.xenproject.org; Wed, 12 Aug 2015 16:17:05 +0000 In-Reply-To: <55CB7EF3020000780009A35C@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: andrew.cooper3@citrix.com, xen-devel , Ian.Campbell@citrix.com, StefanoStabellini List-Id: xen-devel@lists.xenproject.org On Wed, 12 Aug 2015, Jan Beulich wrote: > >>> On 12.08.15 at 16:47, wrote: > > --- a/xen/common/decompress.c > > +++ b/xen/common/decompress.c > > @@ -16,6 +16,8 @@ int __init decompress(void *inbuf, unsigned int len, void *outbuf) > > (!memcmp(inbuf, "\037\213", 2) || !memcmp(inbuf, "\037\236", 2)) ) > > return gunzip(inbuf, len, NULL, NULL, outbuf, NULL, error); > > #endif > > + if (gzip_check(inbuf, len)) > > + return perform_gunzip(inbuf, len, NULL, NULL, outbuf, NULL, error); > > Afaict it would be appropriate for this to replace the #if 0 block the > end of which is seen here as context. Yes, I'll make the change. > > @@ -31,8 +33,15 @@ typedef int decompress_fn(unsigned char *inbuf, unsigned int len, > > * dependent). > > */ > > > > -decompress_fn bunzip2, unxz, unlzma, unlzo, unlz4; > > +decompress_fn perform_gunzip, bunzip2, unxz, unlzma, unlzo, unlz4; > > > > int decompress(void *inbuf, unsigned int len, void *outbuf); > > > > +static inline unsigned long output_length(char *image, unsigned long image_len) > > Neither of the callers gets moved out of bzimage.c - why does this > function need to move? We'll use it on arm. > And if it's unavoidable I'd suggest naming it > with a meaningful prefix and using the opportunity to constify the > first parameter. And while unlikely for it to not get inlined, retaining > the original __init would seem necessary to avoid build failures which > would result if this didn't get inlined. I'll do.