All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] e4defrag: fix GCC7.x compiler warning
@ 2017-06-26 15:40 Marc Thomas
  2017-06-28 17:29 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Thomas @ 2017-06-26 15:40 UTC (permalink / raw)
  To: linux-ext4

../../misc/e4defrag.c:1821:8: warning: statement will never be executed
[-Wswitch-unreachable]
    int mount_dir_len = 0;

Also fix a typo in a few comments.

Signed-off-by: Marc Thomas <marc@dragonfly.plus.com>
---
 misc/e4defrag.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/misc/e4defrag.c b/misc/e4defrag.c
index 84501d17..62860eb1 100644
--- a/misc/e4defrag.c
+++ b/misc/e4defrag.c
@@ -1676,6 +1676,7 @@ int main(int argc, char *argv[])
 	int	flags = FTW_PHYS | FTW_MOUNT;
 	int	arg_type = -1;
 	int	success_flag = 0;
+	int	mount_dir_len = 0;
 	char	dir_name[PATH_MAX + 1];
 	char	dev_name[PATH_MAX + 1];
 	struct stat64	buf;
@@ -1818,7 +1819,6 @@ int main(int argc, char *argv[])
 		}
  		switch (arg_type) {
-			int mount_dir_len = 0;
  		case DIRNAME:
 			if (!(mode_flag & STATISTIC))
@@ -1830,11 +1830,11 @@ int main(int argc, char *argv[])
 			strncat(lost_found_dir, "/lost+found",
 				PATH_MAX - strnlen(lost_found_dir, PATH_MAX));
 -			/* Not the case("e4defrag  mount_piont_dir") */
+			/* Not the case("e4defrag  mount_point_dir") */
 			if (dir_name[mount_dir_len] != '\0') {
 				/*
-				 * "e4defrag mount_piont_dir/lost+found"
-				 * or "e4defrag mount_piont_dir/lost+found/"
+				 * "e4defrag mount_point_dir/lost+found"
+				 * or "e4defrag mount_point_dir/lost+found/"
 				 */
 				if (strncmp(lost_found_dir, dir_name,
 					    strnlen(lost_found_dir,
@@ -1848,7 +1848,7 @@ int main(int argc, char *argv[])
 					continue;
 				}
 -				/* "e4defrag mount_piont_dir/else_dir" */
+				/* "e4defrag mount_point_dir/else_dir" */
 				memset(lost_found_dir, 0, PATH_MAX + 1);
 			}
 		case DEVNAME:
-- 
2.13.0

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

* Re: [PATCH 2/2] e4defrag: fix GCC7.x compiler warning
  2017-06-26 15:40 [PATCH 2/2] e4defrag: fix GCC7.x compiler warning Marc Thomas
@ 2017-06-28 17:29 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2017-06-28 17:29 UTC (permalink / raw)
  To: Marc Thomas; +Cc: linux-ext4

On Mon, Jun 26, 2017 at 04:40:39PM +0100, Marc Thomas wrote:
> ../../misc/e4defrag.c:1821:8: warning: statement will never be executed
> [-Wswitch-unreachable]
>     int mount_dir_len = 0;
> 
> Also fix a typo in a few comments.
> 
> Signed-off-by: Marc Thomas <marc@dragonfly.plus.com>

Applied, thanks.  (Again, the patch was somehow damaged, but I was able
to figure out what you were trying to change.)

   	      	       	    	   - Ted

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

end of thread, other threads:[~2017-06-28 20:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-26 15:40 [PATCH 2/2] e4defrag: fix GCC7.x compiler warning Marc Thomas
2017-06-28 17:29 ` 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.