qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 11/15] scsi: add xfer mode


From: Christoph Hellwig
Subject: Re: [Qemu-devel] [PATCH 11/15] scsi: add xfer mode
Date: Tue, 17 Nov 2009 12:53:44 +0100
User-agent: Mutt/1.3.28i

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?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]