From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4FE919ADB0 for ; Sat, 18 Jan 2025 17:10:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737220204; cv=none; b=KHvZtwLPXLny+s08bQh3I4k1vPmfZcHFq6EscbcycxGr5mIwSOcra4jAXuUkpHeeLdk9DEfF1UdHOjVCTtwcn1mGl7d19WlmIraU4MipmPIJbuT1iv55QB05Yzsclp/gHcy/1P6UTmGn7trdXSkpeei4TjIawDSPTak1VSTvxBw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737220204; c=relaxed/simple; bh=94B57dX+7ijFepoELaQNT6MezIL6wgH18H2K0lrHRZc=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=b96xLTF8q8HqZiqG5NFlZyxbEPPhMi7i4nVldnbaq9BfrXiXgkd980N3I1zh6Lin+XUDp6s55t+9BWwIgN+9i9x4505p79AvDtbHf729oNIBwj4nMsWm6vv0+Cbw0zVaj3kLsbF/Nz+59qc5GeDUgSwipugc+7GhvOEEiH66TkQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=g95njme2; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g95njme2" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-385d7f19f20so1522417f8f.1 for ; Sat, 18 Jan 2025 09:10:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737220201; x=1737825001; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=3KlgTW8qoEnUZT7EjjZ/u9PK9WlkNroef5My8RmY27k=; b=g95njme2wPVZZvy73qyLUe5Kge84T+gitRnDpwCPeQR7Gx7McXQyWcETc5QVOkXpnf OCdMwUi63BkWhjHCm/a8sOntlqP5ISOTEElZYvM5fVlZesvxktUbtncui4MFa/S15LI3 k9r28G5Xnd1L2AVizGSGvmKvuqA3duvsV64hq1WlUWxsEreC7JTEb7A+RB6M9CGtGL4G ZvtsjFPQwgzlxqDOCOn8wSN8Os6CytdNQX50QURIv2KldDrC3Tuqd06zLo16su01HlJ0 wu8zsK3cVjqso4c7l9jxGMHEuCPedEJrLPml1B8H8LklWlbCNSEYmjoHujQt44EnqyqK 6Etg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737220201; x=1737825001; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3KlgTW8qoEnUZT7EjjZ/u9PK9WlkNroef5My8RmY27k=; b=Yce9G9n//Wib9N0cbJZBz51s45yxLIZVwxksdDj3BQCCBwmH1ls/U9vpEXq8XASZN3 A4UCsiIYvawFuPTf2CSIIlwKkZE6llfbm+xFE8Q0W6yjE/1qsIRI9HoFFpw/XWq0AMCs +u0O4PepMUCZLoTKRDV4LOf926VQNCJTaRJW1JKOfMrmr+VNmqVJYZF4rgHkTO+D0A2m gqaVkRWuvBipFQWhvohrEffx1udwjpoTDnKb0LMoEYP5VF6FdS1tDhCkPJg+vs8BYVPw MGm4mw4ubxc0I8E33BmWOJRmWLWZSynZGQ7O2qbJLw5gHsOBywlsXiCLwjuh4e/Z8XDQ vkhw== X-Forwarded-Encrypted: i=1; AJvYcCXzNfhq9KjDNu68474gReDcByDBYI2MWmL+FuVox+3YhAzaVtYyfwvO0pD33iaWa9U6dYVTIVsagCxSx6Q=@vger.kernel.org X-Gm-Message-State: AOJu0YywtBRfksDmCp6mjL16wPWsMFwsEViqAd4+YgWOeCaMqJVt3v7y FnPXtQwho648oIWWuf97gG4fMSNbVRJ+qSxl27q5V5FNBIgCW2Rl X-Gm-Gg: ASbGncuo17hvcU7wrjBxA75fI1X/wlci/oT2kuKtJU8whqBmQaOPGt5HjOQZOFJ7X9U ULECpTkDodbNjJ97z5ODzQeUIUszlNb7SvHZMD6ZdLqiA660mtUi6qDAzGlr2gX+qYBaWSiSxep KBeVQY8YMM1eSEuvaGUFNb63mY0pVjJh/QpA7MCzbUkvc4nfK8jaTIwvby35IrBbnkTg6IJOL4c J4PYq55zWmaETwte581QfSmZ3PUkXRk6aLwIHMVUOfEI39I3TvqWvcxejSZKw8UvzeyoSUlIopM ipRkYowL3tkMtuXYY19J24PglL4U2/n+ X-Google-Smtp-Source: AGHT+IHMW6aZx7u19ZQpXVb/KS9UCuBHquSRSELoo8MnVynv6LS9GzSLQvXkC5ETEtQhY9v53d8rGw== X-Received: by 2002:a5d:6d86:0:b0:385:df6b:7ef6 with SMTP id ffacd0b85a97d-38bf57c94a2mr8056076f8f.51.1737220200795; Sat, 18 Jan 2025 09:10:00 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438904087cbsm75613495e9.3.2025.01.18.09.09.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jan 2025 09:10:00 -0800 (PST) Date: Sat, 18 Jan 2025 17:09:59 +0000 From: David Laight To: Guenter Roeck Cc: David Laight , Linus Torvalds , 'Arnd Bergmann' , "'linux-kernel@vger.kernel.org'" , 'Jens Axboe' , 'Matthew Wilcox' , 'Christoph Hellwig' , 'Andrew Morton' , 'Andy Shevchenko' , 'Dan Carpenter' , "'Jason A . Donenfeld'" , "'pedro.falcato@gmail.com'" , 'Mateusz Guzik' , "'linux-mm@kvack.org'" , 'Lorenzo Stoakes' , intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, David Airlie , Simona Vetter , Jani Nikula , Rodrigo Vivi Subject: Re: Buiild error in i915/xe (was: [PATCH next 4/7] minmax.h: Use BUILD_BUG_ON_MSG() for the lo < hi test in clamp()) Message-ID: <20250118170959.3aa56f4d@pumpkin> In-Reply-To: References: <34d53778977747f19cce2abb287bb3e6@AcuMS.aculab.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 18 Jan 2025 08:13:06 -0800 Guenter Roeck wrote: > Hi, > > On Mon, Nov 18, 2024 at 07:13:31PM +0000, David Laight wrote: > > Use BUILD_BUG_ON_MSG(statically_true(ulo > uhi), ...) for the sanity > > check of the bounds in clamp(). > > Gives better error coverage and one less expansion of the arguments. > > > > Signed-off-by: David Laight > > This patch triggers a build error when trying to build parisc:allmodconfig. > See error message and bisect log below. > > I don't think there is anything wrong with the patch. The underlying > problem seems to be that parisc:allmodconfig enables CONFIG_DRM_XE which > tries to build the affected file even though CONFIG_DRM_I915 is not > enabled/supported on parisc. This has appeared before. Any idea which inlined copy of scale() is causing the problem. On the face of it they all look ok. If you can reproduce it maybe try commenting out some of the calls. David > > Copying XE maintainers for feedback/advice. > > Thanks, > Guenter > > --- > Building parisc:allmodconfig ... failed > -------------- > Error log: > In file included from : > drivers/gpu/drm/i915/display/intel_backlight.c: In function 'scale': > include/linux/compiler_types.h:542:45: error: call to '__compiletime_assert_415' declared with attribute error: clamp() low limit source_min greater than high limit source_max > 542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > | ^ > include/linux/compiler_types.h:523:25: note: in definition of macro '__compiletime_assert' > 523 | prefix ## suffix(); \ > | ^~~~~~ > include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert' > 542 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > | ^~~~~~~~~~~~~~~~~~~ > include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert' > 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > | ^~~~~~~~~~~~~~~~~~ > include/linux/minmax.h:188:9: note: in expansion of macro 'BUILD_BUG_ON_MSG' > 188 | BUILD_BUG_ON_MSG(statically_true(ulo > uhi), \ > | ^~~~~~~~~~~~~~~~ > include/linux/minmax.h:195:9: note: in expansion of macro '__clamp_once' > 195 | __clamp_once(type, val, lo, hi, __UNIQUE_ID(v_), __UNIQUE_ID(l_), __UNIQUE_ID(h_)) > | ^~~~~~~~~~~~ > include/linux/minmax.h:206:28: note: in expansion of macro '__careful_clamp' > 206 | #define clamp(val, lo, hi) __careful_clamp(__auto_type, val, lo, hi) > | ^~~~~~~~~~~~~~~ > drivers/gpu/drm/i915/display/intel_backlight.c:48:22: note: in expansion of macro 'clamp' > 48 | source_val = clamp(source_val, source_min, source_max); > | ^~~~~ > > --- > # bad: [0907e7fb35756464aa34c35d6abb02998418164b] Add linux-next specific files for 20250117 > # good: [5bc55a333a2f7316b58edc7573e8e893f7acb532] Linux 6.13-rc7 > git bisect start 'HEAD' 'v6.13-rc7' > # bad: [195cedf4deacf84167c32b866ceac1cf4a16df15] Merge branch 'main' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git > git bisect bad 195cedf4deacf84167c32b866ceac1cf4a16df15 > # bad: [e8c0711b153b0db806410d8b31ed23b590f4eab4] Merge branch 'xtensa-for-next' of git://github.com/jcmvbkbc/linux-xtensa.git > git bisect bad e8c0711b153b0db806410d8b31ed23b590f4eab4 > # bad: [81d45722d699e594c66c150c8f7a0ec2e2bc9be6] Merge branch 'for-next/perf' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git > git bisect bad 81d45722d699e594c66c150c8f7a0ec2e2bc9be6 > # bad: [7acb844a672defb15cf202a501815ec22c68c800] foo > git bisect bad 7acb844a672defb15cf202a501815ec22c68c800 > # good: [fb2368075b135f174264071b851330649d55f9d0] mm/damon/core: add damos_filter->allow field > git bisect good fb2368075b135f174264071b851330649d55f9d0 > # bad: [fc83c501e385753c90db7316faf9fd4158caaa96] minmax.h: remove some #defines that are only expanded once > git bisect bad fc83c501e385753c90db7316faf9fd4158caaa96 > # good: [b04d305df1171448df5e87802c4d1f1022cc5784] ocfs2: use a folio in ocfs2_map_and_dirty_page() > git bisect good b04d305df1171448df5e87802c4d1f1022cc5784 > # good: [7e01619507058f90ab603acec482951f3c452aaa] kthread: correct comments before kthread_queue_work() > git bisect good 7e01619507058f90ab603acec482951f3c452aaa > # good: [21b510a64c223707caa6db6176128779f0806a73] nilfs2: correct return value kernel-doc descriptions for ioctl functions > git bisect good 21b510a64c223707caa6db6176128779f0806a73 > # good: [6afb87f23458f2d4e4334ee5a4efb8b0d07af68b] nilfs2: handle errors that nilfs_prepare_chunk() may return > git bisect good 6afb87f23458f2d4e4334ee5a4efb8b0d07af68b > # good: [8f6d46fed0bad163e5146fea1fdff150039235b2] minmax.h: reduce the #define expansion of min(), max() and clamp() > git bisect good 8f6d46fed0bad163e5146fea1fdff150039235b2 > # bad: [7a70c678548d71e609b95dbddf2d411a02d13b54] minmax.h: move all the clamp() definitions after the min/max() ones > git bisect bad 7a70c678548d71e609b95dbddf2d411a02d13b54 > # bad: [37f375aab0c585388b90d1af6968454fc2769cb9] minmax.h: use BUILD_BUG_ON_MSG() for the lo < hi test in clamp() > git bisect bad 37f375aab0c585388b90d1af6968454fc2769cb9 > # first bad commit: [37f375aab0c585388b90d1af6968454fc2769cb9] minmax.h: use BUILD_BUG_ON_MSG() for the lo < hi test in clamp() > >