Skip to contentSkip to conversation

devcoredump: cleanup and typo fix

PATCH In review Akinobu Mita 3 participants 10 messages Jul 27, 2019 – Jul 30, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover devcoredump: cleanup and typo fix

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]>
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 devcoredump: use memory_read_from_buffer

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]>
---
 drivers/base/devcoredump.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/base/devcoredump.c +1 -10
index f1a3353..3c960a6 100644
@@ -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)
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 devcoredump: fix typo in comment

In reply to Akinobu Mita

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]>
---
 drivers/base/devcoredump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/devcoredump.c +1 -1
index 3c960a6..e42d0b5 100644
@@ -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
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] devcoredump: fix typo in comment

Quoted 1 line · Akinobu Mita

s/dev_coredumpmsg/dev_coredumpsg/

Oops, thanks

Greg, I think before you took these patches?

Thanks,
johannes

maintainer
#4 lore raw

Re: [PATCH 2/2] devcoredump: fix typo in comment

Quoted 8 lines · Johannes Berg
Quoted 1 line · Akinobu Mita

s/dev_coredumpmsg/dev_coredumpsg/

Oops, thanks

Greg, I think before you took these patches?

Took what patches? I don't see anything here :(

maintainer
#5 lore raw

Re: [PATCH 2/2] devcoredump: fix typo in comment

Quoted 11 lines · Greg KH
Quoted 8 lines · Johannes Berg
Quoted 1 line · Akinobu Mita

s/dev_coredumpmsg/dev_coredumpsg/

Oops, thanks

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

maintainer
#6 lore raw

Re: [PATCH 2/2] devcoredump: fix typo in comment

Quoted 7 lines · Johannes Berg
Quoted 6 lines · Greg KH
Quoted 5 lines · Johannes Berg
Quoted 1 line · Akinobu Mita

s/dev_coredumpmsg/dev_coredumpsg/

Oops, thanks

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

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 :)

Quoted 1 line

So need to resend with you included, I guess.

Please do so.

thanks,

greg k-h

maintainer
#7 lore raw

Re: [PATCH 2/2] devcoredump: fix typo in comment

Quoted 3 lines · Greg KH
Quoted 1 line

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

maintainer
#8 lore raw

Re: [PATCH 2/2] devcoredump: fix typo in comment

Quoted 11 lines · Johannes Berg
Quoted 3 lines · Greg KH
Quoted 1 line

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

maintainer
#9 lore raw

Re: [PATCH 2/2] devcoredump: fix typo in comment

Quoted 7 lines · Greg KH
Quoted 6 lines · Johannes Berg
Quoted 3 lines · Greg KH
Quoted 1 line

I mean, you take patches to devcoredump in general?

I have no idea, run 'scripts/get_maintainer.pl' to be sure :)

Quoted 8 lines
Quoted 5 lines

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 :)

:-)

Quoted 1 line

So send them on please.

Will do. Thanks Greg.

johannes