Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Lauri Kasanen <cand@gmx.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-mips@vger.kernel.org, tsbogend@alpha.franken.de,
	axboe@kernel.dk, linux-block@vger.kernel.org,
	Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH v10] block: Add n64 cart driver
Date: Sat, 23 Jan 2021 09:47:55 +0200	[thread overview]
Message-ID: <20210123094755.fb8b625955554e5c37e436fc@gmx.com> (raw)
In-Reply-To: <20210122193824.GA271343@infradead.org>

On Fri, 22 Jan 2021 19:38:24 +0000
Christoph Hellwig <hch@infradead.org> wrote:

> > +	bio_for_each_segment(bvec, bio, iter) {
> > +		unsigned int len = bvec.bv_len;
> > +		int err;
> > +
> > +		/* Alignment check */
> > +		WARN_ON_ONCE((bvec.bv_offset & (MIN_ALIGNMENT - 1)) ||
> > +				(len & (MIN_ALIGNMENT - 1)));
> > +
> > +		err = n64cart_do_bvec(dev, &bvec, len,
> > +				      bvec.bv_offset, pos);
> > +		if (err)
> > +			goto io_error;
> > +		pos += len;
>
> Nit: I'd just pass the bvec to n64cart_do_bvec, calculate pos there
> locally each time, and also move the WARN_ON_ONCE into the helper.

I don't think calculating pos there would work? It doesn't know how
many bio segments were processed and what lengths they were.

- Lauri

      reply	other threads:[~2021-01-23  7:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 19:33 [PATCH v10] block: Add n64 cart driver Lauri Kasanen
2021-01-22 19:38 ` Christoph Hellwig
2021-01-23  7:47   ` Lauri Kasanen [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=20210123094755.fb8b625955554e5c37e436fc@gmx.com \
    --to=cand@gmx.com \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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