linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: remove unreachable code
@ 2022-05-06  8:26 Jiapeng Chong
  2022-05-06 16:04 ` Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Jiapeng Chong @ 2022-05-06  8:26 UTC (permalink / raw)
  To: djwong; +Cc: linux-xfs, linux-kernel, Jiapeng Chong, Abaci Robot

Clean up the following smatch warning:

fs/xfs/xfs_icache.c:1768 xfs_icwalk() warn: ignoring unreachable code.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 fs/xfs/xfs_icache.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 5269354b1b69..5af272c20934 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1765,7 +1765,6 @@ xfs_icwalk(
 		}
 	}
 	return last_error;
-	BUILD_BUG_ON(XFS_ICWALK_PRIVATE_FLAGS & XFS_ICWALK_FLAGS_VALID);
 }
 
 #ifdef DEBUG
-- 
2.20.1.7.g153144c


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

* Re: [PATCH] xfs: remove unreachable code
  2022-05-06  8:26 [PATCH] xfs: remove unreachable code Jiapeng Chong
@ 2022-05-06 16:04 ` Darrick J. Wong
  2022-05-10  9:33   ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2022-05-06 16:04 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: linux-xfs, linux-kernel, Abaci Robot

On Fri, May 06, 2022 at 04:26:15PM +0800, Jiapeng Chong wrote:
> Clean up the following smatch warning:
> 
> fs/xfs/xfs_icache.c:1768 xfs_icwalk() warn: ignoring unreachable code.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  fs/xfs/xfs_icache.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 5269354b1b69..5af272c20934 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -1765,7 +1765,6 @@ xfs_icwalk(
>  		}
>  	}
>  	return last_error;
> -	BUILD_BUG_ON(XFS_ICWALK_PRIVATE_FLAGS & XFS_ICWALK_FLAGS_VALID);

<cough> Do you know what you're removing?

--D

>  }
>  
>  #ifdef DEBUG
> -- 
> 2.20.1.7.g153144c
> 

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

* Re: [PATCH] xfs: remove unreachable code
  2022-05-06 16:04 ` Darrick J. Wong
@ 2022-05-10  9:33   ` Christoph Hellwig
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2022-05-10  9:33 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Jiapeng Chong, linux-xfs, linux-kernel, Abaci Robot

On Fri, May 06, 2022 at 09:04:02AM -0700, Darrick J. Wong wrote:
> > @@ -1765,7 +1765,6 @@ xfs_icwalk(
> >  		}
> >  	}
> >  	return last_error;
> > -	BUILD_BUG_ON(XFS_ICWALK_PRIVATE_FLAGS & XFS_ICWALK_FLAGS_VALID);
> 
> <cough> Do you know what you're removing?

That being said hiding this behind the return is rather odd.  The
normal placement in most of the kernel is at the beginning of a
function.

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

end of thread, other threads:[~2022-05-10  9:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06  8:26 [PATCH] xfs: remove unreachable code Jiapeng Chong
2022-05-06 16:04 ` Darrick J. Wong
2022-05-10  9:33   ` Christoph Hellwig

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