From: Kyle Spiers Date: Fri, 9 Mar 2018 01:28:43 +0000 (-0800) Subject: reiserfs: Remove VLA from fs/reiserfs/reiserfs.h X-Git-Tag: v4.19~1287^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9cee1764b6fa97f2b4cd0210b1a125fef2e7169;p=platform%2Fkernel%2Flinux-rpi.git reiserfs: Remove VLA from fs/reiserfs/reiserfs.h Remove Variable Length Array from fs/reiserfs/reiserfs.h. EMPTY_DIR_SIZE is used as an array size and as it is using strlen() it need not be evaluated at compile time. Change it's definition to use sizeof() to force evaluation of array length at compile time. Signed-off-by: Kyle Spiers Signed-off-by: Jan Kara --- diff --git a/fs/reiserfs/reiserfs.h b/fs/reiserfs/reiserfs.h index 48835a6..ae4811f 100644 --- a/fs/reiserfs/reiserfs.h +++ b/fs/reiserfs/reiserfs.h @@ -1916,7 +1916,7 @@ struct reiserfs_de_head { /* empty directory contains two entries "." and ".." and their headers */ #define EMPTY_DIR_SIZE \ -(DEH_SIZE * 2 + ROUND_UP (strlen (".")) + ROUND_UP (strlen (".."))) +(DEH_SIZE * 2 + ROUND_UP (sizeof(".") - 1) + ROUND_UP (sizeof("..") - 1)) /* old format directories have this size when empty */ #define EMPTY_DIR_SIZE_V1 (DEH_SIZE * 2 + 3)