Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105997
b: refs/heads/master
c: 2537747
h: refs/heads/master
i:
  105995: 6345626
v: v3
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Jul 25, 2008
1 parent 144f879 commit fd4cc11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 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: d991696263a704be7f41ac186f1a0ed17963c260
refs/heads/master: 25377479de7539fdc871a0f0ecaa39da42353bbc
28 changes: 3 additions & 25 deletions trunk/drivers/firmware/dell_rbu.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,40 +507,18 @@ static ssize_t read_packet_data(char *buffer, loff_t pos, size_t count)

static ssize_t read_rbu_mono_data(char *buffer, loff_t pos, size_t count)
{
unsigned char *ptemp = NULL;
size_t bytes_left = 0;
size_t data_length = 0;
ssize_t ret_count = 0;

/* check to see if we have something to return */
if ((rbu_data.image_update_buffer == NULL) ||
(rbu_data.bios_image_size == 0)) {
pr_debug("read_rbu_data_mono: image_update_buffer %p ,"
"bios_image_size %lu\n",
rbu_data.image_update_buffer,
rbu_data.bios_image_size);
ret_count = -ENOMEM;
goto read_rbu_data_exit;
}

if (pos > rbu_data.bios_image_size) {
ret_count = 0;
goto read_rbu_data_exit;
return -ENOMEM;
}

bytes_left = rbu_data.bios_image_size - pos;
data_length = min(bytes_left, count);

ptemp = rbu_data.image_update_buffer;
memcpy(buffer, (ptemp + pos), data_length);

if ((pos + count) > rbu_data.bios_image_size)
/* this was the last copy */
ret_count = bytes_left;
else
ret_count = count;
read_rbu_data_exit:
return ret_count;
return memory_read_from_buffer(buffer, count, &pos,
rbu_data.image_update_buffer, rbu_data.bios_image_size);
}

static ssize_t read_rbu_data(struct kobject *kobj,
Expand Down

0 comments on commit fd4cc11

Please sign in to comment.