projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c1c5e0
)
devcoredump: use memory_read_from_buffer
author
Akinobu Mita
<akinobu.mita@gmail.com>
Wed, 31 Jul 2019 10:00:06 +0000
(12:00 +0200)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 15 Aug 2019 15:38:11 +0000
(17:38 +0200)
Use memory_read_from_buffer() to simplify devcd_readv().
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Link:
https://lore.kernel.org/r/1564243146-5681-2-git-send-email-akinobu.mita@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link:
https://lore.kernel.org/r/20190731100007.32684-1-johannes@sipsolutions.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/devcoredump.c
patch
|
blob
|
history
diff --git
a/drivers/base/devcoredump.c
b/drivers/base/devcoredump.c
index
f1a3353
..
3c960a6
100644
(file)
--- a/
drivers/base/devcoredump.c
+++ b/
drivers/base/devcoredump.c
@@
-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)