Skip to contentSkip to conversation

staging: most: remove redundant print statement when kfifo_alloc fails

PATCH Superseded Keyur Patel 3 participants 16 messages Jul 11, 2019 – Jul 15, 2019

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

PATCH 2/2 staging: most: remove redundant print statement when kfifo_alloc fails

This print statement is redundant as kfifo_alloc just calls kmalloc_array and without the __GFP_NOWARN flag, already does a dump_stack().

---
 drivers/staging/most/cdev/cdev.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/most/cdev/cdev.c +2 -3
index d0cc0b746107..bc0219ceac50 100644
@@ -463,10 +463,9 @@ static int comp_probe(struct most_interface *iface, int channel_id,
 	spin_lock_init(&c->unlink);
 	INIT_KFIFO(c->fifo);
 	retval = kfifo_alloc(&c->fifo, cfg->num_buffers, GFP_KERNEL);
-	if (retval) {
-		pr_info("failed to alloc channel kfifo");
+	if (retval)
 		goto err_del_cdev_and_free_channel;
-	}
+
 	init_waitqueue_head(&c->wq);
 	mutex_init(&c->io_mutex);
 	spin_lock_irqsave(&ch_list_lock, cl_flags);
Signature · 1 line
2.22.0
#1 lore raw

PATCH v2 1/1 staging: most: remove redundant print statement when

This print statement is redundant as kfifo_alloc just calls kmalloc_array and without the __GFP_NOWARN flag, already does a dump_stack().

---
Changes in v2:
- Edit subject line.

---
 drivers/staging/most/cdev/cdev.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/most/cdev/cdev.c +2 -3
index d0cc0b746107..bc0219ceac50 100644
@@ -463,10 +463,9 @@ static int comp_probe(struct most_interface *iface, int channel_id,
 	spin_lock_init(&c->unlink);
 	INIT_KFIFO(c->fifo);
 	retval = kfifo_alloc(&c->fifo, cfg->num_buffers, GFP_KERNEL);
-	if (retval) {
-		pr_info("failed to alloc channel kfifo");
+	if (retval)
 		goto err_del_cdev_and_free_channel;
-	}
+
 	init_waitqueue_head(&c->wq);
 	mutex_init(&c->io_mutex);
 	spin_lock_irqsave(&ch_list_lock, cl_flags);
Signature · 1 line
2.22.0
#2 lore raw

PATCH v3 1/1 staging: most: remove redundant print statement when kfifo_alloc fails

This print statement is redundant as kfifo_alloc just calls kmalloc_array and without the __GFP_NOWARN flag, already does a dump_stack().

Changes in v3:
- fix checkpatch warrning

---
 drivers/staging/most/cdev/cdev.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/most/cdev/cdev.c +1 -3
index d0cc0b746107..724d098aeef0 100644
@@ -463,10 +463,8 @@ static int comp_probe(struct most_interface *iface, int channel_id,
 	spin_lock_init(&c->unlink);
 	INIT_KFIFO(c->fifo);
 	retval = kfifo_alloc(&c->fifo, cfg->num_buffers, GFP_KERNEL);
-	if (retval) {
-		pr_info("failed to alloc channel kfifo");
+	if (retval)
 		goto err_del_cdev_and_free_channel;
-	}
 	init_waitqueue_head(&c->wq);
 	mutex_init(&c->io_mutex);
 	spin_lock_irqsave(&ch_list_lock, cl_flags);
Signature · 1 line
2.22.0
#3 lore raw
Quoted 2 lines

This print statement is redundant as kfifo_alloc just calls kmalloc_array and without the __GFP_NOWARN flag, already does a dump_stack().

I suggest to omit the word “and” from this sentence.
Will any further wording adjustments become helpful for commit descriptions?

Quoted 3 lines

Changes in v3:
- fix checkpatch warrning
---

Please move such version information below the triple dashes without a typo.

Regards,
Markus

#4 lore raw

PATCH v4 1/1 staging: most: remove redundant print statement when kfifo_alloc fails

In reply to Keyur Patel

This print statement is redundant as kfifo_alloc just calls kmalloc_array without the __GFP_NOWARN flag, already does a dump_stack().

---
Changes in v3:
- fix checkpatch warning

 drivers/staging/most/cdev/cdev.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/most/cdev/cdev.c +1 -3
index d0cc0b746107..724d098aeef0 100644
@@ -463,10 +463,8 @@ static int comp_probe(struct most_interface *iface, int channel_id,
 	spin_lock_init(&c->unlink);
 	INIT_KFIFO(c->fifo);
 	retval = kfifo_alloc(&c->fifo, cfg->num_buffers, GFP_KERNEL);
-	if (retval) {
-		pr_info("failed to alloc channel kfifo");
+	if (retval)
 		goto err_del_cdev_and_free_channel;
-	}
 	init_waitqueue_head(&c->wq);
 	mutex_init(&c->io_mutex);
 	spin_lock_irqsave(&ch_list_lock, cl_flags);
Signature · 1 line
2.22.0
#5 lore raw
Quoted 2 lines

---
Changes in v3:

Thanks for your quick response.

I find the change log incomplete (even if corresponding information can be determined also from public message archives).

Regards,
Markus

#7 lore raw
In reply to Markus Elfring

I didn't get you. I stiil need to update changelog and send more version or not. If you say so, I can send one more.

Thnaks.

Quoted 10 lines · Markus Elfring
Quoted 2 lines

---
Changes in v3:

Thanks for your quick response.

I find the change log incomplete (even if corresponding information can be determined also from public message archives).

Regards,
Markus

#8 lore raw
Quoted 1 line

I didn't get you. I stiil need to update changelog

I would appreciate the completion of the listing for V2 till V4. I guess that a message resend could be sufficient for these adjustments.

Quoted 1 line

and send more version

This could be another opportunity if you would like to improve the commit description considerably.
How do you think about previous clarification attempts on a topic like “Delete an error message for a failed memory allocation”?

Regards,
Markus

#9 lore raw
In reply to Keyur Patel
Quoted 2 lines · Keyur Patel

I didn't get you. I stiil need to update changelog and send more version or not. If you say so, I can send one more.

Please note that the person/bot you are responding to is on in my email blacklist, and many others, so I wouldn't worry too much about the responses.

I'll review this patch once 5.3-rc1 is out as I can't do anything with it during the merge window.

thanks,

greg k-h

#10 lore raw

PATCH v4 1/1 staging: most: Delete an error message for a failed memory allocation

In reply to Keyur Patel

This error message for a failed memory allocation is redundant as kfifo_alloc just calls kmalloc_array without the __GFP_NOWARN flag, already does a dump_stack().

---
Changes in v4:
- change subject line
- improve commit description
- fix checkpatch warning

 drivers/staging/most/cdev/cdev.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/most/cdev/cdev.c +1 -3
index d0cc0b746107..724d098aeef0 100644
@@ -463,10 +463,8 @@ static int comp_probe(struct most_interface *iface, int channel_id,
 	spin_lock_init(&c->unlink);
 	INIT_KFIFO(c->fifo);
 	retval = kfifo_alloc(&c->fifo, cfg->num_buffers, GFP_KERNEL);
-	if (retval) {
-		pr_info("failed to alloc channel kfifo");
+	if (retval)
 		goto err_del_cdev_and_free_channel;
-	}
 	init_waitqueue_head(&c->wq);
 	mutex_init(&c->io_mutex);
 	spin_lock_irqsave(&ch_list_lock, cl_flags);
Signature · 1 line
2.22.0
#11 lore raw

Re: [v4] staging: most: Delete an error message for a failed memory allocation

Quoted 2 lines

---
Changes in v4:

I find this change log still incomplete.

You have chosen to adjust the commit message once more. (Some contributors might be also not satisfied with this variant.)

Such a change requires to increase the corresponding patch version number, doesn't it?

Regards,
Markus

#12 lore raw

Re: [v4] staging: most: Delete an error message for a failed memory allocation

I think commit message is clear enough to understand why this is needed. You can send me what should I include in commit description and I will add and send it again. Otherwise, Greg can comment on this.

Thanks.

Quoted 13 lines · Markus Elfring
Quoted 2 lines

---
Changes in v4:

I find this change log still incomplete.

You have chosen to adjust the commit message once more. (Some contributors might be also not satisfied with this variant.)

Such a change requires to increase the corresponding patch version number, doesn't it?

Regards,
Markus

#13 lore raw

Re: [v4] staging: most: Delete an error message for a failed memory allocation

Quoted 1 line

I think commit message is clear enough to understand why this is needed.

There are differences to consider between the involved software developers.

Quoted 1 line

You can send me what should I include in commit description

The clarification should be continued with the number “v5” in the message subject.

Quoted 1 line

and I will add and send it again. Otherwise, Greg can comment on this.

Would you like to recheck information sources for the safe description of the Linux allocation failure report?

Regards,
Markus

#14 lore raw

PATCH v5 1/1 staging: most: Delete an error message for a failed memory allocation

In reply to Keyur Patel

The kfifo_alloc() failure generates enough information and doesn't need to be accompanied by another error statement.

---
Changes in v5:
- change subject line
- simplify commit description
- fix checkpatch warning
- removed braces around if

 drivers/staging/most/cdev/cdev.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/most/cdev/cdev.c +1 -3
index d0cc0b746107..724d098aeef0 100644
@@ -463,10 +463,8 @@ static int comp_probe(struct most_interface *iface, int channel_id,
 	spin_lock_init(&c->unlink);
 	INIT_KFIFO(c->fifo);
 	retval = kfifo_alloc(&c->fifo, cfg->num_buffers, GFP_KERNEL);
-	if (retval) {
-		pr_info("failed to alloc channel kfifo");
+	if (retval)
 		goto err_del_cdev_and_free_channel;
-	}
 	init_waitqueue_head(&c->wq);
 	mutex_init(&c->io_mutex);
 	spin_lock_irqsave(&ch_list_lock, cl_flags);
Signature · 1 line
2.22.0
#15 lore raw

Re: [v5] staging: most: Delete an error message for a failed memory allocation

Quoted 2 lines

The kfifo_alloc() failure generates enough information and doesn't need to be accompanied by another error statement.

I am curious how the acceptance will evolve for this variant of another different commit description according to a known software transformation pattern.

Quoted 2 lines

---
Changes in v5:

The subsequent listing should usually be split between V2 till V5 for such a patch change log.

Regards,
Markus