|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH v3 4/5] atapi: GESN: Standardise event response handling for future additions |
Date: | Tue, 12 Apr 2011 16:40:39 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |