Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208893
b: refs/heads/master
c: d78a3ed
h: refs/heads/master
i:
  208891: 314f3c1
v: v3
  • Loading branch information
Stefani Seibold authored and Linus Torvalds committed Aug 12, 2010
1 parent 0f03753 commit 1f0c19a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5af568cbd55f60b5a1d174f621b273e4f585dc35
refs/heads/master: d78a3eda6985e74bc21a23362f27526f73e71649
13 changes: 6 additions & 7 deletions trunk/kernel/kfifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
Expand Down Expand Up @@ -333,17 +333,16 @@ static int setup_sgl_buf(struct scatterlist *sgl, void *buf,
buf += PAGE_SIZE;
npage = virt_to_page(buf);
if (page_to_phys(page) != page_to_phys(npage) - l) {
sgl->page_link = 0;
sg_set_page(sgl++, page, l - off, off);
if (++n == nents)
sg_set_page(sgl, page, l - off, off);
sgl = sg_next(sgl);
if (++n == nents || sgl == NULL)
return n;
page = npage;
len -= l - off;
l = off = 0;
}
}
sgl->page_link = 0;
sg_set_page(sgl++, page, len, off);
sg_set_page(sgl, page, len, off);
return n + 1;
}

Expand All @@ -363,7 +362,7 @@ static unsigned int setup_sgl(struct __kfifo *fifo, struct scatterlist *sgl,
}
l = min(len, size - off);

n = setup_sgl_buf(sgl, fifo->data + off, nents, l);
n = setup_sgl_buf(sgl, fifo->data + off, nents, l);
n += setup_sgl_buf(sgl + n, fifo->data, nents - n, len - l);

if (n)
Expand Down

0 comments on commit 1f0c19a

Please sign in to comment.