linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/8] fs/ext3/inode.c: drop if around WARN_ON
       [not found] <1351974625-10282-1-git-send-email-Julia.Lawall@lip6.fr>
@ 2012-11-03 20:30 ` Julia Lawall
  2012-11-06 23:04   ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2012-11-03 20:30 UTC (permalink / raw)
  To: Jan Kara
  Cc: kernel-janitors, Andrew Morton, Andreas Dilger, linux-ext4,
	linux-kernel

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

Just use WARN_ON rather than an if containing only WARN_ON(1).

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

// <smpl>
@@
expression e;
@@
- if (e) WARN_ON(1);
+ WARN_ON(e);
// </smpl>

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

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

diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 7e87e37..b176d42 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1071,8 +1071,7 @@ struct buffer_head *ext3_getblk(handle_t *handle, struct inode *inode,
 	 * mapped. 0 in case of a HOLE.
 	 */
 	if (err > 0) {
-		if (err > 1)
-			WARN_ON(1);
+		WARN_ON(err > 1);
 		err = 0;
 	}
 	*errp = err;

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

* Re: [PATCH 4/8] fs/ext3/inode.c: drop if around WARN_ON
  2012-11-03 20:30 ` [PATCH 4/8] fs/ext3/inode.c: drop if around WARN_ON Julia Lawall
@ 2012-11-06 23:04   ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2012-11-06 23:04 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Jan Kara, kernel-janitors, Andrew Morton, Andreas Dilger,
	linux-ext4, linux-kernel

On Sat 03-11-12 21:30:21, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Just use WARN_ON rather than an if containing only WARN_ON(1).
> 
> A simplified version of the semantic patch that makes this transformation
> is as follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression e;
> @@
> - if (e) WARN_ON(1);
> + WARN_ON(e);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
  Thanks. Added into my tree.

							Honza

> ---
>  fs/ext3/inode.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
> index 7e87e37..b176d42 100644
> --- a/fs/ext3/inode.c
> +++ b/fs/ext3/inode.c
> @@ -1071,8 +1071,7 @@ struct buffer_head *ext3_getblk(handle_t *handle, struct inode *inode,
>  	 * mapped. 0 in case of a HOLE.
>  	 */
>  	if (err > 0) {
> -		if (err > 1)
> -			WARN_ON(1);
> +		WARN_ON(err > 1);
>  		err = 0;
>  	}
>  	*errp = err;
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

end of thread, other threads:[~2012-11-06 23:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1351974625-10282-1-git-send-email-Julia.Lawall@lip6.fr>
2012-11-03 20:30 ` [PATCH 4/8] fs/ext3/inode.c: drop if around WARN_ON Julia Lawall
2012-11-06 23:04   ` Jan Kara

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