CC: [email protected] CC: [email protected] In-Reply-To: <[email protected]> References: <[email protected]> TO: Mathieu Poirier <[email protected]>
Hi Mathieu, I love your patch! Perhaps something to improve: [auto build test WARNING on soc/for-next] [also build test WARNING on linux/master linus/master v5.14-rc6 next-20210818] [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] url: https://github.com/0day-ci/linux/commits/Mathieu-Poirier/coresight-Patches-for-v5-15/20210819-034401 base: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next :::::: branch date: 16 hours ago :::::: commit date: 16 hours ago config: arm-randconfig-c002-20210818 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce) 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 # install arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/0day-ci/linux/commit/8d9f1390359db3ab9196b09a70a9b868c8293531 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Mathieu-Poirier/coresight-Patches-for-v5-15/20210819-034401 git checkout 8d9f1390359db3ab9196b09a70a9b868c8293531 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) ^ include/asm-generic/bitops/fls.h:27:6: note: Assuming the condition is false if (!(x & 0xf0000000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:27:2: note: Taking false branch if (!(x & 0xf0000000u)) { ^ include/asm-generic/bitops/fls.h:31:6: note: Assuming the condition is false if (!(x & 0xc0000000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:31:2: note: Taking false branch if (!(x & 0xc0000000u)) { ^ include/asm-generic/bitops/fls.h:35:6: note: Assuming the condition is false if (!(x & 0x80000000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:35:2: note: Taking false branch if (!(x & 0x80000000u)) { ^ include/asm-generic/bitops/fls.h:39:2: note: Returning the value 32 (loaded from 'r') return r; ^~~~~~~~ include/asm-generic/getorder.h:44:9: note: Returning from 'fls' return fls(size); ^~~~~~~~~ include/asm-generic/getorder.h:44:2: note: Returning the value 32 return fls(size); ^~~~~~~~~~~~~~~~ drivers/mmc/core/mmc_test.c:372:11: note: Returning from 'get_order' order = get_order(max_seg_page_cnt << PAGE_SHIFT); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mmc/core/mmc_test.c:372:3: note: The value 32 is assigned to 'order' order = get_order(max_seg_page_cnt << PAGE_SHIFT); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mmc/core/mmc_test.c:373:3: note: Loop condition is true. Entering loop body while (1) { ^ drivers/mmc/core/mmc_test.c:374:11: note: Calling 'alloc_pages' page = alloc_pages(flags, order); ^~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/gfp.h:597:9: note: Calling 'alloc_pages_node' return alloc_pages_node(numa_node_id(), gfp_mask, order); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/gfp.h:581:2: note: Taking false branch if (nid == NUMA_NO_NODE) ^ include/linux/gfp.h:584:2: note: Returning pointer, which participates in a condition later return __alloc_pages_node(nid, gfp_mask, order); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/gfp.h:597:9: note: Returning from 'alloc_pages_node' return alloc_pages_node(numa_node_id(), gfp_mask, order); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/gfp.h:597:2: note: Returning pointer, which participates in a condition later return alloc_pages_node(numa_node_id(), gfp_mask, order); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mmc/core/mmc_test.c:374:11: note: Returning from 'alloc_pages' page = alloc_pages(flags, order); ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mmc/core/mmc_test.c:375:8: note: Assuming 'page' is non-null if (page || !order) ^~~~ drivers/mmc/core/mmc_test.c:375:13: note: Left side of '||' is true if (page || !order) ^ drivers/mmc/core/mmc_test.c:376:5: note: Execution continues on line 379 break; ^ drivers/mmc/core/mmc_test.c:379:8: note: 'page' is non-null if (!page) { ^~~~ drivers/mmc/core/mmc_test.c:379:3: note: Taking false branch if (!page) { ^ drivers/mmc/core/mmc_test.c:387:28: note: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'unsigned long' if (max_page_cnt <= (1UL << order)) ^ ~~~~~ Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. drivers/char/pcmcia/cm4000_cs.c:1571:4: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores] rc = 0; ^ ~ drivers/char/pcmcia/cm4000_cs.c:1571:4: note: Value stored to 'rc' is never read rc = 0; ^ ~ Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. drivers/char/pcmcia/cm4040_cs.c:538:2: warning: Value stored to 'dev' is never read [clang-analyzer-deadcode.DeadStores] dev = link->priv; ^ ~~~~~~~~~~ drivers/char/pcmcia/cm4040_cs.c:538:2: note: Value stored to 'dev' is never read dev = link->priv; ^ ~~~~~~~~~~ Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 7 warnings generated. >> drivers/hwtracing/coresight/coresight-syscfg.c:124:2: warning: Undefined or >> garbage value returned to caller >> [clang-analyzer-core.uninitialized.UndefReturn] return err; ^ ~~~ drivers/hwtracing/coresight/coresight-syscfg.c:91:6: note: 'err' declared without an initial value int err, i = 0; ^~~ drivers/hwtracing/coresight/coresight-syscfg.c:96:6: note: Assuming 'feat_descs' is null if (feat_descs) { ^~~~~~~~~~ drivers/hwtracing/coresight/coresight-syscfg.c:96:2: note: Taking false branch if (feat_descs) { ^ drivers/hwtracing/coresight/coresight-syscfg.c:110:6: note: Assuming 'config_descs' is null if (config_descs) { ^~~~~~~~~~~~ drivers/hwtracing/coresight/coresight-syscfg.c:110:2: note: Taking false branch if (config_descs) { ^ drivers/hwtracing/coresight/coresight-syscfg.c:124:2: note: Undefined or garbage value returned to caller return err; ^ ~~~ Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 10 warnings generated. drivers/hwtracing/coresight/coresight-tmc-etr.c:763:33: warning: Value stored to 'etr' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct coresight_device *tmp, *etr = drvdata->csdev; ^~~ ~~~~~~~~~~~~~~ drivers/hwtracing/coresight/coresight-tmc-etr.c:763:33: note: Value stored to 'etr' during its initialization is never read struct coresight_device *tmp, *etr = drvdata->csdev; ^~~ ~~~~~~~~~~~~~~ drivers/hwtracing/coresight/coresight-tmc-etr.c:902:2: warning: Called function pointer is null (null dereference) [clang-analyzer-core.CallAndMessage] etr_buf->ops->free(etr_buf); ^ drivers/hwtracing/coresight/coresight-tmc-etr.c:1408:6: note: Assuming 'etr_buf' is non-null if (!etr_buf) ^~~~~~~~ drivers/hwtracing/coresight/coresight-tmc-etr.c:1408:2: note: Taking false branch if (!etr_buf) ^ drivers/hwtracing/coresight/coresight-tmc-etr.c:1413:2: note: Taking false branch if (!refcount_dec_and_test(&etr_buf->refcount)) { ^ drivers/hwtracing/coresight/coresight-tmc-etr.c:1426:6: note: Assuming 'buf' is null if (buf && WARN_ON(buf != etr_buf)) ^~~ drivers/hwtracing/coresight/coresight-tmc-etr.c:1426:10: note: Left side of '&&' is false if (buf && WARN_ON(buf != etr_buf)) ^ drivers/hwtracing/coresight/coresight-tmc-etr.c:1429:2: note: Calling 'tmc_free_etr_buf' tmc_free_etr_buf(etr_perf->etr_buf); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/hwtracing/coresight/coresight-tmc-etr.c:901:10: note: Assuming field 'ops' is non-null WARN_ON(!etr_buf->ops || !etr_buf->ops->free); ^ include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON' int __ret_warn_on = !!(condition); \ ^~~~~~~~~ drivers/hwtracing/coresight/coresight-tmc-etr.c:901:10: note: Left side of '||' is false WARN_ON(!etr_buf->ops || !etr_buf->ops->free); ^ drivers/hwtracing/coresight/coresight-tmc-etr.c:901:27: note: Assuming field 'free' is null WARN_ON(!etr_buf->ops || !etr_buf->ops->free); ^ include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON' int __ret_warn_on = !!(condition); \ ^~~~~~~~~ drivers/hwtracing/coresight/coresight-tmc-etr.c:901:2: note: Taking true branch WARN_ON(!etr_buf->ops || !etr_buf->ops->free); ^ include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON' if (unlikely(__ret_warn_on)) \ ^ drivers/hwtracing/coresight/coresight-tmc-etr.c:901:2: note: Loop condition is false. Exiting loop WARN_ON(!etr_buf->ops || !etr_buf->ops->free); ^ include/asm-generic/bug.h:123:3: note: expanded from macro 'WARN_ON' __WARN(); \ ^ include/asm-generic/bug.h:88:19: note: expanded from macro '__WARN' #define __WARN() __WARN_printf(TAINT_WARN, NULL) ^ include/asm-generic/bug.h:90:3: note: expanded from macro '__WARN_printf' instrumentation_begin(); \ ^ include/linux/instrumentation.h:57:34: note: expanded from macro 'instrumentation_begin' # define instrumentation_begin() do { } while(0) ^ drivers/hwtracing/coresight/coresight-tmc-etr.c:901:2: note: Loop condition is false. Exiting loop WARN_ON(!etr_buf->ops || !etr_buf->ops->free); ^ include/asm-generic/bug.h:123:3: note: expanded from macro 'WARN_ON' __WARN(); \ ^ include/asm-generic/bug.h:88:19: note: expanded from macro '__WARN' #define __WARN() __WARN_printf(TAINT_WARN, NULL) vim +124 drivers/hwtracing/coresight/coresight-syscfg.c 8d9f1390359db3 Mike Leach 2021-08-18 77 8d9f1390359db3 Mike Leach 2021-08-18 78 /** 8d9f1390359db3 Mike Leach 2021-08-18 79 * cscfg_load_config_sets - API function to load feature and config sets. 8d9f1390359db3 Mike Leach 2021-08-18 80 * 8d9f1390359db3 Mike Leach 2021-08-18 81 * Take a 0 terminated array of feature descriptors and/or configuration 8d9f1390359db3 Mike Leach 2021-08-18 82 * descriptors and load into the system. 8d9f1390359db3 Mike Leach 2021-08-18 83 * Features are loaded first to ensure configuration dependencies can be met. 8d9f1390359db3 Mike Leach 2021-08-18 84 * 8d9f1390359db3 Mike Leach 2021-08-18 85 * @config_descs: 0 terminated array of configuration descriptors. 8d9f1390359db3 Mike Leach 2021-08-18 86 * @feat_descs: 0 terminated array of feature descriptors. 8d9f1390359db3 Mike Leach 2021-08-18 87 */ 8d9f1390359db3 Mike Leach 2021-08-18 88 int cscfg_load_config_sets(struct cscfg_config_desc **config_descs, 8d9f1390359db3 Mike Leach 2021-08-18 89 struct cscfg_feature_desc **feat_descs) 8d9f1390359db3 Mike Leach 2021-08-18 90 { 8d9f1390359db3 Mike Leach 2021-08-18 91 int err, i = 0; 8d9f1390359db3 Mike Leach 2021-08-18 92 8d9f1390359db3 Mike Leach 2021-08-18 93 mutex_lock(&cscfg_mutex); 8d9f1390359db3 Mike Leach 2021-08-18 94 8d9f1390359db3 Mike Leach 2021-08-18 95 /* load features first */ 8d9f1390359db3 Mike Leach 2021-08-18 96 if (feat_descs) { 8d9f1390359db3 Mike Leach 2021-08-18 97 while (feat_descs[i]) { 8d9f1390359db3 Mike Leach 2021-08-18 98 err = cscfg_load_feat(feat_descs[i]); 8d9f1390359db3 Mike Leach 2021-08-18 99 if (err) { 8d9f1390359db3 Mike Leach 2021-08-18 100 pr_err("coresight-syscfg: Failed to load feature %s\n", 8d9f1390359db3 Mike Leach 2021-08-18 101 feat_descs[i]->name); 8d9f1390359db3 Mike Leach 2021-08-18 102 goto exit_unlock; 8d9f1390359db3 Mike Leach 2021-08-18 103 } 8d9f1390359db3 Mike Leach 2021-08-18 104 i++; 8d9f1390359db3 Mike Leach 2021-08-18 105 } 8d9f1390359db3 Mike Leach 2021-08-18 106 } 8d9f1390359db3 Mike Leach 2021-08-18 107 8d9f1390359db3 Mike Leach 2021-08-18 108 /* next any configurations to check feature dependencies */ 8d9f1390359db3 Mike Leach 2021-08-18 109 i = 0; 8d9f1390359db3 Mike Leach 2021-08-18 110 if (config_descs) { 8d9f1390359db3 Mike Leach 2021-08-18 111 while (config_descs[i]) { 8d9f1390359db3 Mike Leach 2021-08-18 112 err = cscfg_load_config(config_descs[i]); 8d9f1390359db3 Mike Leach 2021-08-18 113 if (err) { 8d9f1390359db3 Mike Leach 2021-08-18 114 pr_err("coresight-syscfg: Failed to load configuration %s\n", 8d9f1390359db3 Mike Leach 2021-08-18 115 config_descs[i]->name); 8d9f1390359db3 Mike Leach 2021-08-18 116 goto exit_unlock; 8d9f1390359db3 Mike Leach 2021-08-18 117 } 8d9f1390359db3 Mike Leach 2021-08-18 118 i++; 8d9f1390359db3 Mike Leach 2021-08-18 119 } 8d9f1390359db3 Mike Leach 2021-08-18 120 } 8d9f1390359db3 Mike Leach 2021-08-18 121 8d9f1390359db3 Mike Leach 2021-08-18 122 exit_unlock: 8d9f1390359db3 Mike Leach 2021-08-18 123 mutex_unlock(&cscfg_mutex); 8d9f1390359db3 Mike Leach 2021-08-18 @124 return err; 8d9f1390359db3 Mike Leach 2021-08-18 125 } 8d9f1390359db3 Mike Leach 2021-08-18 126 EXPORT_SYMBOL_GPL(cscfg_load_config_sets); 8d9f1390359db3 Mike Leach 2021-08-18 127 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
