From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796427941; b=EJbnJOwO/Ntm/AtV6+L3nKCZkoJaneK0+PH7Y3k53fqISe7FMc+H1gdAvKoCg5sYfYIo nnTC4xpm5MlT9IPmao3TIbK8mbGjEJyHfL78JPf6QgobYClqthlaZrQdLhI+8nJYEcpFd dYt48t2twjvmGtbnyBKzwBr6sXITX///nqH8lcpLhS2YXcdrGrsb5Iw1dPuGJhzcMCabZ RQwgZy45APhtV82B7RGjIq4pt78VH2wguWwdSxuZ82U8WajCUVyCuK71HnBl4XUifBlAL 6qG2lGxo7Y+bG9z2/XI3VLuZBIgPwx4u0JUI/O5GMSXAucor1qfHxeHgKb/10jjWVmQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796427941; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=p34lKhr7De6yO+1DAeG6RzL93qqkqxQ1e2SL2o1ilTU=; b=DQ4nZMWl5Z6f+3Iyj8VK50KOCF6sjNfnI9zXtAB8iocJPUERC2LJ528SDL/vRXb+f9Nd /p3+rRlqYyvCMOuYZ+ZdX7iwCt8VLeDr/vWA0YtQ2uRmK+4KPxkWnvIa9E1XFQdUWnZ78 b9K393Zlf/2Y3gWXpDTkRFnSCT4M6YUKe0AJJVS6OnhGgtyrEWt32Pn53jIWdVdZt4Sfo KrSQCJJUC18bV98ZrclAud+nMQTyYE34PtbPY3VMAkxkssbSGCB5A/PVoI2Djfc4qeKeo i9kWwhNwQTsWT7/nyxdHBMLTzjnm45/R/2FuZgJMpNL7EDxgEtcAlqvleilmDzWEMVQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KIUF5u1J; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B64D606A32C; Fri, 4 Dec 2026 23:45:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KIUF5u1J Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDD221F00936; Fri, 4 Dec 2026 23:45:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796427941; bh=p34lKhr7De6yO+1DAeG6RzL93qqkqxQ1e2SL2o1ilTU=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=KIUF5u1JBYfJ/EnNzm6hmHptG1s0l0a8xYCfbhA4nyPE9BxXx5NIw8eDls0SNTW5u bCm/3RQlLUD8adp25to2Krm7mCBx+lPf9k0FohUm2V78Cadr9onrBwBAUsm64X5Fx8 a/rm4DmkD3ru/lYLC29NPVqY9AiQDcc6PLORB4JpJUR5dE3FXSqqpEgIiKRlTetmXZ Z+sOgl+H/mWAEH5hEmI0PC7tojt+HzaZP962aKP5HE30ckGtqFEilpB9TE1ZJ+LofB nTVJ2qeyVrKX1UJXj2k2EyTZXWmIugLJBOf23ekoWhk8pTg6CkkwF51kZTNwFnQNCx xCAu2l3pu0acg== Date: Fri, 4 Dec 2026 23:45:34 +0000 From: Jonathan Cameron To: Andy Shevchenko Cc: Arnav Kapoor , David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/4] iio: proximity: aw96103: fix diff sign, missing config, async config lifetime and event values Message-ID: <20261204234534.2216a1d4@jic23-hlaptop> In-Reply-To: References: <20261128115144.557411-1-kapoorarnav43@gmail.com> <20261130003429.56d9f42f@jic23-hlaptop> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 30 Nov 2026 16:43:18 +0200 Andy Shevchenko wrote: > On Mon, Nov 30, 2026 at 12:34:29AM +0000, Jonathan Cameron wrote: > > > > > - 4: kept the explicit range check rather than FIELD_FIT() (Jonathan): > > > on 32-bit, FIELD_FIT() shifts the value in a 32-bit unsigned long, so > > > high bits fall off and e.g. 16777216 or INT_MIN pass as fitting the > > > OUTDEB field and are written as 0 (1020 such int values for > > > GENMASK(9, 8), 16380 for GENMASK(13, 12)); on 64-bit it is exact. > > > > Interesting point. I'd never looked at it closely. > > > > I wonder if their is appetite to fix that? > > Would simply shifting the the mask right instead of the value left when checking > > the fit do the job? That might end up more expensive if the aim is simply to > > avoid overwriting other fields as the compiler might figure out how to combine > > the guts of FIELD_FIT with other necessary steps. Perhaps have a play around > > and see if it manages that or not? > > > > What do others think? > > Sounds like a bug in FIELD_FIT() to me that calls to be fixed. > Great to see a proposed fix for FIELD_FIT() on the list. I don't want to potentially block these fixes as a result (or keep track of them just for this!) so I'll apply these now. Perhaps Arnav can circle back and switch to the 'fixed' FIELD_FIT() as a follow up cleanup next cycle. Applied to the testing branch of iio.git and marked for stable. The fixes-togreg tree is now more or less closed for this cycle just due to timing and my likely availability over next few weeks. Thanks, Jonathan