All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: Remove unreachable code
@ 2021-01-29 18:58 Vinicius Tinti
  2021-01-30  1:35 ` Nathan Chancellor
  2021-01-30  6:42 ` Andreas Dilger
  0 siblings, 2 replies; 22+ messages in thread
From: Vinicius Tinti @ 2021-01-29 18:58 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger
  Cc: Nathan Chancellor, Nick Desaulniers, Vinicius Tinti, linux-ext4,
	linux-kernel, clang-built-linux

By enabling -Wunreachable-code-aggressive on Clang the following code
paths are unreachable.

Commit dd73b5d5cb67 ("ext4: convert dx_probe() to use the ERR_PTR
convention")
Commit ac27a0ec112a ("[PATCH] ext4: initial copy of files from ext3")

Clang warns:

fs/ext4/namei.c:831:17: warning: code will never be executed
[-Wunreachable-code]
                        unsigned n = count - 1;
                                     ^~~~~
fs/ext4/namei.c:830:7: note: silence by adding parentheses to mark code as
explicitly dead
                if (0) { // linear search cross check
                    ^
                    /* DISABLES CODE */ ( )

Signed-off-by: Vinicius Tinti <viniciustinti@gmail.com>
---
 fs/ext4/namei.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index cf652ba3e74d..1f64dbd7237b 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -827,21 +827,6 @@ dx_probe(struct ext4_filename *fname, struct inode *dir,
 				p = m + 1;
 		}
 
-		if (0) { // linear search cross check
-			unsigned n = count - 1;
-			at = entries;
-			while (n--)
-			{
-				dxtrace(printk(KERN_CONT ","));
-				if (dx_get_hash(++at) > hash)
-				{
-					at--;
-					break;
-				}
-			}
-			ASSERT(at == p - 1);
-		}
-
 		at = p - 1;
 		dxtrace(printk(KERN_CONT " %x->%u\n",
 			       at == entries ? 0 : dx_get_hash(at),
-- 
2.25.1


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

end of thread, other threads:[~2021-02-03  9:52 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29 18:58 [PATCH] ext4: Remove unreachable code Vinicius Tinti
2021-01-30  1:35 ` Nathan Chancellor
2021-01-30  6:42 ` Andreas Dilger
2021-02-01  0:31   ` [PATCH v2] ext4: Enable code path when DX_DEBUG is set Vinicius Tinti
2021-02-01  0:48     ` Nathan Chancellor
2021-02-01 12:49     ` Christoph Hellwig
2021-02-01 16:15       ` Vinicius Tinti
2021-02-01 17:13         ` Theodore Ts'o
2021-02-01 18:41           ` Vinicius Tinti
2021-02-01 20:45             ` Andreas Dilger
2021-02-01 21:09             ` Theodore Ts'o
2021-02-01 21:16               ` Nick Desaulniers
2021-02-01 21:38                 ` Theodore Ts'o
2021-02-01 21:41                   ` Nick Desaulniers
2021-02-01 22:05                     ` Vinicius Tinti
2021-02-01 22:48                       ` Theodore Ts'o
2021-02-01 23:09                         ` Nick Desaulniers
2021-02-02  8:05           ` Christoph Hellwig
2021-02-02 16:28             ` [PATCH v3] " Vinicius Tinti
2021-02-03  5:39               ` Theodore Ts'o
2021-02-03  9:51                 ` Vinicius Tinti
2021-02-01 16:58       ` [PATCH v2] " Theodore Ts'o

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.