[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] hw/usb/xen-usb.c: Pass struct usbback_req* to usbback_packet_c
Re: [RFC] hw/usb/xen-usb.c: Pass struct usbback_req* to usbback_packet_complete()
Wed, 25 Mar 2020 10:48:43 +0100
On Mon, Mar 23, 2020 at 04:43:18PM +0000, Peter Maydell wrote:
> The function usbback_packet_complete() currently takes a USBPacket*,
> which must be a pointer to the packet field within a struct
> usbback_req; the function uses container_of() to get the struct
> usbback_req* given the USBPacket*.
> This is unnecessarily confusing (and in particular it confuses the
> Coverity Scan analysis, resulting in the false positive CID 1421919
> where it thinks that we write off the end of the structure). Since
> both callsites already have the pointer to the struct usbback_req,
> just pass that in directly.
Looks sane from usb point of view.
Acked-by: Gerd Hoffmann <address@hidden>