Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Masahiro Yamada <masahiroy@kernel.org>, linux-kbuild@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Masahiro Yamada <masahiroy@kernel.org>
Subject: Re: [PATCH 06/16] kconfig: refactor choice value calculation
Date: Wed, 12 Jun 2024 11:06:32 +0800	[thread overview]
Message-ID: <202406121008.8zFuX4VH-lkp@intel.com> (raw)
In-Reply-To: <20240611175536.3518179-7-masahiroy@kernel.org>

Hi Masahiro,

kernel test robot noticed the following build errors:

[auto build test ERROR on masahiroy-kbuild/kbuild]
[also build test ERROR on masahiroy-kbuild/for-next next-20240611]
[cannot apply to masahiroy-kbuild/fixes linus/master v6.10-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Masahiro-Yamada/kconfig-remove-unneeded-code-in-expr_compare_type/20240612-020202
base:   https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild
patch link:    https://lore.kernel.org/r/20240611175536.3518179-7-masahiroy%40kernel.org
patch subject: [PATCH 06/16] kconfig: refactor choice value calculation
config: i386-buildonly-randconfig-002-20240612 (attached as .config)
compiler: gcc-8 (Ubuntu 8.4.0-3ubuntu2) 8.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240612/202406121008.8zFuX4VH-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406121008.8zFuX4VH-lkp@intel.com/

All errors (new ones prefixed by >>):

   scripts/kconfig/symbol.c: In function 'sym_calc_value':
>> scripts/kconfig/symbol.c:448:3: error: a label can only be part of a statement and a declaration is not a statement
      struct menu *choice_menu = sym_get_choice_menu(sym);
      ^~~~~~
   make[3]: *** [scripts/Makefile.host:133: scripts/kconfig/symbol.o] Error 1 shuffle=1413228972
   make[3]: Target 'oldconfig' not remade because of errors.
   make[2]: *** [Makefile:695: oldconfig] Error 2 shuffle=1413228972
   make[1]: *** [Makefile:240: __sub-make] Error 2 shuffle=1413228972
   make[1]: Target 'oldconfig' not remade because of errors.
   make: *** [Makefile:240: __sub-make] Error 2 shuffle=1413228972
   make: Target 'oldconfig' not remade because of errors.
--
   scripts/kconfig/symbol.c: In function 'sym_calc_value':
>> scripts/kconfig/symbol.c:448:3: error: a label can only be part of a statement and a declaration is not a statement
      struct menu *choice_menu = sym_get_choice_menu(sym);
      ^~~~~~
   make[3]: *** [scripts/Makefile.host:133: scripts/kconfig/symbol.o] Error 1 shuffle=1413228972
   make[3]: Target 'olddefconfig' not remade because of errors.
   make[2]: *** [Makefile:695: olddefconfig] Error 2 shuffle=1413228972
   make[1]: *** [Makefile:240: __sub-make] Error 2 shuffle=1413228972
   make[1]: Target 'olddefconfig' not remade because of errors.
   make: *** [Makefile:240: __sub-make] Error 2 shuffle=1413228972
   make: Target 'olddefconfig' not remade because of errors.


vim +448 scripts/kconfig/symbol.c

   398	
   399	void sym_calc_value(struct symbol *sym)
   400	{
   401		struct symbol_value newval, oldval;
   402		struct property *prop;
   403	
   404		if (!sym)
   405			return;
   406	
   407		if (sym->flags & SYMBOL_VALID)
   408			return;
   409	
   410		sym->flags |= SYMBOL_VALID;
   411	
   412		oldval = sym->curr;
   413	
   414		newval.tri = no;
   415	
   416		switch (sym->type) {
   417		case S_INT:
   418			newval.val = "0";
   419			break;
   420		case S_HEX:
   421			newval.val = "0x0";
   422			break;
   423		case S_STRING:
   424			newval.val = "";
   425			break;
   426		case S_BOOLEAN:
   427		case S_TRISTATE:
   428			newval.val = "n";
   429			break;
   430		default:
   431			sym->curr.val = sym->name;
   432			sym->curr.tri = no;
   433			return;
   434		}
   435		sym->flags &= ~SYMBOL_WRITE;
   436	
   437		sym_calc_visibility(sym);
   438	
   439		if (sym->visible != no)
   440			sym->flags |= SYMBOL_WRITE;
   441	
   442		/* set default if recursively called */
   443		sym->curr = newval;
   444	
   445		switch (sym_get_type(sym)) {
   446		case S_BOOLEAN:
   447		case S_TRISTATE:
 > 448			struct menu *choice_menu = sym_get_choice_menu(sym);
   449	
   450			if (choice_menu) {
   451				sym_calc_choice(choice_menu);
   452				newval.tri = sym->curr.tri;
   453			} else {
   454				if (sym->visible != no) {
   455					/* if the symbol is visible use the user value
   456					 * if available, otherwise try the default value
   457					 */
   458					if (sym_has_value(sym)) {
   459						newval.tri = EXPR_AND(sym->def[S_DEF_USER].tri,
   460								      sym->visible);
   461						goto calc_newval;
   462					}
   463				}
   464				if (sym->rev_dep.tri != no)
   465					sym->flags |= SYMBOL_WRITE;
   466				if (!sym_is_choice(sym)) {
   467					prop = sym_get_default_prop(sym);
   468					if (prop) {
   469						newval.tri = EXPR_AND(expr_calc_value(prop->expr),
   470								      prop->visible.tri);
   471						if (newval.tri != no)
   472							sym->flags |= SYMBOL_WRITE;
   473					}
   474					if (sym->implied.tri != no) {
   475						sym->flags |= SYMBOL_WRITE;
   476						newval.tri = EXPR_OR(newval.tri, sym->implied.tri);
   477						newval.tri = EXPR_AND(newval.tri,
   478								      sym->dir_dep.tri);
   479					}
   480				}
   481			calc_newval:
   482				if (sym->dir_dep.tri < sym->rev_dep.tri)
   483					sym_warn_unmet_dep(sym);
   484				newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri);
   485			}
   486			if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)
   487				newval.tri = yes;
   488			break;
   489		case S_STRING:
   490		case S_HEX:
   491		case S_INT:
   492			if (sym->visible != no && sym_has_value(sym)) {
   493				newval.val = sym->def[S_DEF_USER].val;
   494				break;
   495			}
   496			prop = sym_get_default_prop(sym);
   497			if (prop) {
   498				struct symbol *ds = prop_get_symbol(prop);
   499				if (ds) {
   500					sym->flags |= SYMBOL_WRITE;
   501					sym_calc_value(ds);
   502					newval.val = ds->curr.val;
   503				}
   504			}
   505			break;
   506		default:
   507			;
   508		}
   509	
   510		sym->curr = newval;
   511		sym_validate_range(sym);
   512	
   513		if (memcmp(&oldval, &sym->curr, sizeof(oldval))) {
   514			sym_set_changed(sym);
   515			if (modules_sym == sym) {
   516				sym_set_all_changed();
   517				modules_val = modules_sym->curr.tri;
   518			}
   519		}
   520	
   521		if (sym_is_choice(sym))
   522			sym->flags &= ~SYMBOL_WRITE;
   523	}
   524	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2024-06-12  3:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11 17:55 [PATCH 00/16] kconfig: fix choice value calculation with misc cleanups Masahiro Yamada
2024-06-11 17:55 ` [PATCH 01/16] kconfig: remove unneeded code in expr_compare_type() Masahiro Yamada
2024-06-11 17:55 ` [PATCH 02/16] kconfig: add fallthrough comments to expr_compare_type() Masahiro Yamada
2024-06-11 17:55 ` [PATCH 03/16] kconfig: introduce choice_set_value() helper Masahiro Yamada
2024-06-11 17:55 ` [PATCH 04/16] kconfig: remember the current choice while parsing the choice block Masahiro Yamada
2024-06-11 17:55 ` [PATCH 05/16] kconfig: import list_move() and list_move_tail() Masahiro Yamada
2024-06-11 17:55 ` [PATCH 06/16] kconfig: refactor choice value calculation Masahiro Yamada
2024-06-11 21:18   ` kernel test robot
2024-06-12  5:33     ` Masahiro Yamada
2024-06-12  3:06   ` kernel test robot [this message]
2024-06-12  5:35   ` Masahiro Yamada
2024-06-11 17:55 ` [PATCH 07/16] kconfig: remove sym_get_choice_value() Masahiro Yamada
2024-06-11 17:55 ` [PATCH 08/16] kconfig: remove conf_unsaved in conf_read_simple() Masahiro Yamada
2024-06-11 17:55 ` [PATCH 09/16] kconfig: change sym_choice_default() to take the choice menu Masahiro Yamada
2024-06-11 17:55 ` [PATCH 10/16] kconfig: use menu_list_for_each_sym() in sym_choice_default() Masahiro Yamada
2024-06-11 17:55 ` [PATCH 11/16] kconfig: remove expr_list_for_each_sym() macro Masahiro Yamada
2024-06-11 17:55 ` [PATCH 12/16] kconfig: use sym_get_choice_menu() in sym_check_print_recursive() Masahiro Yamada
2024-06-11 17:55 ` [PATCH 13/16] kconfig: use sym_get_choice_menu() in sym_check_choice_deps() Masahiro Yamada
2024-06-11 17:55 ` [PATCH 14/16] kconfig: use sym_get_choice_menu() in sym_check_deps() Masahiro Yamada
2024-06-11 17:55 ` [PATCH 15/16] kconfig: remove P_CHOICE property Masahiro Yamada
2024-06-11 17:55 ` [PATCH 16/16] kconfig: remove E_LIST expression type Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202406121008.8zFuX4VH-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox