From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: FUJITA Tomonori <tomof@acm.org>
Cc: linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org,
Jens.Axboe@oracle.com, fujita.tomonori@lab.ntt.co.jp,
jeff@garzik.org
Subject: Re: [PATCH] libata: eliminate the home grown dma padding in favour of that provided by the block layer
Date: Thu, 03 Jan 2008 09:12:31 -0600 [thread overview]
Message-ID: <1199373151.3122.3.camel@localhost.localdomain> (raw)
In-Reply-To: <20080103170148K.tomof@acm.org>
On Thu, 2008-01-03 at 16:58 +0900, FUJITA Tomonori wrote:
> On Mon, 31 Dec 2007 15:56:08 -0600
> James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
> > @@ -1080,24 +1073,15 @@ extern void ata_port_pbar_desc(struct ata_port *ap, int bar, ssize_t offset,
> > static inline struct scatterlist *
> > ata_qc_first_sg(struct ata_queued_cmd *qc)
> > {
> > - qc->n_iter = 0;
> > if (qc->n_elem)
> > return qc->__sg;
> > - if (qc->pad_len)
> > - return &qc->pad_sgent;
> > return NULL;
> > }
> >
> > static inline struct scatterlist *
> > ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc)
> > {
> > - if (sg == &qc->pad_sgent)
> > - return NULL;
> > - if (++qc->n_iter < qc->n_elem)
> > - return sg_next(sg);
> > - if (qc->pad_len)
> > - return &qc->pad_sgent;
> > - return NULL;
> > + return sg_next(sg);
> > }
> >
> > #define ata_for_each_sg(sg, qc) \
>
> How about removing ata_qc_first_sg and ata_qc_next_sg completely?
>
> Now we can just replace ata_qc_next_sg with sg_next. qc->__sg seems to
> be always initialized to NULL so we can remove ata_qc_first_sg too.
Sure ... I assumed (without actually looking) that the inlines were
there because they were an API used throughout the drivers. Actually,
grep tells me they're only used in the ata_for_each_sg macro, so this
patch looks good.
Thanks,
James
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index 4f6404c..2774882 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -1054,25 +1054,8 @@ extern void ata_port_pbar_desc(struct ata_port *ap, int bar, ssize_t offset,
> const char *name);
> #endif
>
> -/*
> - * qc helpers
> - */
> -static inline struct scatterlist *
> -ata_qc_first_sg(struct ata_queued_cmd *qc)
> -{
> - if (qc->n_elem)
> - return qc->__sg;
> - return NULL;
> -}
> -
> -static inline struct scatterlist *
> -ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc)
> -{
> - return sg_next(sg);
> -}
> -
> #define ata_for_each_sg(sg, qc) \
> - for (sg = ata_qc_first_sg(qc); sg; sg = ata_qc_next_sg(sg, qc))
> + for (sg = qc->__sg; sg; sg = sg_next(sg))
>
> static inline unsigned int ata_tag_valid(unsigned int tag)
> {
> -
> To unsubscribe from this list: send the line "unsubscribe linux-ide" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2008-01-03 15:12 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-31 21:56 [PATCH] libata: eliminate the home grown dma padding in favour of that provided by the block layer James Bottomley
2007-12-31 22:56 ` Jeff Garzik
2008-01-03 7:58 ` FUJITA Tomonori
2008-01-03 15:12 ` James Bottomley [this message]
2008-01-09 2:10 ` Tejun Heo
2008-01-09 4:24 ` James Bottomley
2008-01-09 5:13 ` Tejun Heo
2008-01-09 15:13 ` James Bottomley
2008-01-18 23:14 ` [PATCH RESEND] " James Bottomley
2008-02-01 19:40 ` [PATCH RESEND number 2] " James Bottomley
2008-02-01 20:02 ` Jeff Garzik
2008-02-01 21:09 ` James Bottomley
2008-02-03 3:04 ` Tejun Heo
2008-02-03 4:32 ` James Bottomley
2008-02-03 7:37 ` Tejun Heo
2008-02-03 14:38 ` James Bottomley
2008-02-03 15:14 ` Tejun Heo
2008-02-03 16:12 ` James Bottomley
2008-02-03 16:38 ` Jeff Garzik
2008-02-03 17:12 ` James Bottomley
2008-02-04 1:21 ` Tejun Heo
2008-02-04 1:28 ` Tejun Heo
2008-02-04 9:25 ` Tejun Heo
2008-02-04 14:43 ` Tejun Heo
2008-02-04 16:23 ` James Bottomley
2008-02-05 0:06 ` Tejun Heo
2008-02-05 0:32 ` James Bottomley
2008-02-05 0:43 ` Tejun Heo
2008-02-05 0:53 ` James Bottomley
2008-02-05 1:07 ` Tejun Heo
2008-02-05 5:03 ` James Bottomley
2008-02-05 5:22 ` Tejun Heo
2008-02-04 15:43 ` James Bottomley
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=1199373151.3122.3.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=Jens.Axboe@oracle.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=tomof@acm.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;
as well as URLs for NNTP newsgroup(s).