From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9elr-0006RT-Bs for qemu-devel@nongnu.org; Tue, 12 Apr 2011 10:40:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9elo-0005Qb-Ov for qemu-devel@nongnu.org; Tue, 12 Apr 2011 10:40:47 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:54371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9elo-0005QS-Ln for qemu-devel@nongnu.org; Tue, 12 Apr 2011 10:40:44 -0400 Received: by ywl41 with SMTP id 41so3210977ywl.4 for ; Tue, 12 Apr 2011 07:40:44 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4DA46467.30208@redhat.com> Date: Tue, 12 Apr 2011 16:40:39 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <2170ea9881efc68cd2265b9df956a30eb689b8cc.1302608369.git.amit.shah@redhat.com> <4DA44F0D.2020506@redhat.com> <20110412135913.GA13631@amit-x200.redhat.com> <4DA45C9B.9040904@redhat.com> <20110412141222.GC13631@amit-x200.redhat.com> In-Reply-To: <20110412141222.GC13631@amit-x200.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 4/5] atapi: GESN: Standardise event response handling for future additions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Kevin Wolf , Stefan Hajnoczi , qemu list , Markus Armbruster , Juan Quintela On 04/12/2011 04:12 PM, Amit Shah wrote: >>>>> > >>> gesn_cdb = (void *)packet; >>>>> > >>> + gesn_event_header = (void *)packet; >>>> > >> >>>> > >> I think this should be buf, not packet. >>> > > >>> > > Ah, right. (Though they're the same.) >> > >> > Oh, you're right. I wasn't even aware of that. At some point we should >> > clean this up, it's an invitation for bugs... > It is. Actually it's surprising gcc didn't tell me that casting from > const uint8_t * to void * and then writing to the pointer is not a > good idea. Perhaps those structs should be made global and added to an atapi.h header? This way you can avoid (void *) casts. (In fact, there's a scsi.h file in the Win32 free header files waiting to be lifted in QEMU... unfortunately, the similar atapi header file has not been written yet though I think it is in the Windows DDK). Paolo