Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753205AbbD0ToU (ORCPT ); Mon, 27 Apr 2015 15:44:20 -0400 Received: from mailsec118.isp.belgacom.be ([195.238.20.114]:30970 "EHLO mailsec118.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753135AbbD0ToS convert rfc822-to-8bit (ORCPT ); Mon, 27 Apr 2015 15:44:18 -0400 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=yz6z4UlqfYe1Iv9USMliYggvHmbgQ4ACOrhY3D/q6Wc= c=1 sm=2 a=IkcTkHD0fZMA:10 a=3_z-I4w9tX2eNihiKHkA:9 a=QEXdDO2ut3YA:10 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BwBgChkD5V/9MU7sNcDoJ+gS+DGrE4AQEBAQEGmUECgTQ8EAEBAQEBAQGBCoQgAQEBAwEjVgULBQQCDgoCAhgOAgJXBhMRiBIMlludBIZRjTIBAQgCAR+BIYR1hSKEUjMHgmiBRQWGQqstI2CBJxyBFD88MYJEAQEB Date: Mon, 27 Apr 2015 21:44:17 +0200 (CEST) From: Fabian Frederick Reply-To: Fabian Frederick To: Jan Harkes Cc: Andrew Morton , linux-kernel@vger.kernel.org, coda@cs.cmu.edu Message-ID: <1968339126.396459.1430163857647.open-xchange@webmail.nmp.proximus.be> In-Reply-To: <20150427183744.GA5147@cs.cmu.edu> References: <1430155386-6678-1-git-send-email-fabf@skynet.be> <20150427183744.GA5147@cs.cmu.edu> Subject: Re: [PATCH 1/1 linux-next] fs/coda/upcall.c: remove UPARG flow control macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.2.2-Rev27 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2324 Lines: 71 > On 27 April 2015 at 20:37 Jan Harkes wrote: > > > On Mon, Apr 27, 2015 at 07:23:06PM +0200, Fabian Frederick wrote: > > Move UPARG code to alloc_upcall() and test errors/return in callsites. > > This patch removes flow control in macros which must be avoided. > > (See Documentation/CodingStyle) > > At first glance this is not a correct patch. > > UPARG allocates a buffer that is large enough to hold both the upcall > message going to userspace as well as the incoming reply message. At > first glance this patch only seems to allocate insize. It may still be > doing the right thing because insize is defined at the call level as > MAX(sizeof(inarg), sizeof(outarg)). This it looks like quite a few > changes for an untested patch and not enough for an actual cleanup of > the related code. > > Jan Sorry Jan but I don't see any problem in that patch. outarg is processed the same way: New alloc_upcall(**inp, **outp): *outp = (union outputArgs *)inp; *outsize = insize; UPARG macro: outp = (union outputArgs *)(inp); \ outsize = insize; \ Regards, Fabian > > > --- > > This is untested. > > > >  fs/coda/upcall.c | 107 > >+++++++++++++++++++++++++++++++++++-------------------- > >  1 file changed, 69 insertions(+), 38 deletions(-) > > > > diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c > > index 9b1ffaa..7524f630 100644 > > --- a/fs/coda/upcall.c > > +++ b/fs/coda/upcall.c > > @@ -41,30 +41,24 @@ > >  static int coda_upcall(struct venus_comm *vc, int inSize, int *outSize, > >                    union inputArgs *buffer); > >  > > -static void *alloc_upcall(int opcode, int size) > > +static int alloc_upcall(int opcode, int insize, int *outsize, > > +                   union inputArgs **inp, union outputArgs **outp) > >  { > > -   union inputArgs *inp; > > +   CODA_ALLOC(*inp, union inputArgs *, insize); > > +   if (!*inp) > > +           return -ENOMEM; > >  > > -   CODA_ALLOC(inp, union inputArgs *, size); > > -        if (!inp) > > -           return ERR_PTR(-ENOMEM); > ... -- 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/