These two patches are cleanup and typo fix for device coredump subsystem,
and these were originally a part of nvme device coredump series. However
the series requires an overhaul because it makes nvme-pci driver
compilcated, so these two independent patches are extracted from the
series.
Akinobu Mita (2):
devcoredump: use memory_read_from_buffer
devcoredump: fix typo in comment
drivers/base/devcoredump.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
Cc: Johannes Berg <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Sagi Grimberg <[email protected]>
Cc: Minwoo Im <[email protected]>
Cc: Kenneth Heitke <[email protected]>
Cc: Chaitanya Kulkarni <[email protected]>
--
2.7.4
Use memory_read_from_buffer() to simplify devcd_readv().
Cc: Johannes Berg <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Sagi Grimberg <[email protected]>
Cc: Minwoo Im <[email protected]>
Cc: Kenneth Heitke <[email protected]>
Cc: Chaitanya Kulkarni <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Reviewed-by: Johannes Berg <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
---
drivers/base/devcoredump.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/base/devcoredump.c b/drivers/base/devcoredump.c
index f1a3353..3c960a6 100644
--- 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)
--
2.7.4
s/dev_coredumpmsg/dev_coredumpsg/
Cc: Johannes Berg <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Sagi Grimberg <[email protected]>
Cc: Minwoo Im <[email protected]>
Cc: Kenneth Heitke <[email protected]>
Cc: Chaitanya Kulkarni <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
---
drivers/base/devcoredump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/devcoredump.c b/drivers/base/devcoredump.c
index 3c960a6..e42d0b5 100644
--- a/drivers/base/devcoredump.c
+++ b/drivers/base/devcoredump.c
@@ -314,7 +314,7 @@ void dev_coredumpm(struct device *dev, struct module *owner,
EXPORT_SYMBOL_GPL(dev_coredumpm);
/**
- * dev_coredumpmsg - create device coredump that uses scatterlist as data
+ * dev_coredumpsg - create device coredump that uses scatterlist as data
* parameter
* @dev: the struct device for the crashed device
* @table: the dump data
--
2.7.4
On Sun, 2019-07-28 at 00:59 +0900, Akinobu Mita wrote:
> s/dev_coredumpmsg/dev_coredumpsg/
Oops, thanks
Reviewed-by: Johannes Berg <[email protected]>
Greg, I think before you took these patches?
Thanks,
johannes
On Sat, Jul 27, 2019 at 08:43:21PM +0200, Johannes Berg wrote:
> On Sun, 2019-07-28 at 00:59 +0900, Akinobu Mita wrote:
> > s/dev_coredumpmsg/dev_coredumpsg/
>
> Oops, thanks
>
> Reviewed-by: Johannes Berg <[email protected]>
>
> Greg, I think before you took these patches?
Took what patches? I don't see anything here :(
On Tue, 2019-07-30 at 18:23 +0200, Greg KH wrote:
> On Sat, Jul 27, 2019 at 08:43:21PM +0200, Johannes Berg wrote:
> > On Sun, 2019-07-28 at 00:59 +0900, Akinobu Mita wrote:
> > > s/dev_coredumpmsg/dev_coredumpsg/
> >
> > Oops, thanks
> >
> > Reviewed-by: Johannes Berg <[email protected]>
> >
> > Greg, I think before you took these patches?
>
> Took what patches? I don't see anything here :(
I mean, you take patches to devcoredump in general?
So need to resend with you included, I guess.
johannes
On Tue, 2019-07-30 at 18:45 +0200, Greg KH wrote:
> > I mean, you take patches to devcoredump in general?
>
> I have no idea, run 'scripts/get_maintainer.pl' to be sure :)
That actually points to me :-)
So really I guess the question is how I should send these upstream? It's
to drivers/base/devcoredump.c and include/linux/devcoredump.h and I
kinda figured you wanted to see these things.
johannes
On Tue, Jul 30, 2019 at 06:37:56PM +0200, Johannes Berg wrote:
> On Tue, 2019-07-30 at 18:23 +0200, Greg KH wrote:
> > On Sat, Jul 27, 2019 at 08:43:21PM +0200, Johannes Berg wrote:
> > > On Sun, 2019-07-28 at 00:59 +0900, Akinobu Mita wrote:
> > > > s/dev_coredumpmsg/dev_coredumpsg/
> > >
> > > Oops, thanks
> > >
> > > Reviewed-by: Johannes Berg <[email protected]>
> > >
> > > Greg, I think before you took these patches?
> >
> > Took what patches? I don't see anything here :(
>
> I mean, you take patches to devcoredump in general?
I have no idea, run 'scripts/get_maintainer.pl' to be sure :)
> So need to resend with you included, I guess.
Please do so.
thanks,
greg k-h
On Tue, Jul 30, 2019 at 06:49:12PM +0200, Johannes Berg wrote:
> On Tue, 2019-07-30 at 18:45 +0200, Greg KH wrote:
>
> > > I mean, you take patches to devcoredump in general?
> >
> > I have no idea, run 'scripts/get_maintainer.pl' to be sure :)
>
> That actually points to me :-)
>
> So really I guess the question is how I should send these upstream? It's
> to drivers/base/devcoredump.c and include/linux/devcoredump.h and I
> kinda figured you wanted to see these things.
Ah, sure, I can take them, I had no idea what devcoredump was. Remember
my patch workload :)
So send them on please.
thanks,
greg k-h
On Tue, 2019-07-30 at 19:11 +0200, Greg KH wrote:
> On Tue, Jul 30, 2019 at 06:49:12PM +0200, Johannes Berg wrote:
> > On Tue, 2019-07-30 at 18:45 +0200, Greg KH wrote:
> >
> > > > I mean, you take patches to devcoredump in general?
> > >
> > > I have no idea, run 'scripts/get_maintainer.pl' to be sure :)
> >
> > That actually points to me :-)
> >
> > So really I guess the question is how I should send these upstream? It's
> > to drivers/base/devcoredump.c and include/linux/devcoredump.h and I
> > kinda figured you wanted to see these things.
>
> Ah, sure, I can take them, I had no idea what devcoredump was. Remember
> my patch workload :)
:-)
> So send them on please.
Will do. Thanks Greg.
johannes