linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 9/16] fs/ext4/indirect.c: use WARN
       [not found] <1351940317-14812-1-git-send-email-Julia.Lawall@lip6.fr>
@ 2012-11-03 10:58 ` Julia Lawall
  2013-02-02  1:07   ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2012-11-03 10:58 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: kernel-janitors, Andreas Dilger, linux-ext4, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use WARN rather than printk followed by WARN_ON(1), for conciseness.

A simplified version of the semantic patch that makes this transformation
is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression list es;
@@

-printk(
+WARN(1,
  es);
-WARN_ON(1);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/ext4/indirect.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c
index 792e388..0cdd20f 100644
--- a/fs/ext4/indirect.c
+++ b/fs/ext4/indirect.c
@@ -354,9 +354,8 @@ static int ext4_alloc_blocks(handle_t *handle, struct inode *inode,
 			 * for the first direct block
 			 */
 			new_blocks[index] = current_block;
-			printk(KERN_INFO "%s returned more blocks than "
+			WARN(1, KERN_INFO "%s returned more blocks than "
 						"requested\n", __func__);
-			WARN_ON(1);
 			break;
 		}
 	}

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

* Re: [PATCH 9/16] fs/ext4/indirect.c: use WARN
  2012-11-03 10:58 ` [PATCH 9/16] fs/ext4/indirect.c: use WARN Julia Lawall
@ 2013-02-02  1:07   ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2013-02-02  1:07 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, Andreas Dilger, linux-ext4, linux-kernel

On Sat, Nov 03, 2012 at 11:58:30AM +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use WARN rather than printk followed by WARN_ON(1), for conciseness.
> 
> A simplified version of the semantic patch that makes this transformation
> is as follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression list es;
> @@
> 
> -printk(
> +WARN(1,
>   es);
> -WARN_ON(1);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Thanks, applied.

					- Ted

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

end of thread, other threads:[~2013-02-02  1:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1351940317-14812-1-git-send-email-Julia.Lawall@lip6.fr>
2012-11-03 10:58 ` [PATCH 9/16] fs/ext4/indirect.c: use WARN Julia Lawall
2013-02-02  1:07   ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).