Skip to contentSkip to conversation

Staging: most: Do not print message if kzalloc() failed.

PATCH In review Sandhya Bankar 2 participants 2 messages Feb 21, 2016

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

PATCH 1/1 Staging: most: Do not print message if kzalloc() failed.

Do not print message if kzalloc() failed. kzalloc() has its own messages. So no need to add extra one.

---
 drivers/staging/most/mostcore/core.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/most/mostcore/core.c +0 -1
index 322ee01..7c619fe 100644
@@ -1259,7 +1259,6 @@ static int arm_mbo_chain(struct most_c_obj *c, int dir,
 	for (i = 0; i < c->cfg.num_buffers; i++) {
 		mbo = kzalloc(sizeof(*mbo), GFP_KERNEL);
 		if (!mbo) {
-			pr_info("WARN: Allocation of MBO failed.\n");
 			retval = i;
 			goto _exit;
 		}
Signature · 1 line
1.8.3.4
#1 lore raw
Quoted 2 lines · Sandhya Bankar

Do not print message if kzalloc() failed. kzalloc() has its own messages. So no need to add extra one.

You could try to generalize this using Coccinelle.

Something that could be useful:

constant char[] c;

matches an explicit string.

julia

Quoted 28 lines
---
 drivers/staging/most/mostcore/core.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/most/mostcore/core.c +0 -2
index 322ee01..7c619fe 100644
@@ -1259,7 +1259,6 @@ static int arm_mbo_chain(struct most_c_obj *c, int dir,
 	for (i = 0; i < c->cfg.num_buffers; i++) {
 		mbo = kzalloc(sizeof(*mbo), GFP_KERNEL);
 		if (!mbo) {
-			pr_info("WARN: Allocation of MBO failed.\n");
 			retval = i;
 			goto _exit;
 		}
--

1.8.3.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160221050205.GA3014%40sandhya.
For more options, visit https://groups.google.com/d/optout.