Skip to content
Snippets Groups Projects
Commit 0e62d585 authored by Glauber Costa's avatar Glauber Costa
Browse files

Do not overwrite the buffer on writes.

Even Lords make brown paper bag mistakes. This is a left over code from my
initial testing, where the buffer where set with pre existing values to make
sure they were going through.  I forgot to remove them. As a result reads were
fine, but writes would just wipe the previous data from the buffer.
Incidentally, the "write-then-read-the-data-back" test I was doing would also
obviously pass, so I haven't noticed this so far.

Fix is to just leave the buffer alone.
parent 23d0d827
No related branches found
No related tags found
No related merge requests found
......@@ -109,9 +109,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
void *callback_arg, int flags)
{
unsigned int nsegs = 0;
for (unsigned int i = 0; i < buflen / sizeof(int); i++) {
((unsigned int *)buf)[i] = i;
}
while (buflen > 0) {
auto segsize = std::min(buflen, dmat->maxsegsz);
segsize = align_up(segsize, dmat->alignment);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment