On Tue, Nov 17, 2009 at 11:17:47AM +0100, Gerd Hoffmann wrote: > +static void scsi_req_xfer_mode(SCSIRequest *req) > +{ > + switch (req->cmd.buf[0]) {
Having this as a void seem a bit odd to me. I'd make it return the mode, and maybe just pass the cmd to it to make it more clear. > +static int is_write(SCSIGenericReq *r) > { > + switch (r->req.cmd.mode) { > + case SCSI_XFER_TO_DEV: > return 1; > + default: > + return 0; > } > } Does this helper relaly buy anything over a simple if (r->req.cmd.mode == SCSI_XFER_TO_DEV) { check?