[PATCH] scripts: kconfig: merge_config.sh: fix unexpected operator warning

Weizhao Ouyang posted 1 patch 1 month ago
scripts/kconfig/merge_config.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] scripts: kconfig: merge_config.sh: fix unexpected operator warning
Posted by Weizhao Ouyang 1 month ago
Fix a warning for:

$ ./scripts/kconfig/merge_config.sh .config extra.config
Using .config as base
Merging extra.config
./scripts/kconfig/merge_config.sh: 384: [: false: unexpected operator

The shellcheck report is also attached:

if [ "$STRICT" == "true" ] && [ "$STRICT_MODE_VIOLATED" == "true" ]; then
               ^-- SC3014 (warning): In POSIX sh, == in place of = is undefined.
                                                        ^-- SC3014 (warning): In POSIX sh, == in place of = is undefined.

Fixes: dfc97e1c5da5 ("scripts: kconfig: merge_config.sh: use awk in checks too")
Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
---
 scripts/kconfig/merge_config.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index 735e1de450c6..073c6bec5245 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -381,7 +381,7 @@ END {
 	STRICT_MODE_VIOLATED=true
 fi
 
-if [ "$STRICT" == "true" ] && [ "$STRICT_MODE_VIOLATED" == "true" ]; then
+if [ "$STRICT" = "true" ] && [ "$STRICT_MODE_VIOLATED" = "true" ]; then
 	echo "Requested and effective config differ"
 	exit 1
 fi
-- 
2.48.1
Re: [PATCH] scripts: kconfig: merge_config.sh: fix unexpected operator warning
Posted by Nathan Chancellor 1 month ago
On Mon, 09 Mar 2026 20:15:05 +0800, Weizhao Ouyang wrote:
> Fix a warning for:
> 
> $ ./scripts/kconfig/merge_config.sh .config extra.config
> Using .config as base
> Merging extra.config
> ./scripts/kconfig/merge_config.sh: 384: [: false: unexpected operator
> 
> [...]

Applied to

  https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git kbuild-fixes

Thanks!

[1/1] scripts: kconfig: merge_config.sh: fix unexpected operator warning
      https://git.kernel.org/kbuild/c/3b4a3a00de877

Please look out for regression or issue reports or other follow up
comments, as they may result in the patch/series getting dropped or
reverted. Patches applied to an "unstable" branch are accepted pending
wider testing in -next and any post-commit review; they will generally
be moved to the main branch in a week if no issues are found.

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>
Re: [PATCH] scripts: kconfig: merge_config.sh: fix unexpected operator warning
Posted by Mikko Rapeli 1 month ago
Hi,

On Mon, Mar 09, 2026 at 08:15:05PM +0800, Weizhao Ouyang wrote:
> Fix a warning for:
> 
> $ ./scripts/kconfig/merge_config.sh .config extra.config
> Using .config as base
> Merging extra.config
> ./scripts/kconfig/merge_config.sh: 384: [: false: unexpected operator
> 
> The shellcheck report is also attached:
> 
> if [ "$STRICT" == "true" ] && [ "$STRICT_MODE_VIOLATED" == "true" ]; then
>                ^-- SC3014 (warning): In POSIX sh, == in place of = is undefined.
>                                                         ^-- SC3014 (warning): In POSIX sh, == in place of = is undefined.
> 
> Fixes: dfc97e1c5da5 ("scripts: kconfig: merge_config.sh: use awk in checks too")
> Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>

Thanks!

Reviewed-by: Mikko Rapeli <mikko.rapeli@linaro.org>

> ---
>  scripts/kconfig/merge_config.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
> index 735e1de450c6..073c6bec5245 100755
> --- a/scripts/kconfig/merge_config.sh
> +++ b/scripts/kconfig/merge_config.sh
> @@ -381,7 +381,7 @@ END {
>  	STRICT_MODE_VIOLATED=true
>  fi
>  
> -if [ "$STRICT" == "true" ] && [ "$STRICT_MODE_VIOLATED" == "true" ]; then
> +if [ "$STRICT" = "true" ] && [ "$STRICT_MODE_VIOLATED" = "true" ]; then
>  	echo "Requested and effective config differ"
>  	exit 1
>  fi
> -- 
> 2.48.1
>