All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: most: Do not print message if kzalloc() failed.
@ 2016-02-21  5:02 Sandhya Bankar
  2016-02-21 13:22 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Sandhya Bankar @ 2016-02-21  5:02 UTC (permalink / raw)
  To: outreachy-kernel

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

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
 drivers/staging/most/mostcore/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index 322ee01..7c619fe 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH] Staging: most: Do not print message if kzalloc() failed.
  2016-02-21  5:02 [PATCH] Staging: most: Do not print message if kzalloc() failed Sandhya Bankar
@ 2016-02-21 13:22 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2016-02-21 13:22 UTC (permalink / raw)
  To: Sandhya Bankar; +Cc: outreachy-kernel

On Sun, 21 Feb 2016, Sandhya Bankar wrote:

> 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

>
> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
> ---
>  drivers/staging/most/mostcore/core.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
> index 322ee01..7c619fe 100644
> --- a/drivers/staging/most/mostcore/core.c
> +++ b/drivers/staging/most/mostcore/core.c
> @@ -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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-21 13:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-21  5:02 [PATCH] Staging: most: Do not print message if kzalloc() failed Sandhya Bankar
2016-02-21 13:22 ` [Outreachy kernel] " Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.