lkml.org 
[lkml]   [2005]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] SPI: turn transfers from arrays to linked lists
Date
On Friday 23 December 2005 6:06 am, Vitaly Wool wrote:
> Hi,
>
> the patch inlined is changing the SPI core and its users to have
> transfers in the SPI message structure as linked list not as an array,

It basically looks OK. I've updated it a bit, and will include an
updated version in any future updates of mine. (Right now I have
to merge your second version with my updated one ... )

So we'll be well on the way to agreeing on a single SPI framework
to evolve and integrate against.


> - req->msg.transfers = req->xfer;
> - req->msg.n_transfer = 6;
> + for (i = 0; i < 6; i++)
> + list_add_tail(&req->xfer[i].link, &req->msg.transfers);

More expensive, but not in a way that will often matter much. That
one's part of one-time init, for example. And the attached code
uses the spi_message_add_tail(transfer, message) you had mentioned.


> + DECLARE_SPI_MESSAGE(m);

The updated code has only an spi_message_init() function.


>
> - for (;;t++) {
> + list_for_each_entry (t, &m->transfers, link) {...}

...

> - tmp = m->n_transfer - 1;
> - tmp = m->transfers[tmp].cs_change;
> + if (t)
> + tmp = t->cs_change;

Bug: "t" is non-null but invalid there. (Fixed.)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-27 18:31    [W:0.070 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site