From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYxkf-0003Bg-R9 for qemu-devel@nongnu.org; Thu, 25 Feb 2016 10:22:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYxkb-0004mq-Pi for qemu-devel@nongnu.org; Thu, 25 Feb 2016 10:22:49 -0500 Received: from mail-vk0-x22f.google.com ([2607:f8b0:400c:c05::22f]:35233) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYxkb-0004ml-J2 for qemu-devel@nongnu.org; Thu, 25 Feb 2016 10:22:45 -0500 Received: by mail-vk0-x22f.google.com with SMTP id e6so50267159vkh.2 for ; Thu, 25 Feb 2016 07:22:45 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1456176561-31808-1-git-send-email-samuel.thibault@ens-lyon.org> References: <1456176561-31808-1-git-send-email-samuel.thibault@ens-lyon.org> From: Peter Maydell Date: Thu, 25 Feb 2016 15:22:25 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] Avoid embedding struct mbuf in other structures List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Samuel Thibault Cc: Jan Kiszka , Jason Wang , QEMU Developers On 22 February 2016 at 21:29, Samuel Thibault wrote: > struct mbuf uses a C99 open char array to allow inlining data. At the moment it doesn't, it uses a 1 byte array :-) Turning that into a C99 flexible array is what we'd like to do... > Inlining > this in another structure is however a GNU extension. The inlines used > so far in struct Slirp were actually only needed as head of struct > mbuf lists. This replaces these inline with mere struct quehead, > and use casts as appropriate. > > Signed-off-by: Samuel Thibault > --- > slirp/if.c | 27 ++++++++++++++------------- > slirp/mbuf.c | 19 ++++++++++--------- > slirp/misc.c | 5 ----- > slirp/misc.h | 5 +++++ > slirp/slirp.h | 8 +++++--- > 5 files changed, 34 insertions(+), 30 deletions(-) It's a slight shame that we end up having to have the extra casts, but I guess it can't be helped. Converting the code to use one of the qemu/queue.h data structures doesn't seem worth the effort and risk of introducing bugs. (Does this pass checkpatch.pl? I wasn't sure about the spacing round some of the casts...) Reviewed-by: Peter Maydell thanks -- PMM