From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) (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 8259D39A7F4 for ; Fri, 10 Apr 2026 21:26:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775856369; cv=none; b=GsBcv/Fx64m0xWU406EFsjIe748/Nb8NHnQkVbtm6jQKZEpqlesZl7hC75AXWgSO2iBBfwlx++hnaoqY/sBc+QFzGkPQO1X8jVFo7rJ/Uot76Ldm0uMYsBNCbI6t/Zry6hslziLM4PTVmiR9fhXruwAhVJCRKUN1CmYcss9vToA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775856369; c=relaxed/simple; bh=blbVsdWwZIl4tvIa84LRRiprRTeKBNMZ9YgODcExhkQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=crP3QUyMwmAIPXyk0jCHBulyHchKx4jvs9BsMo0tmOdunOfW0nEA/aYJe6TIFJSSP8gKbuYWTV9mQ/5iLvqcaHSc4IzVa2DqxjVmpWjGC5EPd48riAx/p4IBwCrB4e8O33+zHG9pF+A0lr/sPUMkGPUZczUuGv7p1a+BDNYvdN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.b=Q1bahBu4; arc=none smtp.client-ip=209.85.161.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.b="Q1bahBu4" Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-66ee7b9af94so917942eaf.0 for ; Fri, 10 Apr 2026 14:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1775856366; x=1776461166; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=VpKT+sFosZszFJqskpECRNRkBhOriLvsoW69QUfLXmw=; b=Q1bahBu4y8rDVFSekbafL1tohH8YeTvyJLe9q35c3gHpjCMjJtkBuYNM/xd/T/iajw kaEp6rSKszpyEWi0rdNKV8FQx/SK/pAQQ0/904njU7vowuN2M0E2ee2Qor+bI0o/XTE8 RYgNibXBGCLKnVCegi7lrlIU6+CfaW1+o0C10zpNvcr0wXNi3UO5Wt3zRA3W2I4qU52R VahaxjrF4MWFcrLDi9m8lrNWEvzY/01aS6/KDqS5+kX0W0MGMMr1bcMWBnPVOmjHJEVf EyYb4dS+j7yDatpaPAXUvawwUrWJ3SuqLZm7ufpNEZsNqZKZMeAuBm1o0uWFOSr0mYJ3 /foA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775856366; x=1776461166; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VpKT+sFosZszFJqskpECRNRkBhOriLvsoW69QUfLXmw=; b=bsY400BF5gg1KCwTY888U5GF1Y7j+l3XVFJFy/vhmh3WU05qO6I4FV2OLX+O+NEWai oIoQjqhPfpvCSOh8VD8hvIufB2BsKsyiaBWQztwGoMZW3x4y6UlT5AhaGYeJzzxbaP8m 78qeTDqMnCeEpyRabwbtH1EjmbWiRhituU1v6mRaOhYpfna5BUx3+hTcgcVkKGcF5oyJ e46pL0j+cvfx/oUqG1ZASbFo3yiHgVSJuw8TssZMWmyKYVoKHfdlJ6MAGruSMDfPkV5S UjqxahmlzJOinqhQgWg+LbaAK67su8s5FD54sC/gIR1HfSTdup/FsSxMMBoLz8tD+Jb2 GkgA== X-Forwarded-Encrypted: i=1; AJvYcCXPu83PrnQDMipD0U3yeE+yaK6E6SYWBV+tYkRjzPJKm27SAHEKhOXWk8Pz074fb1oozIhT3ZTDw9D0JxI=@vger.kernel.org X-Gm-Message-State: AOJu0YwMmv7ohTtzmoIrwTRjJKQme9SQFM3djBGhfngZf0FCap2ASk7j 0/iD14vuGXc3j6/uP8Uqohe0BpyWZ7Rz9SMXHqcbWrOE5piIPaJh9gIavKsf5gBtph0= X-Gm-Gg: AeBDieu7r8QUZ/ygAyLnR3C6T2DAWvpT+z2jc7vBwBQO+QuzM4LxJcKUI7voxxcvzbF J1JpDx8KHDcP00p4b30deNUTanoZKP3gFGA3p7P5XNl1zHFSOQRgaaaM56F0pVhBewSRFEPgpbA /jjwXQIhiRtDdrIKH8RBvviGzA5+izsTIIqKvBpuStc3fXVlRTNW2iCnvD9lbazIDQNHexdaL1t Nh7M7TkS+JSiAE3p9humzeqTBpzrWO/in1RKMrWP2Mz2eNFdbxnhgcpEORMzLGE0/COoaGhCeav MRVzamwq9AGJjGXKerMCZ50KH2UbPzS9zF0PWVs44gYfBS0NvubYTUBmhovteY9Yx915Pn8rs4k zVy2xjl5+0c7dcCe2wOtZEO95iRNcAxrUVzt3AzpVeC3Fj2Y6/CYDbuc2UdPsh+LLW19rA+L9MA V5KhzOiY4CG0YL+vlnHwD0apiW6NR+VATRm9AeGulzwLxNxycLxDyXy774RtO2PgahjXxnoExlR A== X-Received: by 2002:a05:6820:3014:b0:680:17e0:4435 with SMTP id 006d021491bc7-68be7ee695cmr1705903eaf.31.1775856366448; Fri, 10 Apr 2026 14:26:06 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:500:b75d:2440:dc10:808b? ([2600:8803:e7e4:500:b75d:2440:dc10:808b]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-68bcacc9925sm2108544eaf.9.2026.04.10.14.26.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Apr 2026 14:26:06 -0700 (PDT) Message-ID: Date: Fri, 10 Apr 2026 16:26:05 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] iio: adc: nxp-sar-adc: use field_get() for EOC bit check To: Piyush Patle , Jonathan Cameron , linux-iio@vger.kernel.org Cc: =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Daniel Lezcano , Alexandru-Catalin Ionita , Felix Gu , linux-kernel@vger.kernel.org References: <20260410211329.185147-1-piyushpatle228@gmail.com> Content-Language: en-US From: David Lechner In-Reply-To: <20260410211329.185147-1-piyushpatle228@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/10/26 4:13 PM, Piyush Patle wrote: > The driver uses FIELD_GET() for constant-mask fields but falls back > to a raw bit test for the per-channel EOC bit, as the mask depends > on the runtime channel index. A TODO notes that this should switch > to field_get() when available. Could drop this first paragraph, it is a bit redundant. > > Use field_get() here now that runtime-mask support exists, and drop We like for commit messages to start with the verb like this, so this would be ideal for the first paragraph of the commit message. > the obsolete TODO. Since NXP_SAR_ADC_EOC_CH(c) is BIT(c), the > resulting !-test is semantically identical. > > No functional change. > > Signed-off-by: Piyush Patle > --- Reviewed-by: David Lechner And if you are interested in doing more like this, search the IIO subsystem for __ffs. If it is used with << or >> then there is a good chance it could be replaced with field_get() or field_prep().