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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8FA6CC433EF for ; Mon, 17 Jan 2022 13:29:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Va8OFDnRabtpaH2nUg7nixuMSMykiYsRmNMlNmSElIk=; b=4YXVEZMYjESBTY P+f80KMFA6ouXQWz2R9d5tHEzG2eGnnwCgXq6rrQxbohTDBZ6jSOJyk9TBTZeEwi6RPLsK3Wv2E2d Pf3qjhO/3MbOgeEVBd670xTWZybqpIjU2oqseaWJBNDyVsNP4+jctnKvRtmEUS5KrMpafDQATynMj Kh5O+7Z/uKeQDUGrnrQe2iUDkr6Q7Pl42p+HLj/Nu5RQfVzgYDwiCWgJJEMQbYrnYXbbTQnn6OVko lwd6bkWiMuBGiXE/BcfzfsPw8emnkWXm/ecVia37TE+bK/Pl5kYm5xA3f5cVQQVGcmioo1XXv2cIf 5nE9376idDTkfS7qtMdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n9S3R-00F3Tc-Dh; Mon, 17 Jan 2022 13:28:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n9S3N-00F3Sh-FQ for linux-arm-kernel@lists.infradead.org; Mon, 17 Jan 2022 13:28:10 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 857FF1FB; Mon, 17 Jan 2022 05:28:08 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.38.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 14CE93F774; Mon, 17 Jan 2022 05:28:06 -0800 (PST) Date: Mon, 17 Jan 2022 13:28:04 +0000 From: Mark Rutland To: Steven Price Cc: linux-arm-kernel@lists.infradead.org, andre.przywara@arm.com, Jaxson.Han@arm.com, robin.murphy@arm.com, vladimir.murzin@arm.com, Wei.Chen@arm.com Subject: Re: [bootwrapper PATCH v2 02/13] Add bit-field macros Message-ID: <20220117132804.GE87485@C02TD0UTHF1T.local> References: <20220114105653.3003399-1-mark.rutland@arm.com> <20220114105653.3003399-3-mark.rutland@arm.com> <253b79f8-9c8b-4d8d-4f60-2ac74d763c73@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <253b79f8-9c8b-4d8d-4f60-2ac74d763c73@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220117_052809_582926_4B99005F X-CRM114-Status: GOOD ( 12.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 17, 2022 at 12:11:36PM +0000, Steven Price wrote: > On 14/01/2022 10:56, Mark Rutland wrote: > > +/* > > + * Insert the least significant bits of `val` into the bit-field described by > > + * the contiguous set of bits in `mask`. > > + * > > + * For example: > > + * - BITS_INSERT(BITS(3, 0), 0xA) is 0x000A > > + * - BITS_INSERT(BITS(15, 12), 0xA) is 0xA000 > > + * - BITS_INSERT(BIT(15), 0xF) is 0x1000 > > * - BITS_INSERT(BIT(35), 0x1) is 0x0 > > ... which might be surprising! > > of course BITS_INSERT(BIT(35), ULL(0x1)) works, but I feel either the > description above needs to signpost this gotcha, or a cast is needed below. > > AFAICT this macro isn't actually used in your series. Good point; I'll either add the cast or drop that for now. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel