From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [185.226.149.37]) (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 0A3B634321D for ; Wed, 26 Nov 2025 22:17:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.226.149.37 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764195460; cv=none; b=Lkz4+O2XqAVc/NiX3nXPrR/x1aT/s5bWkTvHsXfdez9nn5tSxdYbPjbG9WEAGzVvD8/kH3c4i6+APTPop38e02lG4lQWBwuW/CB2mkv1XCCKazTHKlYouSC4H//86QOVjHen03CQ8vtoB2HuZEAV9lZsfCcqiwfbbrmR2v8+zj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764195460; c=relaxed/simple; bh=YZOte7pDAEtCj7b6itcARilQ/vNRww9KobgzAGA56QU=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oK/9G5Tv4/AhP6Uh5HNoOkd+HSwAaQqqfHKDzWlqctnpnWos0fRY7Q3woEh0ao9H2t15iK1z9/domO2ZvOUsDONXxKOps/1HDLIbDAxGCpU5qHdNJ2I4VmBmQH3sArK66KvvvQbzCPmqymxs4gHXdUikBrJ3/pji8A9Umm8HFQM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=runbox.com; spf=pass smtp.mailfrom=runbox.com; dkim=pass (2048-bit key) header.d=runbox.com header.i=@runbox.com header.b=I/MVXk2S; arc=none smtp.client-ip=185.226.149.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=runbox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=runbox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=runbox.com header.i=@runbox.com header.b="I/MVXk2S" Received: from mailtransmit02.runbox ([10.9.9.162] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1vONpM-00AmzQ-Ec; Wed, 26 Nov 2025 23:17:32 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector1; h=Content-Transfer-Encoding:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=rZ877hgnewsjha1CxA2Od///6FwARR9eBp81eSwD2UA=; b=I/MVXk2SLUB1xAp2mUMOQIDhdV xXpAkDmWa9VFVXymqBRtES4FzZVd+TNYLOQAD5MbovRZmEPlv49awxmw0qZuvchz+mUytIMqRZDwz WpL6jfDISlsYV1r/9fNzlZ5tHenmza6HlMQRwkeyJH8TawZYQJgplZeycL5wD7py9vNHrbOKJetWV qyXgTt+LlA5App9SumuBuytjfS7h1355TCYGLhfzG0iLkNNwpfvrwkuvWqp2PPvJ3uflnwGNkByau YqnN5sc8r+HdTZx92GymdAjOFp8sgnXqjtNUQTgOEIUBWwtL/igW56Qhu8tKR13bvfMv+H2AyfmuK nDPoyEVw==; Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1vONpL-0005si-R0; Wed, 26 Nov 2025 23:17:31 +0100 Received: by submission02.runbox with esmtpsa [Authenticated ID (1493616)] (TLS1.2:ECDHE_SECP256R1__RSA_SHA256__AES_256_GCM:256) (Exim 4.93) id 1vONpD-00Fndk-IP; Wed, 26 Nov 2025 23:17:23 +0100 Date: Wed, 26 Nov 2025 22:17:18 +0000 From: david laight To: Linus Torvalds Cc: Rasmus Villemoes , "Yury Norov (NVIDIA)" , Linus Walleij , Nicolas Frattaroli , linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/21] lib: add alternatives for GENMASK() Message-ID: <20251126221718.6c595c57@pumpkin> In-Reply-To: References: <20251025164023.308884-1-yury.norov@gmail.com> <87ldjtuppl.fsf@prevas.dk> 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 Wed, 26 Nov 2025 11:44:59 -0800 Linus Torvalds wrote: > On Wed, 26 Nov 2025 at 01:07, Rasmus Villemoes wrote: > > > > There is, however, an alternative that resembles the syntax in data > > sheets even more closely: > > > > #define BITS(low_high) GENMASK((0 ? low_high), (1 ? low_high)) > > Oh, me likey. That's a much better idea than my crazy syntax. Mark B. will accuse you of abusing ?: :-) I've just looked at a .i file. GENMASK() currently expands to 855 chars plus four copies of each argument. Both FIELD_PREP/GET(GENMASK(), v) are about 18k plus three copies of v. FIELD_GET(mask,v) has 18 expansions of 'mask'. HWEIHT32(GENMASK(15,0)) is about 30k - don't ask why anyone would do it. They all look excessive. David