Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3269897lqp; Tue, 26 Mar 2024 04:55:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVv4fkE701EB19f955BzAVV1IXQ78nYwypfozQ4tCzlV7uB7k/gomJi1uJRFSyR6coEyKoqqj19kvuIctpWbqLjUhTkdVj6H9RvjQTzPg== X-Google-Smtp-Source: AGHT+IFpg+lp/UKZucrdFTYIbIWzTbDq3djczPAGCubqx1kfTMf50nVNIuYAq3cC8+QolC939yrc X-Received: by 2002:a05:620a:bc1:b0:78a:6841:747 with SMTP id s1-20020a05620a0bc100b0078a68410747mr862866qki.4.1711454141793; Tue, 26 Mar 2024 04:55:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711454141; cv=pass; d=google.com; s=arc-20160816; b=DIYSH3qiFhdMFKgP5a4xi+Of+k84MSGnnWRUV9c3WPqNkDedBkuU5xyBLjM6almGIF W5fKe3JisS8v3te+StMbv1ZLuJpvUybf5jFbsP6o+XFbaz8tGW50mp6+vrE3aQDWAcYM tFk2uiXd9Pn94j+z0Cw+gO3xVGqlp87oZdyoRuDlpB9JOK3MxhNEB7iGh46YscpDXLFJ hXJEgeIcVt7qyhch+GfgAhC9gIRFL5qrsC0KHgRE7D40q4cK0+N0vOPM9wr3G7uCaWl7 a/QSgiGrjc8lxoUDfTSU9JTnfINs8bNUFYx6Z38SCEtcu/oNodsMetB8UNjwCkG/AIT6 RrEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=/T963m0awUECKjS5oYbqzSukhasYP4dIjzgrxQhicCY=; fh=Rby20EN8X2w9rAzv2cjsK+heVlz2jLaeXLRkEt7gDF4=; b=zmmy59NIFsXNacPIL/0eWSBkdeO+7b12w6S8MkdWkqJmEcFr79yCyMW/kPUJjkY4ar oEJcgBEWQxfba6R1wKmqImuS8+BY9xsnt5rnNoPVb4U2zBVnPQawPCWCh6OoowxecTq+ vvlANOHCOGDj+1G9O6rr89hAY2UQtRR3HbU8cjE8LhhqrDK09cHKwAmO5otZWUapF365 ZAvhMV1KrWt7fHGigwwGhTktm8J+i2eAQRPQVeR8O3CZmIohNlefRinuxrdcGBhcrXl3 YI78wGJaM4TaFyKYg5m+X0IpRJJa7Du0JCAT8U1hHoT80FGq/u008YDxBnnq85Ab4cNK zyaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=gpRgXg4K; arc=pass (i=1 spf=pass spfdomain=tesarici.cz dkim=pass dkdomain=tesarici.cz dmarc=pass fromdomain=tesarici.cz); spf=pass (google.com: domain of linux-kernel+bounces-118927-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118927-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tesarici.cz Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a27-20020a05620a02fb00b00789db5d59d3si7304703qko.435.2024.03.26.04.55.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 04:55:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118927-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=gpRgXg4K; arc=pass (i=1 spf=pass spfdomain=tesarici.cz dkim=pass dkdomain=tesarici.cz dmarc=pass fromdomain=tesarici.cz); spf=pass (google.com: domain of linux-kernel+bounces-118927-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118927-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tesarici.cz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8033D1C37D7F for ; Tue, 26 Mar 2024 11:55:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECAE06EB5D; Tue, 26 Mar 2024 11:55:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tesarici.cz header.i=@tesarici.cz header.b="gpRgXg4K" Received: from bee.tesarici.cz (bee.tesarici.cz [37.205.15.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AFFC6CDCC for ; Tue, 26 Mar 2024 11:55:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=37.205.15.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711454126; cv=none; b=ZuX6xn8FvKp/0SJWVYpAXBHi3p52teln4UlG0i31W8l1Fp6u4gUtD7zCUEybU6b90tW3y5pprInHCb2RjWnQGj1bM8/aSsTItdo/Hh3NhpV7VNOBEEk0hhbBVne7vbnXIQJWUYWiikd6D/v5MtHaz4UCRJlhlW23wDYOPRBaG8M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711454126; c=relaxed/simple; bh=3JXq7xfw33BAjKe2vrE7FVmkKyrZz+2pN3PkS293FPA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=D//CzhmVa/CyX8Y+49QPNy3X/oU1st64SyBYVCv4qXWz1f/rXampf1ClqpWSBOl0/3yAqruTlGkPd5SryJgVzqtmqYME0ql012rsTd0d8XHqpMriPdr4r84vvYVNUWk8LCK4dZwMHuHNxxlPTnb40sktR2O/WTzGg9ERndEZkZs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tesarici.cz; spf=pass smtp.mailfrom=tesarici.cz; dkim=pass (2048-bit key) header.d=tesarici.cz header.i=@tesarici.cz header.b=gpRgXg4K; arc=none smtp.client-ip=37.205.15.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tesarici.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tesarici.cz Received: from meshulam.tesarici.cz (dynamic-2a00-1028-83b8-1e7a-b985-910f-39e1-703f.ipv6.o2.cz [IPv6:2a00:1028:83b8:1e7a:b985:910f:39e1:703f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bee.tesarici.cz (Postfix) with ESMTPSA id 427CD1AFFC5; Tue, 26 Mar 2024 12:55:14 +0100 (CET) Authentication-Results: mail.tesarici.cz; dmarc=fail (p=quarantine dis=none) header.from=tesarici.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tesarici.cz; s=mail; t=1711454114; bh=/T963m0awUECKjS5oYbqzSukhasYP4dIjzgrxQhicCY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gpRgXg4KcQ7JdPeLOOim7ujdCjsdB3qiwce2opq+4AkFkPepCJrcb1Nr0LjvS8DC5 gES3mxyskqKxZGxhAn2g2+TSYGGWz5mDDqF2lfJJzlkLqNO+XJqyzn8f3Il1Mi9Xcl XWb2OL6v0AIoIiqI5bDBjj3R6r2Al843f/gY2MgpCx0YHbBMAF/6e+RFMYyECBgmHq +ZFXJlcE1JUh6uQcZhTLlyL6b2M6wx+5oNHzvKRddLZ39vjCThDcQkiu2lxdnyqkyL JTTknh+l3kArFYHWYOZ1uYl4xLc7cHogmFwEkUn1BWQ57d580S6lbVPUGJvSHHOh1Q qNu3m8vPqLZPA== Date: Tue, 26 Mar 2024 12:55:12 +0100 From: Petr =?UTF-8?B?VGVzYcWZw61r?= To: Christoph Hellwig Cc: Petr Tesarik , Marek Szyprowski , Robin Murphy , Petr Tesarik , Michael Kelley , Will Deacon , open list , "open list:DMA MAPPING HELPERS" , Roberto Sassu Subject: Re: [PATCH v4 2/2] bug: introduce ASSERT_VAR_CAN_HOLD() Message-ID: <20240326125512.430c1ed0@meshulam.tesarici.cz> In-Reply-To: <20240326075606.GA10489@lst.de> References: <20240325083105.658-1-petrtesarik@huaweicloud.com> <20240325083105.658-3-petrtesarik@huaweicloud.com> <20240326075606.GA10489@lst.de> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-suse-linux-gnu) 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 Tue, 26 Mar 2024 08:56:06 +0100 Christoph Hellwig wrote: > On Mon, Mar 25, 2024 at 09:31:05AM +0100, Petr Tesarik wrote: > > From: Petr Tesarik > > > > Introduce an ASSERT_VAR_CAN_HOLD() macro to check at build time that a > > variable can hold the given value. > > This really should be run past whoever maintains build_bug.h and > also cc linux-kernel. Please also split the addition and the user > in swiotlb into separate patches. > > I plan to pick up patch 1 for now, and wait for the discussion on > this addition. Fair enough. The use in swiotlb depends on patch 1 from this series, but you're right, I can send the macro addition as a separate patch to get some feedback. Thank you! Petr T