Messages in this thread Patch in this message | | | From | Guo Zhengkui <> | Subject | [PATCH] lib: fix uninitialized_var.cocci warning | Date | Wed, 16 Mar 2022 15:27:09 +0800 |
| |
fix following coccicheck warning: lib/glob.c:48:40-41: WARNING this kind of initialization is deprecated.
`char const *back_str = back_str` has the same form of uninitialized_var() macro. I remove the redundant assignement. It has been tested with gcc (Debian 8.3.0-6) 8.3.0.
The patch which removed uninitialized_var() is: https://lore.kernel.org/all/20121028102007.GA7547@gmail.com/ And there is very few "/* GCC */" comments in the Linux kernel code now.
Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com> --- lib/glob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/glob.c b/lib/glob.c index 85ecbda45cd8..15b73f490720 100644 --- a/lib/glob.c +++ b/lib/glob.c @@ -45,7 +45,7 @@ bool __pure glob_match(char const *pat, char const *str) * (no exception for /), it can be easily proved that there's * never a need to backtrack multiple levels. */ - char const *back_pat = NULL, *back_str = back_str; + char const *back_pat = NULL, *back_str; /* * Loop over each token (character or class) in pat, matching -- 2.20.1
| |