From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBDRL-0004Bq-MM for qemu-devel@nongnu.org; Thu, 19 Nov 2009 15:17:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBDRK-0004BQ-K2 for qemu-devel@nongnu.org; Thu, 19 Nov 2009 15:17:14 -0500 Received: from [199.232.76.173] (port=34090 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBDRK-0004BM-FS for qemu-devel@nongnu.org; Thu, 19 Nov 2009 15:17:14 -0500 Received: from bhuna.collabora.co.uk ([93.93.128.226]:53568) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NBDRK-0001yT-4w for qemu-devel@nongnu.org; Thu, 19 Nov 2009 15:17:14 -0500 Message-ID: <4B05A7A7.2000302@collabora.co.uk> Date: Thu, 19 Nov 2009 20:16:39 +0000 From: Ian Molton MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] e1000: Fix warning from code review References: <200911191311.56137.sgrubb@redhat.com> <1258656295-5688-1-git-send-email-weil@mail.berlios.de> In-Reply-To: <1258656295-5688-1-git-send-email-weil@mail.berlios.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: kwolf@redhat.com, sgrubb@redhat.com, QEMU Developers Stefan Weil wrote: > A code review run by Steve Grubb complained about code in e1000.c: > > In hw/e1000.c at line 89, vlan is declared to be 4 bytes. > At line 382 is an attempt to do a memmove over it with a size of 12. > + /* Fields vlan and data must not be reordered or separated. */ > unsigned char vlan[4]; > unsigned char data[0x10000]; Wouldnt it be better to stuff both into a struct or something? I guess from the '12' that the data size can vary, but thats less important if they are packed in a way that the compiler (and coders!) know not to seperate them. -Ian