mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
devcoredump: use memory_read_from_buffer
Use memory_read_from_buffer() to simplify devcd_readv(). Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Johannes Berg <[email protected]> Signed-off-by: Akinobu Mita <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
9c1c5e0bc5
commit
ce684d957c
1 changed files with 1 additions and 10 deletions
|
|
@ -164,16 +164,7 @@ static struct class devcd_class = {
|
|||
static ssize_t devcd_readv(char *buffer, loff_t offset, size_t count,
|
||||
void *data, size_t datalen)
|
||||
{
|
||||
if (offset > datalen)
|
||||
return -EINVAL;
|
||||
|
||||
if (offset + count > datalen)
|
||||
count = datalen - offset;
|
||||
|
||||
if (count)
|
||||
memcpy(buffer, ((u8 *)data) + offset, count);
|
||||
|
||||
return count;
|
||||
return memory_read_from_buffer(buffer, count, &offset, data, datalen);
|
||||
}
|
||||
|
||||
static void devcd_freev(void *data)
|
||||
|
|
|
|||
Loading…
Reference in a new issue