public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jeff Garzik <jeff@garzik.org>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] [SCSI] gdth: misc cleanups, preparation for ISA/EISA hotplug API
Date: Sat, 23 Feb 2008 23:58:10 -0500	[thread overview]
Message-ID: <20080224045810.GA17051@infradead.org> (raw)
In-Reply-To: <017ac0b5a1e36b990eedfb7124c78d58f947f076.1203828195.git.jeff@garzik.org>

On Sat, Feb 23, 2008 at 11:44:44PM -0500, Jeff Garzik wrote:
> Several misc. cleanups:
> 
> - remove recently-noop'd 'reverse_scan' module parm
> 
> - remove pointless function prototypes
> 
> - remove ha->pccb, its value always == &ha->cmdext
> 
> - move thrice-redundant DMA memory alloc and (in EISA's case, mapping)
>   into common functions gdth_ha_alloc(), gdth_ha_free()
> 
> - delete pointless zero-initializations of ha struct members, as these
>   are zeroed when ha is allocated (and never assigned any other value,
>   prior to the explicit zero initializations)
> 
> - consolidate thrice-repeated spinlock init

Good idea!

> +static void gdth_ha_free(gdth_ha_str *ha)
> +{
> +	if (ha->pscratch)
> +		pci_free_consistent(ha->pdev, GDTH_SCRATCH,
> +				    ha->pscratch, ha->scratch_phys);
> +	if (ha->pmsg)
> +		pci_free_consistent(ha->pdev, sizeof(gdth_msg_str),
> +				    ha->pmsg, ha->msg_phys);
> +
> +#ifdef INT_COAL
> +	if (ha->coal_stat)
> +		pci_free_consistent(ha->pdev,
> +				    sizeof(gdth_coal_status) * MAXOFFSETS,
> +				    ha->coal_stat, ha->coal_stat_phys);
> +#endif

Eventually we shoud just kill the INT_COAL ifdefed code.  It has never
been enabled and clutters up the driver quite badly.

> +#ifdef CONFIG_EISA
> +	if ((ha->type == GDT_EISA) && (ha->ccb_phys))
> +		pci_unmap_single(ha->pdev, ha->ccb_phys, sizeof(gdth_cmd_str),
> +				 PCI_DMA_BIDIRECTIONAL);
> +#endif /* CONFIG_EISA */

I don't think moving this into the common helper makes any sense, as
it's only ever done for the eisa adapter.  Just keep it local there.

> +#ifdef CONFIG_EISA
> +	if (ha->type == GDT_EISA) {
> +		ha->ccb_phys = pci_map_single(ha->pdev, &ha->cmdext,
> +				sizeof(gdth_cmd_str), PCI_DMA_BIDIRECTIONAL);
> +		if (!ha->ccb_phys)
> +			goto out_free;
> +	}
> +#endif /* CONFIG_EISA */

Same here.


  reply	other threads:[~2008-02-24  4:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-24  4:44 [PATCH 1/1] [SCSI] gdth: misc cleanups, preparation for ISA/EISA hotplug API Jeff Garzik
2008-02-24  4:58 ` Christoph Hellwig [this message]
2008-02-24  5:18   ` Jeff Garzik
2008-02-24  5:31     ` Christoph Hellwig
2008-02-24  5:34       ` Jeff Garzik
2008-02-24  6:37       ` Matthew Wilcox

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=20080224045810.GA17051@infradead.org \
    --to=hch@infradead.org \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox