Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304641
b: refs/heads/master
c: 484dd30
h: refs/heads/master
i:
  304639: f9ef611
v: v3
  • Loading branch information
Anton Vorontsov authored and Greg Kroah-Hartman committed May 14, 2012
1 parent 3468796 commit f7316ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 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: 06f3d3bdee9bac871c556c34ea80303033c474b3
refs/heads/master: 484dd30e016eb425b0de871357fff2c9bb93be45
19 changes: 1 addition & 18 deletions trunk/drivers/staging/android/persistent_ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,6 @@ static inline void buffer_size_add(struct persistent_ram_zone *prz, size_t a)
} while (atomic_cmpxchg(&prz->buffer->size, old, new) != old);
}

/* increase the size counter, retuning an error if it hits the max size */
static inline ssize_t buffer_size_add_clamp(struct persistent_ram_zone *prz,
size_t a)
{
size_t old;
size_t new;

do {
old = atomic_read(&prz->buffer->size);
new = old + a;
if (new > prz->buffer_size)
return -ENOMEM;
} while (atomic_cmpxchg(&prz->buffer->size, old, new) != old);

return 0;
}

static void notrace persistent_ram_encode_rs8(struct persistent_ram_zone *prz,
uint8_t *data, size_t len, uint8_t *ecc)
{
Expand Down Expand Up @@ -300,7 +283,7 @@ int notrace persistent_ram_write(struct persistent_ram_zone *prz,
c = prz->buffer_size;
}

buffer_size_add_clamp(prz, c);
buffer_size_add(prz, c);

start = buffer_start_add(prz, c);

Expand Down

0 comments on commit f7316ea

Please sign in to comment.