[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0710241103000.5840@anakin>
Date: Wed, 24 Oct 2007 11:03:43 +0200 (CEST)
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Jens Axboe <jens.axboe@...cle.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Boaz Harrosh <bharrosh@...asas.com>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Linux Kernel Development <linux-kernel@...r.kernel.org>,
mingo@...e.hu, Linux/m68k <linux-m68k@...r.kernel.org>
Subject: Re: [PATCH 09/10] Change table chaining layout
On Wed, 24 Oct 2007, Jens Axboe wrote:
> On Tue, Oct 23 2007, Linus Torvalds wrote:
> > My biggest complaint right now is that a lot of users of the sg *filling*
> > functions were mindlessly converted, so we have code like
> >
> > cryptoloop.c: sg_set_page(&sg_in, in_page);
> > cryptoloop.c: sg_in.offset = in_offs;
> > cryptoloop.c: sg_in.length = sz;
> >
> > which is just really stupid, and we should have a function for that. But
> > worse is code like this:
> >
> > ub.c: sg_set_page(sg, virt_to_page(sc->top_sense));
> > ub.c: sg->offset = (unsigned long)sc->top_sense & (PAGE_SIZE-1);
> > ub.c: sg->length = UB_SENSE_SIZE;
> >
> > which again was converted "line by line" and we actually *do* have a
> > function to do the above three lines as
> >
> > sg_set_buf(sg, sc->top_sense, UB_SENSE_SIZE);
> >
> > where that *single* line is just tons shorter but more importantly, more
> > readable, than the mess that is a brute-force conversion.
>
> I modified sg_set_page() to take a length and offset argument, and
As it no longer sets the page only, perhaps it's a good idea to rename
sg_set_page() to sg_set()?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists