From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wo5ax-0002ZV-Em for qemu-devel@nongnu.org; Sat, 24 May 2014 02:38:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wo5ar-0001KK-AD for qemu-devel@nongnu.org; Sat, 24 May 2014 02:38:15 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:51419) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wo5ar-0001K6-2W for qemu-devel@nongnu.org; Sat, 24 May 2014 02:38:09 -0400 Message-ID: <53803E4E.8010108@msgid.tls.msk.ru> Date: Sat, 24 May 2014 10:38:06 +0400 From: Michael Tokarev MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [net, v1, 1/4] net: cadence_gem: Fix Tx descriptor update List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: edgar.iglesias@xilinx.com, Peter Maydell , qemu-devel , Stefan Hajnoczi [...] if (tx_desc_get_last(desc)) { + unsigned desc_first[2]; + /* Modify the 1st descriptor of this packet to be owned by * the processor. */ cpu_physical_memory_read(s->tx_desc_addr, - (uint8_t *)&desc[0], sizeof(desc)); - tx_desc_set_used(desc); + (uint8_t *)&desc_first[0], sizeof(desc)); + tx_desc_set_used(desc_first); cpu_physical_memory_write(s->tx_desc_addr, - (uint8_t *)&desc[0], sizeof(desc)); + (uint8_t *)&desc_first[0], sizeof(desc)); /* Advance the hardare current descriptor past this packet */ This is quite fun. Can we, please, a) s/unsigned/uint8_t/ in the variable declaration, and remove the useless casts and "readdressing" everywhere? and, more interesting, b) s/sizeof(desc)/sizeof(desc_first)/g ? :) Thanks, /mjt