From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0A82E748E9 for ; Sun, 1 Oct 2023 07:10:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234381AbjJAHKE (ORCPT ); Sun, 1 Oct 2023 03:10:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234351AbjJAHKD (ORCPT ); Sun, 1 Oct 2023 03:10:03 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 977DBBE for ; Sun, 1 Oct 2023 00:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696144200; x=1727680200; h=date:from:to:cc:subject:message-id:mime-version; bh=O8LO/x9HI8vE7NlP7DwrbfUWGVenFX481uUfJVYURxQ=; b=LOI3jO+AF75y1+WThEQDOlT0oXDw6SkN7d50D79GQmIWOMcTKpHclz9M chB+y4oAVpNeIfwO7r71kx1VpxLPO42uugcqSpAhGmNBepErxSXBc9dyY /10YwhqEkCA/XuF4yJwXh/rJA8X0l6G2eR3bI5EJivYgAwA4ryPE1nUs2 ag0P+/pwu6SQlQTB/oiZLyKKSXcY5xuNMcbn2BMsMddP+ht2kmkYKMaVC +G0ioRAihKQxa+vU+FnJmIfMt/W0+6m32cfy6k8jXAGjgZM72shBDzUxL wJNvLwrqieFAANSjh6AYYgdIVZxcucC0arcgA+76QAik4uyi4qyVlM/4S w==; X-IronPort-AV: E=McAfee;i="6600,9927,10849"; a="362764410" X-IronPort-AV: E=Sophos;i="6.03,191,1694761200"; d="scan'208";a="362764410" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2023 00:10:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10849"; a="779655223" X-IronPort-AV: E=Sophos;i="6.03,191,1694761200"; d="scan'208";a="779655223" Received: from lkp-server02.sh.intel.com (HELO c3b01524d57c) ([10.239.97.151]) by orsmga008.jf.intel.com with ESMTP; 01 Oct 2023 00:09:51 -0700 Received: from kbuild by c3b01524d57c with local (Exim 4.96) (envelope-from ) id 1qmqaL-0004rt-1T; Sun, 01 Oct 2023 07:09:49 +0000 Date: Sun, 1 Oct 2023 15:09:18 +0800 From: kernel test robot To: WANG Xuerui Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Huacai Chen Subject: include/linux/build_bug.h:16:51: error: bit-field '' width not an integer constant Message-ID: <202310011507.dV9SV80o-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: e402b08634b398e9feb94902c7adcf05bb8ba47d commit: 3f301dc292eb122eff61b8b2906e519154b0327f LoongArch: Replace -ffreestanding with finer-grained -fno-builtin's date: 5 weeks ago config: loongarch-loongson3_defconfig (https://download.01.org/0day-ci/archive/20231001/202310011507.dV9SV80o-lkp@intel.com/config) compiler: loongarch64-linux-gcc (GCC) 12.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231001/202310011507.dV9SV80o-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 | Closes: https://lore.kernel.org/oe-kbuild-all/202310011507.dV9SV80o-lkp@intel.com/ All error/warnings (new ones prefixed by >>): In file included from include/linux/percpu.h:13, from include/linux/context_tracking_state.h:5, from include/linux/hardirq.h:5, from include/linux/interrupt.h:11, from sound/pci/bt87x.c:11: arch/loongarch/include/asm/percpu.h:20:4: error: #error compiler support for the model attribute is necessary when a recent assembler is used 20 | # error compiler support for the model attribute is necessary when a recent assembler is used | ^~~~~ In file included from include/linux/init.h:5, from sound/pci/bt87x.c:10: >> include/linux/build_bug.h:16:51: error: bit-field '' width not an integer constant 16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); }))) | ^ include/linux/compiler.h:231:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO' 231 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) | ^~~~~~~~~~~~~~~~~ include/linux/kernel.h:56:59: note: in expansion of macro '__must_be_array' 56 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) | ^~~~~~~~~~~~~~~ include/linux/moduleparam.h:517:20: note: in expansion of macro 'ARRAY_SIZE' 517 | = { .max = ARRAY_SIZE(array), .num = nump, \ | ^~~~~~~~~~ include/linux/moduleparam.h:501:9: note: in expansion of macro 'module_param_array_named' 501 | module_param_array_named(name, name, type, nump, perm) | ^~~~~~~~~~~~~~~~~~~~~~~~ sound/pci/bt87x.c:33:1: note: in expansion of macro 'module_param_array' 33 | module_param_array(index, int, NULL, 0444); | ^~~~~~~~~~~~~~~~~~ >> sound/pci/bt87x.c:27:12: warning: 'index' defined but not used [-Wunused-variable] 27 | static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */ | ^~~~~ -- In file included from include/linux/irqflags.h:18, from include/linux/spinlock.h:59, from include/linux/mmzone.h:8, from include/linux/gfp.h:7, from include/linux/slab.h:16, from sound/usb/card.c:26: arch/loongarch/include/asm/percpu.h:20:4: error: #error compiler support for the model attribute is necessary when a recent assembler is used 20 | # error compiler support for the model attribute is necessary when a recent assembler is used | ^~~~~ In file included from include/linux/bits.h:21, from include/linux/bitops.h:6, from sound/usb/card.c:23: >> include/linux/build_bug.h:16:51: error: bit-field '' width not an integer constant 16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); }))) | ^ include/linux/compiler.h:231:33: note: in expansion of macro 'BUILD_BUG_ON_ZERO' 231 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) | ^~~~~~~~~~~~~~~~~ include/linux/kernel.h:56:59: note: in expansion of macro '__must_be_array' 56 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) | ^~~~~~~~~~~~~~~ include/linux/moduleparam.h:517:20: note: in expansion of macro 'ARRAY_SIZE' 517 | = { .max = ARRAY_SIZE(array), .num = nump, \ | ^~~~~~~~~~ include/linux/moduleparam.h:501:9: note: in expansion of macro 'module_param_array_named' 501 | module_param_array_named(name, name, type, nump, perm) | ^~~~~~~~~~~~~~~~~~~~~~~~ sound/usb/card.c:81:1: note: in expansion of macro 'module_param_array' 81 | module_param_array(index, int, NULL, 0444); | ^~~~~~~~~~~~~~~~~~ >> sound/usb/card.c:63:12: warning: 'index' defined but not used [-Wunused-variable] 63 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | ^~~~~ vim +16 include/linux/build_bug.h bc6245e5efd70c Ian Abbott 2017-07-10 6 bc6245e5efd70c Ian Abbott 2017-07-10 7 #ifdef __CHECKER__ bc6245e5efd70c Ian Abbott 2017-07-10 8 #define BUILD_BUG_ON_ZERO(e) (0) bc6245e5efd70c Ian Abbott 2017-07-10 9 #else /* __CHECKER__ */ bc6245e5efd70c Ian Abbott 2017-07-10 10 /* bc6245e5efd70c Ian Abbott 2017-07-10 11 * Force a compilation error if condition is true, but also produce a 8788994376d84d Rikard Falkeborn 2019-12-04 12 * result (of value 0 and type int), so the expression can be used bc6245e5efd70c Ian Abbott 2017-07-10 13 * e.g. in a structure initializer (or where-ever else comma expressions bc6245e5efd70c Ian Abbott 2017-07-10 14 * aren't permitted). bc6245e5efd70c Ian Abbott 2017-07-10 15 */ 8788994376d84d Rikard Falkeborn 2019-12-04 @16 #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); }))) 527edbc18a70e7 Masahiro Yamada 2019-01-03 17 #endif /* __CHECKER__ */ 527edbc18a70e7 Masahiro Yamada 2019-01-03 18 :::::: The code at line 16 was first introduced by commit :::::: 8788994376d84d627450fd0d67deb6a66ddf07d7 linux/build_bug.h: change type to int :::::: TO: Rikard Falkeborn :::::: CC: Linus Torvalds -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki