From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 08/24] xen/arm: Allow virq != irq Date: Fri, 27 Feb 2015 14:33:21 +0000 Message-ID: <54F08031.1070807@linaro.org> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-9-git-send-email-julien.grall@linaro.org> <1424447564.30924.322.camel@citrix.com> <54E76A2C.7030403@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YRLzC-0002l1-HE for xen-devel@lists.xenproject.org; Fri, 27 Feb 2015 14:33:50 +0000 Received: by wesu56 with SMTP id u56so20742071wes.10 for ; Fri, 27 Feb 2015 06:33:49 -0800 (PST) In-Reply-To: <54E76A2C.7030403@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org Hi Ian, On 20/02/15 17:09, Julien Grall wrote: > On 20/02/15 15:52, Ian Campbell wrote: >>> >>> action = xmalloc(struct irqaction); >>> - if (!action) >>> + if ( !action ) >>> + return -ENOMEM; >>> + >>> + info = xmalloc(struct irq_guest); >> >> FWIW you might (subject to sizing/alignment needs) be able to do >> action = _xmalloc(sizeof(struct irqaction) + sizeof(struct irq_guest); >> info = (sturct irq_guest *)(action + 1); >> >> which would save some memory overhead for free pointers etc and allow >> you to avoid manually managing the info. >> >> You probably won't like that though, so feel free to ignore. > > Actually it's a good idea :). I haven't though about it. I though about it. The pointer to irq_guest may not be correctly aligned with this solution, right? So I prefer to keep separate the allocation. We can revisit it later. Regards, -- Julien Grall