Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1777692rwd; Fri, 9 Jun 2023 01:53:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6a2vjKmA404xbZY9tzS3KIV7I8QyiCquClsJw3smpZoDCJG4/PjZtOGSHM/IMn4vx/RIfB X-Received: by 2002:a05:6a20:2588:b0:10b:f590:5a1f with SMTP id k8-20020a056a20258800b0010bf5905a1fmr491341pzd.0.1686300791805; Fri, 09 Jun 2023 01:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686300791; cv=none; d=google.com; s=arc-20160816; b=zwm8AtuY+FB+PkT2UA0qzg9mhdmHETKEn/qwEPQpgsrTBMZtFCw+XY9Twf6UIxQJro e3ckjIrKIz07zsh1N9ejoTPDtCymrzpnQJiN0hnyKlyakqQkJ3FZpKNTcg4jMPUBoDtk +WlUxJIuNe34ZOQW/euYPwE+yiOKm7IeI52bXrDnUMBUgp/c38Vpy6BAa0hVaQPKy7rv xfFrQQcTsXNf4oglDqwEcgo51zoy3PXwgSttgiAvAvgHAc53N00OkoSkKONbibyZuQFx bI1V9o8CJgLpwAIpC/q4IOgZPVMG4izslayfUpilytv3F0txS+ssm0pZj1Lsh+4vaimQ YeBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=svVwD/BTai5jISNLm/JThU+KRmzCzNWbxRbPZDBdwzQ=; b=ZyE7pGVPmQ4Lu2vclSRAWSUw3EQhyZ/WQX4vBgPZyHpqkN7fqNeRiMSRnK7nnR0ftf 5b/fszuTyLiesG0H+DEey9lu5zxY/V8uObGKlrmc2YRRfg52aIHTy6UhkRcgDvGHp9KY jd6ZiiortoRsH/HhNMCBjOw471l9t9lhuZcaP3E3XpjpUfKR9U/rp1OA2iSnGd4/Ni1R m6dzDno1xRJTGP7lWDCznm2Rg2sm6sAqkSJG2RTsUG/c+CId2OAZNKsvq6B/TQk92sQ8 4buZu6ZBBwj0A/xM9YjYt3ezXv9cBS1iohCWciP1RdCUoupsy4uJISPt51bem1Gj5WdE t7JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HpLB5bZL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a27-20020a63705b000000b0053f27c5efe4si2319858pgn.857.2023.06.09.01.52.57; Fri, 09 Jun 2023 01:53:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HpLB5bZL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230476AbjFIIbF (ORCPT + 99 others); Fri, 9 Jun 2023 04:31:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241099AbjFIIas (ORCPT ); Fri, 9 Jun 2023 04:30:48 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCFC526B9 for ; Fri, 9 Jun 2023 01:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686299390; x=1717835390; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=huJyQhIeFIRe6uvIx6xL3OI0227aQKD8M0QcvxpIZ6M=; b=HpLB5bZL6IX2xaPJP0l/mXt9xUKnKt6Iw4dPUFsCcs004GCPoMSEYTtY hmyKeMPFfVEVyB/7FcljofSTkRYHjbZTAkuV620CwMK8M1OF+9hB6aHA/ Tr2yAcQPIFOxN6Zi3HT5nzfVC/TW18f/jKPnuBqZ4TfdvgzQF9+M5AKgX E5gCQhDlRM8VYnJMboZPz/Tg/tdywjxQdRZqWItJSGsmYTjcnYxxk5M1R Ysyjn5+DKNbbJMRw66P2Y+z3plPSMMGU3qGLCQWr9Q0wS8dhxhQ8gSQli a64qYF2tmGE2dZFO65gAwQ1sY0wWxQ/xcgGGp47RZ5khPZCDtSHrCnKTq Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="385904134" X-IronPort-AV: E=Sophos;i="6.00,228,1681196400"; d="scan'208";a="385904134" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2023 01:29:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="800146324" X-IronPort-AV: E=Sophos;i="6.00,228,1681196400"; d="scan'208";a="800146324" Received: from lkp-server01.sh.intel.com (HELO 15ab08e44a81) ([10.239.97.150]) by FMSMGA003.fm.intel.com with ESMTP; 09 Jun 2023 01:28:58 -0700 Received: from kbuild by 15ab08e44a81 with local (Exim 4.96) (envelope-from ) id 1q7XUQ-0008qm-05; Fri, 09 Jun 2023 08:28:58 +0000 Date: Fri, 9 Jun 2023 16:28:24 +0800 From: kernel test robot To: Lu Hongfei , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , open list Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Linux Memory Management List , opensource.kernel@vivo.com, luhongfei@vivo.com Subject: Re: [PATCH] mm/vmalloc: Replace the ternary conditional operator with min() Message-ID: <202306091647.GzAdThKz-lkp@intel.com> References: <20230609061309.42453-1-luhongfei@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230609061309.42453-1-luhongfei@vivo.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lu, kernel test robot noticed the following build warnings: [auto build test WARNING on akpm-mm/mm-everything] url: https://github.com/intel-lab-lkp/linux/commits/Lu-Hongfei/mm-vmalloc-Replace-the-ternary-conditional-operator-with-min/20230609-141417 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20230609061309.42453-1-luhongfei%40vivo.com patch subject: [PATCH] mm/vmalloc: Replace the ternary conditional operator with min() config: hexagon-randconfig-r016-20230608 (https://download.01.org/0day-ci/archive/20230609/202306091647.GzAdThKz-lkp@intel.com/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): mkdir -p ~/bin wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git remote add akpm-mm https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git git fetch akpm-mm mm-everything git checkout akpm-mm/mm-everything b4 shazam https://lore.kernel.org/r/20230609061309.42453-1-luhongfei@vivo.com # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=hexagon olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash 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/202306091647.GzAdThKz-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from mm/vmalloc.c:14: In file included from include/linux/highmem.h:12: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __raw_readb(PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) ^ In file included from mm/vmalloc.c:14: In file included from include/linux/highmem.h:12: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) ^ In file included from mm/vmalloc.c:14: In file included from include/linux/highmem.h:12: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writeb(value, PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ >> mm/vmalloc.c:3574:9: warning: comparison of distinct pointer types ('typeof (remains) *' (aka 'unsigned int *') and 'typeof ((1UL << 12)) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types] num = min(remains, PAGE_SIZE); ^~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:67:19: note: expanded from macro 'min' #define min(x, y) __careful_cmp(x, y, <) ^~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp' __builtin_choose_expr(__safe_cmp(x, y), \ ^~~~~~~~~~~~~~~~ include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp' (__typecheck(x, y) && __no_side_effects(x, y)) ^~~~~~~~~~~~~~~~~ include/linux/minmax.h:20:28: note: expanded from macro '__typecheck' (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ 7 warnings generated. vim +3574 mm/vmalloc.c 3561 3562 /* 3563 * Atomically zero bytes in the iterator. 3564 * 3565 * Returns the number of zeroed bytes. 3566 */ 3567 static size_t zero_iter(struct iov_iter *iter, size_t count) 3568 { 3569 size_t remains = count; 3570 3571 while (remains > 0) { 3572 size_t num, copied; 3573 > 3574 num = min(remains, PAGE_SIZE); 3575 copied = copy_page_to_iter_nofault(ZERO_PAGE(0), 0, num, iter); 3576 remains -= copied; 3577 3578 if (copied < num) 3579 break; 3580 } 3581 3582 return count - remains; 3583 } 3584 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki