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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE7C5EB64DD for ; Tue, 25 Jul 2023 19:37:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 34A2F6B0071; Tue, 25 Jul 2023 15:37:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F7EE6B0074; Tue, 25 Jul 2023 15:37:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BF878D0001; Tue, 25 Jul 2023 15:37:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0A2906B0071 for ; Tue, 25 Jul 2023 15:37:21 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id BB40B160EDC for ; Tue, 25 Jul 2023 19:37:20 +0000 (UTC) X-FDA: 81051143040.01.5796A2D Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf02.hostedemail.com (Postfix) with ESMTP id B60348000C for ; Tue, 25 Jul 2023 19:37:17 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=fFJDBRtF; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf02.hostedemail.com: domain of lkp@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690313838; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=GoZv2rMsz/cSEhG4uspCbFgZn6rh4Qa/3Pw8VkALCvU=; b=CdknkeJ0t2TLeiMgAvPGV9G/GiY1NlMNzlLiN2VEo6PkqSNpjKNa+PxdjPY+akLPWyK6aT RV5tYGdWjADZvJD59MNod3CUhPFNqoRmaP5Suz6Qm7jlb4sDViyCaOPiJrxMlkYN9nE28O uf3qx4WGWvILOjs1xDJLJ3hoRGJ9IBs= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=fFJDBRtF; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf02.hostedemail.com: domain of lkp@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690313838; a=rsa-sha256; cv=none; b=RTs43ivCYZswGZPYoj0VportuA8mwXqba5I+/0eFMHbhtLbR/A+0lTOeek6YxTNy13R0c9 ckK3YewLExs4mGSiHDNPr5z9vPFytWmt5uUZu3lfR5oWJD5QJsXkkeAvWGJFmYZCtRSDFF DknJ+nzw20tHX8w5NJgLf+QRGfd/Zf4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690313837; x=1721849837; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=SonwbsmHGSG68n2c1J5WDmVivVD8DKYXvlRT7mbdVPQ=; b=fFJDBRtFB4fTFWaCGmXCjP0BJhFb7Tr2/fgaFLShbwCUNf0M/yJzVHSu 1pplqXMnlTnHk8F3ruZVYnZpe+BVAhsHEQkxkA6mlByQW83P9LfMTwjx1 bVG6U2HF1LH6JXz6GTZvEtkGsfPlchHtvrAfvJBTuxeJ2BoJj85lkE8wj lIVGb57LQ0XilH+QWLwQvb2iYFKkU2tWKhLubt/GugAfezI83mH13ebiA zezqQUwqDPGgCLvLpKb1LLZygB4WgTBjnGI683E0CHXLoyehQvdXKQG7P tru1EKrsURgqvskJAz7qiIaYeNtFNHgW5mRfsliT93abTNQbbCP/+YCx+ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="367856209" X-IronPort-AV: E=Sophos;i="6.01,230,1684825200"; d="scan'208";a="367856209" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2023 12:37:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="791512094" X-IronPort-AV: E=Sophos;i="6.01,230,1684825200"; d="scan'208";a="791512094" Received: from lkp-server02.sh.intel.com (HELO 953e8cd98f7d) ([10.239.97.151]) by fmsmga008.fm.intel.com with ESMTP; 25 Jul 2023 12:37:13 -0700 Received: from kbuild by 953e8cd98f7d with local (Exim 4.96) (envelope-from ) id 1qONqK-0000I5-22; Tue, 25 Jul 2023 19:37:12 +0000 Date: Wed, 26 Jul 2023 03:36:33 +0800 From: kernel test robot To: David Laight , "'linux-kernel@vger.kernel.org'" , 'Andy Shevchenko' , 'Andrew Morton' , "'Matthew Wilcox (Oracle)'" , 'Christoph Hellwig' , "'Jason A. Donenfeld'" Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List Subject: Re: [PATCH next resend 5/5] minmax: Relax check to allow comparison between int and small unsigned constants. Message-ID: <202307260303.3ftEpZRU-lkp@intel.com> References: <48c2cd0407f14859919d4fcbe526234a@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48c2cd0407f14859919d4fcbe526234a@AcuMS.aculab.com> X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B60348000C X-Stat-Signature: b9hiw95ycbhm1qqk6cca89s9mpaj94ag X-HE-Tag: 1690313837-894651 X-HE-Meta: U2FsdGVkX18W6OYLRlrOhkPQCRKNXf7CmV9BlGAs8CNkB8I0gBqoMnROS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iPGPGfoWM6mNQPHN1PeL7EsyANgKeYCNJd/BOMrcVvooUT2xLGsLO0of3TS1jYwgjh6vhJpgF9M9f7NiyjpMfa32briSiKt52l+vqCqnCKuGArhk1CBvUE7Nt8aKIaI7jNSLhAG+ErcqZZBntJBN/wj6JCS1NWwuRLb5NKuFVSEP0t6ndCL+QpkNqRGm32Q21U4HGM1N4/ue/lCx8yLtivnhDq9M+9aAdz9uKwBYR1bUhXHDVUutNTEf95ckWqez9rzBtIZ8iy6GZvH2UCn0IV0W4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi David, kernel test robot noticed the following build warnings: [auto build test WARNING on akpm-mm/mm-everything] [also build test WARNING on linus/master v6.5-rc3 next-20230725] [cannot apply to next-20230725] [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/David-Laight/minmax-Allow-min-max-clamp-if-the-arguments-have-the-same-signedness/20230725-204940 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/48c2cd0407f14859919d4fcbe526234a%40AcuMS.aculab.com patch subject: [PATCH next resend 5/5] minmax: Relax check to allow comparison between int and small unsigned constants. config: riscv-randconfig-r024-20230725 (https://download.01.org/0day-ci/archive/20230726/202307260303.3ftEpZRU-lkp@intel.com/config) compiler: riscv32-linux-gcc (GCC) 12.3.0 reproduce: (https://download.01.org/0day-ci/archive/20230726/202307260303.3ftEpZRU-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/202307260303.3ftEpZRU-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from include/linux/kernel.h:27, from include/linux/cpumask.h:10, from include/linux/smp.h:13, from include/linux/lockdep.h:14, from include/linux/mutex.h:17, from include/linux/notifier.h:14, from include/linux/kprobes.h:21, from include/linux/kgdb.h:19, from include/linux/fb.h:6, from drivers/gpu/drm/drm_modes.c:35: drivers/gpu/drm/drm_modes.c: In function 'drm_mode_parse_command_line_for_connector': >> include/linux/minmax.h:23:22: warning: ordered comparison of pointer with integer zero [-Wextra] 23 | ((x) >= 0 && (x) <= (typeof((x) + 0))(long)__INT_MAX__)) | ^~ include/linux/minmax.h:36:27: note: in definition of macro '__cmp' 36 | #define __cmp(op, x, y) ((x) __cmp_op_##op (y) ? (x) : (y)) | ^ include/linux/minmax.h:25:47: note: in expansion of macro '__is_noneg_int' 25 | #define __int_const(x) __builtin_choose_expr(__is_noneg_int(x), (int)(long)(x), (x)) | ^~~~~~~~~~~~~~ include/linux/minmax.h:47:27: note: in expansion of macro '__int_const' 47 | __cmp(op, __int_const(x), __int_const(y)), \ | ^~~~~~~~~~~ include/linux/minmax.h:81:25: note: in expansion of macro '__careful_cmp' 81 | #define max(x, y) __careful_cmp(max, x, y) | ^~~~~~~~~~~~~ drivers/gpu/drm/drm_modes.c:2474:29: note: in expansion of macro 'max' 2474 | extra_ptr = max(bpp_end_ptr, refresh_end_ptr); | ^~~ >> include/linux/minmax.h:23:22: warning: ordered comparison of pointer with integer zero [-Wextra] 23 | ((x) >= 0 && (x) <= (typeof((x) + 0))(long)__INT_MAX__)) | ^~ include/linux/minmax.h:36:45: note: in definition of macro '__cmp' 36 | #define __cmp(op, x, y) ((x) __cmp_op_##op (y) ? (x) : (y)) | ^ include/linux/minmax.h:25:47: note: in expansion of macro '__is_noneg_int' 25 | #define __int_const(x) __builtin_choose_expr(__is_noneg_int(x), (int)(long)(x), (x)) | ^~~~~~~~~~~~~~ include/linux/minmax.h:47:43: note: in expansion of macro '__int_const' 47 | __cmp(op, __int_const(x), __int_const(y)), \ | ^~~~~~~~~~~ include/linux/minmax.h:81:25: note: in expansion of macro '__careful_cmp' 81 | #define max(x, y) __careful_cmp(max, x, y) | ^~~~~~~~~~~~~ drivers/gpu/drm/drm_modes.c:2474:29: note: in expansion of macro 'max' 2474 | extra_ptr = max(bpp_end_ptr, refresh_end_ptr); | ^~~ >> include/linux/minmax.h:23:22: warning: ordered comparison of pointer with integer zero [-Wextra] 23 | ((x) >= 0 && (x) <= (typeof((x) + 0))(long)__INT_MAX__)) | ^~ include/linux/minmax.h:36:51: note: in definition of macro '__cmp' 36 | #define __cmp(op, x, y) ((x) __cmp_op_##op (y) ? (x) : (y)) | ^ include/linux/minmax.h:25:47: note: in expansion of macro '__is_noneg_int' 25 | #define __int_const(x) __builtin_choose_expr(__is_noneg_int(x), (int)(long)(x), (x)) | ^~~~~~~~~~~~~~ include/linux/minmax.h:47:27: note: in expansion of macro '__int_const' 47 | __cmp(op, __int_const(x), __int_const(y)), \ | ^~~~~~~~~~~ include/linux/minmax.h:81:25: note: in expansion of macro '__careful_cmp' 81 | #define max(x, y) __careful_cmp(max, x, y) | ^~~~~~~~~~~~~ drivers/gpu/drm/drm_modes.c:2474:29: note: in expansion of macro 'max' 2474 | extra_ptr = max(bpp_end_ptr, refresh_end_ptr); | ^~~ >> include/linux/minmax.h:23:22: warning: ordered comparison of pointer with integer zero [-Wextra] 23 | ((x) >= 0 && (x) <= (typeof((x) + 0))(long)__INT_MAX__)) | ^~ include/linux/minmax.h:36:57: note: in definition of macro '__cmp' 36 | #define __cmp(op, x, y) ((x) __cmp_op_##op (y) ? (x) : (y)) | ^ include/linux/minmax.h:25:47: note: in expansion of macro '__is_noneg_int' 25 | #define __int_const(x) __builtin_choose_expr(__is_noneg_int(x), (int)(long)(x), (x)) | ^~~~~~~~~~~~~~ include/linux/minmax.h:47:43: note: in expansion of macro '__int_const' 47 | __cmp(op, __int_const(x), __int_const(y)), \ | ^~~~~~~~~~~ include/linux/minmax.h:81:25: note: in expansion of macro '__careful_cmp' 81 | #define max(x, y) __careful_cmp(max, x, y) | ^~~~~~~~~~~~~ drivers/gpu/drm/drm_modes.c:2474:29: note: in expansion of macro 'max' 2474 | extra_ptr = max(bpp_end_ptr, refresh_end_ptr); | ^~~ >> include/linux/minmax.h:23:22: warning: ordered comparison of pointer with integer zero [-Wextra] 23 | ((x) >= 0 && (x) <= (typeof((x) + 0))(long)__INT_MAX__)) | ^~ include/linux/minmax.h:25:47: note: in expansion of macro '__is_noneg_int' 25 | #define __int_const(x) __builtin_choose_expr(__is_noneg_int(x), (int)(long)(x), (x)) | ^~~~~~~~~~~~~~ include/linux/minmax.h:39:16: note: in expansion of macro '__int_const' 39 | typeof(__int_const(x)) unique_x = (x); \ | ^~~~~~~~~~~ include/linux/minmax.h:48:17: note: in expansion of macro '__cmp_once' 48 | __cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y))) | ^~~~~~~~~~ include/linux/minmax.h:81:25: note: in expansion of macro '__careful_cmp' 81 | #define max(x, y) __careful_cmp(max, x, y) | ^~~~~~~~~~~~~ drivers/gpu/drm/drm_modes.c:2474:29: note: in expansion of macro 'max' 2474 | extra_ptr = max(bpp_end_ptr, refresh_end_ptr); | ^~~ >> include/linux/minmax.h:23:22: warning: ordered comparison of pointer with integer zero [-Wextra] 23 | ((x) >= 0 && (x) <= (typeof((x) + 0))(long)__INT_MAX__)) | ^~ include/linux/minmax.h:25:47: note: in expansion of macro '__is_noneg_int' 25 | #define __int_const(x) __builtin_choose_expr(__is_noneg_int(x), (int)(long)(x), (x)) | ^~~~~~~~~~~~~~ include/linux/minmax.h:40:16: note: in expansion of macro '__int_const' 40 | typeof(__int_const(y)) unique_y = (y); \ | ^~~~~~~~~~~ include/linux/minmax.h:48:17: note: in expansion of macro '__cmp_once' 48 | __cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y))) | ^~~~~~~~~~ include/linux/minmax.h:81:25: note: in expansion of macro '__careful_cmp' 81 | #define max(x, y) __careful_cmp(max, x, y) | ^~~~~~~~~~~~~ drivers/gpu/drm/drm_modes.c:2474:29: note: in expansion of macro 'max' 2474 | extra_ptr = max(bpp_end_ptr, refresh_end_ptr); | ^~~ In file included from include/linux/init.h:5, from include/linux/printk.h:6, from include/asm-generic/bug.h:22, from arch/riscv/include/asm/bug.h:83, from include/linux/bug.h:5, from arch/riscv/include/asm/cmpxchg.h:9, from arch/riscv/include/asm/atomic.h:19, from include/linux/atomic.h:7, from include/linux/refcount.h:95, from include/linux/fb.h:5: >> include/linux/minmax.h:23:22: warning: ordered comparison of pointer with integer zero [-Wextra] 23 | ((x) >= 0 && (x) <= (typeof((x) + 0))(long)__INT_MAX__)) | ^~ 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/minmax.h:41:9: note: in expansion of macro 'static_assert' 41 | static_assert(__types_ok(x, y), \ | ^~~~~~~~~~~~~ include/linux/minmax.h:31:17: note: in expansion of macro '__is_noneg_int' 31 | __is_noneg_int(x) || __is_noneg_int(y)) | ^~~~~~~~~~~~~~ include/linux/minmax.h:41:23: note: in expansion of macro '__types_ok' 41 | static_assert(__types_ok(x, y), \ | ^~~~~~~~~~ include/linux/minmax.h:48:17: note: in expansion of macro '__cmp_once' 48 | __cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y))) | ^~~~~~~~~~ include/linux/minmax.h:81:25: note: in expansion of macro '__careful_cmp' 81 | #define max(x, y) __careful_cmp(max, x, y) | ^~~~~~~~~~~~~ drivers/gpu/drm/drm_modes.c:2474:29: note: in expansion of macro 'max' 2474 | extra_ptr = max(bpp_end_ptr, refresh_end_ptr); | ^~~ >> include/linux/minmax.h:23:22: warning: ordered comparison of pointer with integer zero [-Wextra] 23 | ((x) >= 0 && (x) <= (typeof((x) + 0))(long)__INT_MAX__)) | ^~ 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/minmax.h:41:9: note: in expansion of macro 'static_assert' 41 | static_assert(__types_ok(x, y), \ | ^~~~~~~~~~~~~ include/linux/minmax.h:31:38: note: in expansion of macro '__is_noneg_int' 31 | __is_noneg_int(x) || __is_noneg_int(y)) | ^~~~~~~~~~~~~~ include/linux/minmax.h:41:23: note: in expansion of macro '__types_ok' 41 | static_assert(__types_ok(x, y), \ | ^~~~~~~~~~ include/linux/minmax.h:48:17: note: in expansion of macro '__cmp_once' 48 | __cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y))) | ^~~~~~~~~~ include/linux/minmax.h:81:25: note: in expansion of macro '__careful_cmp' 81 | #define max(x, y) __careful_cmp(max, x, y) | ^~~~~~~~~~~~~ drivers/gpu/drm/drm_modes.c:2474:29: note: in expansion of macro 'max' 2474 | extra_ptr = max(bpp_end_ptr, refresh_end_ptr); | ^~~ vim +23 include/linux/minmax.h 6 7 /* 8 * min()/max()/clamp() macros must accomplish three things: 9 * 10 * - Avoid multiple evaluations of the arguments (so side-effects like 11 * "x++" happen only once) when non-constant. 12 * - Perform signed v unsigned type-checking (to generate compile 13 * errors instead of nasty runtime surprises). 14 * Constants from 0 to INT_MAX are cast to (int) so can be used 15 * in comparisons with signed types. 16 * - Retain result as a constant expressions when called with only 17 * constant expressions (to avoid tripping VLA warnings in stack 18 * allocation usage). 19 */ 20 21 #define __is_noneg_int(x) \ 22 __builtin_choose_expr(!__is_constexpr(x), false, \ > 23 ((x) >= 0 && (x) <= (typeof((x) + 0))(long)__INT_MAX__)) 24 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki