lkml.org 
[lkml]   [2010]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] USB: f_mass_storage: dynamic buffers for better alignment
On Mon, Mar 15, 2010 at 11:09:55AM +0100, Michal Nazarewicz wrote:
> "Static" buffers in fsg_buffhd structure (ie. fields which are arrays
> rather then pointers to dynamically allocated memory) are not aligned
> to any "big" power of two which may lead to poor DMA performance

not so true as you can add __attribute__ ((aligned(32))) to those.

> @@ -2747,13 +2746,18 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common,
>
>
> /* Data buffers cyclic list */
> - /* Buffers in buffhds are static -- no need for additional
> - * allocation. */
> bh = common->buffhds;
> - i = FSG_NUM_BUFFERS - 1;
> - do {
> + i = FSG_NUM_BUFFERS;
> + for (i = FSG_NUM_BUFFERS;; ++bh) {

something like

for (i = 0; i < FSG_NUM_BUFFERS; i++, ++bh) {

wouldn't it do it ??

--
balbi


\
 
 \ /
  Last update: 2010-03-15 19:13    [W:0.032 / U:1.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site