All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Brian King <brking@us.ibm.com>
Cc: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 04/15] libata: ata_scsi_queuecmd cleanup
Date: Tue, 21 Mar 2006 20:51:44 -0500	[thread overview]
Message-ID: <4420ADB0.10904@pobox.com> (raw)
In-Reply-To: <200603172304.k2HN4LDp014215@d03av03.boulder.ibm.com>

Brian King wrote:
> Encapsulate part of ata_scsi_queuecmd so that it can be
> reused by future SAS patches.
> 
> Signed-off-by: Brian King <brking@us.ibm.com>
> ---
> 
>  libata-dev-bjking1/drivers/scsi/libata-scsi.c |   26 ++++++++++++++++----------
>  1 files changed, 16 insertions(+), 10 deletions(-)
> 
> diff -puN drivers/scsi/libata-scsi.c~libata_scsi_queuecmd drivers/scsi/libata-scsi.c
> --- libata-dev/drivers/scsi/libata-scsi.c~libata_scsi_queuecmd	2006-03-14 13:55:38.000000000 -0600
> +++ libata-dev-bjking1/drivers/scsi/libata-scsi.c	2006-03-14 13:55:38.000000000 -0600
> @@ -2565,6 +2565,21 @@ static inline void ata_scsi_dump_cdb(str
>  #endif
>  }
>  
> +static void __ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *),

static inline, please


> +				struct ata_port *ap, struct ata_device *dev)
> +{
> +	if (dev->class == ATA_DEV_ATA) {
> +		ata_xlat_func_t xlat_func = ata_get_xlat_func(dev,
> +							      cmd->cmnd[0]);
> +
> +		if (xlat_func)
> +			ata_scsi_translate(ap, dev, cmd, done, xlat_func);
> +		else
> +			ata_scsi_simulate(ap, dev, cmd, done);
> +	} else
> +		ata_scsi_translate(ap, dev, cmd, done, atapi_xlat);
> +}
> +
>  /**
>   *	ata_scsi_queuecmd - Issue SCSI cdb to libata-managed device
>   *	@cmd: SCSI command to be sent
> @@ -2605,16 +2620,7 @@ int ata_scsi_queuecmd(struct scsi_cmnd *
>  		goto out_unlock;
>  	}
>  
> -	if (dev->class == ATA_DEV_ATA) {
> -		ata_xlat_func_t xlat_func = ata_get_xlat_func(dev,
> -							      cmd->cmnd[0]);
> -
> -		if (xlat_func)
> -			ata_scsi_translate(ap, dev, cmd, done, xlat_func);
> -		else
> -			ata_scsi_simulate(ap, dev, cmd, done);
> -	} else
> -		ata_scsi_translate(ap, dev, cmd, done, atapi_xlat);
> +	__ata_scsi_queuecmd(cmd, done, ap, dev);

might as well kill the out_unlock goto target, and do something like

	if (likely(dev))
		__ata_scsi_queuecmd()
	else
		BAD TARGET


  reply	other threads:[~2006-03-22  1:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-17 23:04 [PATCH 04/15] libata: ata_scsi_queuecmd cleanup Brian King
2006-03-22  1:51 ` Jeff Garzik [this message]
2006-03-22 23:20   ` Brian King
2006-03-22 23:34     ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4420ADB0.10904@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=brking@us.ibm.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.