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 C1AD1C7618A for ; Mon, 20 Mar 2023 15:37:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232871AbjCTPh0 (ORCPT ); Mon, 20 Mar 2023 11:37:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232966AbjCTPgy (ORCPT ); Mon, 20 Mar 2023 11:36:54 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 416B5303D9; Mon, 20 Mar 2023 08:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679326127; x=1710862127; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=/fRnRCW+Rd918Lokio/1z6rWnclRA6bccd8kJtT6fQI=; b=kT5v93WWC6jlObR0mNTAu/I/sOOqoCN9sEeMCnEZepdqM3osc9mYQP3l i9UveTSA/L47l5PuXczis33IxShChyDISaX7haAoaaDdXzSCJsyklj/If wdzXs5Hjfxr28cCPt137CImt5J0G5mx3v3355mxvWgVx6/BqXIzRMqVfz QpFzglAAMf1Rbma4wm3nQ38idLZTRHbxoq35m+o8KIJoDzO+mf2ZxIqnV NkHeqxWR2fGnHw+RdLWLugJEHfOGPk+lUo5sR713j7KTYXVaf04OPUIA1 td+A3aeZqQMtRywwbYOl4m9eBYL1zLHzyUgL14lDYxojGpGvnTk/W8dIo A==; X-IronPort-AV: E=McAfee;i="6600,9927,10655"; a="338718182" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="338718182" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2023 08:27:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10655"; a="750148546" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="750148546" Received: from lkp-server01.sh.intel.com (HELO b613635ddfff) ([10.239.97.150]) by fmsmga004.fm.intel.com with ESMTP; 20 Mar 2023 08:27:47 -0700 Received: from kbuild by b613635ddfff with local (Exim 4.96) (envelope-from ) id 1peHQI-000B74-28; Mon, 20 Mar 2023 15:27:46 +0000 Date: Mon, 20 Mar 2023 23:27:14 +0800 From: kernel test robot To: Sumitra Sharma , Marc Dietrich , Greg Kroah-Hartman , ac100@lists.launchpad.net, linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, outreachy@lists.linux.dev Cc: oe-kbuild-all@lists.linux.dev Subject: Re: [PATCH v2] Staging: nvec: Convert to_nvec_led from a macro to an inline function Message-ID: <202303202327.ojGuSQqT-lkp@intel.com> References: <20230318175250.GA49618@sumitra.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230318175250.GA49618@sumitra.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sumitra, Thank you for the patch! Yet something to improve: [auto build test ERROR on staging/staging-testing] url: https://github.com/intel-lab-lkp/linux/commits/Sumitra-Sharma/Staging-nvec-Convert-to_nvec_led-from-a-macro-to-an-inline-function/20230319-015434 patch link: https://lore.kernel.org/r/20230318175250.GA49618%40sumitra.com patch subject: [PATCH v2] Staging: nvec: Convert to_nvec_led from a macro to an inline function config: arm-allyesconfig (https://download.01.org/0day-ci/archive/20230320/202303202327.ojGuSQqT-lkp@intel.com/config) compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/5bb6b930cab3ac631310d3bbf40c9decf91dfd38 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Sumitra-Sharma/Staging-nvec-Convert-to_nvec_led-from-a-macro-to-an-inline-function/20230319-015434 git checkout 5bb6b930cab3ac631310d3bbf40c9decf91dfd38 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/staging/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-kbuild-all/202303202327.ojGuSQqT-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from include/linux/container_of.h:5, from include/linux/list.h:5, from include/linux/module.h:12, from drivers/staging/nvec/nvec_paz00.c:10: drivers/staging/nvec/nvec_paz00.c: In function 'to_nvec_led': >> include/linux/container_of.h:20:54: error: invalid use of undefined type 'struct nvec_led' 20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \ | ^~ include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert' 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) | ^~~~ include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert' 20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \ | ^~~~~~~~~~~~~ include/linux/container_of.h:20:23: note: in expansion of macro '__same_type' 20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \ | ^~~~~~~~~~~ drivers/staging/nvec/nvec_paz00.c:19:16: note: in expansion of macro 'container_of' 19 | return container_of(led_cdev, struct nvec_led, cdev); | ^~~~~~~~~~~~ include/linux/compiler_types.h:338:27: error: expression in static assertion is not an integer 338 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert' 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) | ^~~~ include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert' 20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \ | ^~~~~~~~~~~~~ include/linux/container_of.h:20:23: note: in expansion of macro '__same_type' 20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \ | ^~~~~~~~~~~ drivers/staging/nvec/nvec_paz00.c:19:16: note: in expansion of macro 'container_of' 19 | return container_of(led_cdev, struct nvec_led, cdev); | ^~~~~~~~~~~~ In file included from include/uapi/linux/posix_types.h:5, from include/uapi/linux/types.h:14, from include/linux/types.h:6, from include/linux/kasan-checks.h:5, from include/asm-generic/rwonce.h:26, from ./arch/arm/include/generated/asm/rwonce.h:1, from include/linux/compiler.h:247, from include/linux/build_bug.h:5: >> include/linux/stddef.h:16:33: error: invalid use of undefined type 'struct nvec_led' 16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER) | ^~~~~~~~~~~~~~~~~~ include/linux/container_of.h:23:28: note: in expansion of macro 'offsetof' 23 | ((type *)(__mptr - offsetof(type, member))); }) | ^~~~~~~~ drivers/staging/nvec/nvec_paz00.c:19:16: note: in expansion of macro 'container_of' 19 | return container_of(led_cdev, struct nvec_led, cdev); | ^~~~~~~~~~~~ drivers/staging/nvec/nvec_paz00.c:20:1: error: control reaches end of non-void function [-Werror=return-type] 20 | } | ^ cc1: some warnings being treated as errors vim +20 include/linux/container_of.h d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 9 d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 10 /** d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 11 * container_of - cast a member of a structure out to the containing structure d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 12 * @ptr: the pointer to the member. d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 13 * @type: the type of the container struct this is embedded in. d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 14 * @member: the name of the member within the struct. d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 15 * 7376e561fd2e01 Sakari Ailus 2022-10-24 16 * WARNING: any const qualifier of @ptr is lost. d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 17 */ d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 18 #define container_of(ptr, type, member) ({ \ d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 19 void *__mptr = (void *)(ptr); \ e1edc277e6f6df Rasmus Villemoes 2021-11-08 @20 static_assert(__same_type(*(ptr), ((type *)0)->member) || \ e1edc277e6f6df Rasmus Villemoes 2021-11-08 21 __same_type(*(ptr), void), \ d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 22 "pointer type mismatch in container_of()"); \ d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 23 ((type *)(__mptr - offsetof(type, member))); }) d2a8ebbf8192b8 Andy Shevchenko 2021-11-08 24 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests