From: Jeff Garzik <jeff@garzik.org>
To: Christoph Hellwig <hch@lst.de>
Cc: leubner@adaptec.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 6/7] gdth: clean up host private data
Date: Sat, 21 Jul 2007 16:14:40 -0400 [thread overview]
Message-ID: <46A26930.1030208@garzik.org> (raw)
In-Reply-To: <20070721170209.GG4150@lst.de>
Christoph Hellwig wrote:
> Get rid of all the indirection in the Scsi_Host private data and always
> but the gdth_ha_str directly into it.
>
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> @@ -678,7 +676,7 @@ static char *gdth_ioctl_alloc(int hanum,
> if (size == 0)
> return NULL;
>
> - ha = HADATA(gdth_ctr_tab[hanum]);
> + ha = shost_priv(gdth_ctr_tab[hanum]);
> spin_lock_irqsave(&ha->smp_lock, flags);
>
> if (!ha->scratch_busy && size <= GDTH_SCRATCH) {
> @@ -703,7 +701,7 @@ static void gdth_ioctl_free(int hanum, i
> gdth_ha_str *ha;
> ulong flags;
>
> - ha = HADATA(gdth_ctr_tab[hanum]);
> + ha = shost_priv(gdth_ctr_tab[hanum]);
> spin_lock_irqsave(&ha->smp_lock, flags);
>
> if (buf == ha->pscratch) {
Major problem with this patch: it still directly references statically
sized gdth_ctr_tab[].
This patch should be rewritten to apply on top of "gdth: Isolate
driver-global variables using helpers". That patch has the clear
advantage of isolating the direct references to gdth_ctr_tab[], which
means that it can be trivially replaced with a dynamically-sized
implementation in a later cleanup, without affecting the code or procfs
output at all.
IOW, the "ha from hanum" common operation should clearly have a wrapper.
Once that is complete, your patch here shrinks, since you merely have to
update gdth_find_ha() once rather than each codesite.
Jeff
P.S. Are you sure you got achim's email correct? I was using
achim_leubner@adaptec.com since that it what is in gdth.c and his most
recent Acked-by entry in the kernel changelog.
prev parent reply other threads:[~2007-07-21 20:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-21 17:02 [PATCH 6/7] gdth: clean up host private data Christoph Hellwig
2007-07-21 20:14 ` Jeff Garzik [this message]
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=46A26930.1030208@garzik.org \
--to=jeff@garzik.org \
--cc=hch@lst.de \
--cc=leubner@adaptec.com \
--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.