From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYz2e-00062h-Pe for qemu-devel@nongnu.org; Sun, 05 May 2013 09:31:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYz2d-0007d0-Rk for qemu-devel@nongnu.org; Sun, 05 May 2013 09:31:52 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41608 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYz2d-0007cu-M5 for qemu-devel@nongnu.org; Sun, 05 May 2013 09:31:51 -0400 Message-ID: <51865F40.2060609@suse.de> Date: Sun, 05 May 2013 15:31:44 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <6476d358d7f54aa7db6b7dc435d010bc83b2e806.1367676178.git.jcd@tribudubois.net> <51865B2A.4030101@tribudubois.net> In-Reply-To: <51865B2A.4030101@tribudubois.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 1/4] Add i.MX FEC Ethernet driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jean-Christophe DUBOIS , Peter Crosthwaite Cc: peter.maydell@linaro.org, peter.chubb@nicta.com.au, qemu-devel@nongnu.org Am 05.05.2013 15:14, schrieb Jean-Christophe DUBOIS: > On 05/05/2013 05:11 AM, Peter Crosthwaite wrote: >> Hi JC, >> >> On Sun, May 5, 2013 at 12:09 AM, Jean-Christophe DUBOIS >> wrote: >>> This is based on the mcf_fec.c FEC implementation for ColdFire. Note that ColdFire is one of the least maintained targets in QEMU... >>> +static int imx_fec_can_receive(NetClientState *nc) >>> +{ >>> + imx_fec_state *s =3D qemu_get_nic_opaque(nc); >>> + >> Andreas, do we care about QOM casts coming from random void* opaques? Generally no. If we ever switch to C++ or some other OO language we'll have to touch casts anyway. Peter, please note that I usually don't have time to read through all patches - noticed this inline question incidentally only. > OK, I am going to do a QOM cast anyway. You should check how frequently this function is called - the current OBJECT_CHECK() implementation does at least one string comparison, so I'd suggest to avoid it here. That is, if the type passed in as opaque matches the type assigned here (thinking of interfaces). >>> + return s->rx_enabled; >>> +} [snip] Not knowing this piece of hardware, might it make sense to call it "imx-fec" when there's another FEC for ColdFire? Or are they the same thing and should be unified? Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg