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=1795828218; b=OQJT4VmLGhZ9+yBG7c6RHXOgCUNv2RHK29Maf2zQRk+rQAmLbaJFXa0BNSvdGoEZZteS 5vNQLui+c/zHz5WlP7PcjSLNCN/dXpTr/tvlEvxNAS8VwBce71owG9L4V8LyPhKC1V3Gz Y2NGd2oR1RaBckaaBNtb52cFRhDrlvAwGqc1AVvBa8VCcjxHCRsuvYdZONX3QHJSIblKU 1xKG2qvbkvH6fzfZPj6RKFtfr6cbrSAy+ZjDxhD0fEILmgAYkL7buDO8GhL5nn9vVIfUR ccGz4sybpGzhXZU/RcM1UjvrWPNWtBqxSoxL3ak0yVYa9bsnyz7X7fRq9Hf4OqPprtQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795828218; 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=4z7W2WBAlgUyUd77FSkVF1Gzr5aZ560MT2l0qj48cG8=; b=MVbHOLEqTxncu65I69F5rOMcJwVv4A/8aQRSiHWF6WjEESPKkpYSeVjCb+QM4Zgzp8bL VjWN5mgKoZJcH8kbrIDZBB2rwUaWIyGieX1SF0KDTWGxPUnIars0DcEA7ojfT1IMvLHnh C8vnA29JYtQnJCfdf3LERz8+MhWR3/NedPRhBk7ky4ke8xVeSAwi9FeBgmtjY1bBvRAzl NILGmJ1dwJiswK9KPE2o1bHMhN2gPiBLQ+vjhqnWP0zYZHAD6+fesl5PlH2gOD71TPnOS liC+3vjbOYxXYWCC3p5Kf3lAMg1wux9QVsprpypwTBburjZDqOzI+DDezMlxcfJDccQ== 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=YdWx54DD; 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)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AB86606A31C; Sat, 28 Nov 2026 01:10:17 +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=YdWx54DD Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FFD41F000C1; Sat, 28 Nov 2026 01:10:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795828217; bh=4z7W2WBAlgUyUd77FSkVF1Gzr5aZ560MT2l0qj48cG8=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=YdWx54DDqHEY5NCf6DnPgcSwgHiRqrN8ZJjuaug6UUA2YoYXmRpuHEfuaOmlu+AdT MoVP6yj2XXUBycOeft/87fCJuZ1y9jn7FVC1/1GBWVx0TfFNPnDUrE5Qxo4PXxKa2O 8eZkD/3lWUL5oN7kxKdkqrnNDsK7qiPIRO4hko2xK6dFVS6HvGNnOuuNs5fgo687lk HRozyHkosiAM+8N7FDidppuvJd1eCZ0Veb18HziDV9CDuEOdDBExA4iqsi0BTZRX9b rJZSg/AawnSFBj0cf8eHGRxhZHtEMZ01neGny+0yTCJnvl2dMjZq/xBGdR3XXG/+t1 ZOlTbBG1QDUNg== Date: Sat, 28 Nov 2026 01:10:10 +0000 From: Jonathan Cameron To: Rodrigo Alencar via B4 Relay Cc: rodrigo.alencar@analog.com, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko Subject: Re: [PATCH v2 0/5] iio: split struct iio_dev_attr into typed core attributes Message-ID: <20261128011010.729b5021@jic23-hlaptop> In-Reply-To: <20261127-iio-core-attr-review-v2-0-e0aed1e8a81c@analog.com> References: <20261127-iio-core-attr-review-v2-0-e0aed1e8a81c@analog.com> 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 Fri, 27 Nov 2026 09:47:43 +0000 Rodrigo Alencar via B4 Relay wrote: > struct iio_dev_attr does three unrelated jobs: it backs the static > attributes declared by drivers through IIO_DEVICE_ATTR*(), the channel > and event attributes generated by the IIO core, and the per-buffer > attributes. Every user carries every field (l, c, buffer), whether it > needs them or not, and the meaning of @address depends on the context: > an info mask bit, an ext_info index, a scan index or, for events, the > event_spec index and the event info packed together. > > This series keeps struct iio_dev_attr as what drivers use (dev_attr and > address) and moves the core-only state into private types embedding it: > > struct iio_chan_attr - core channel attributes (channel, list node) > struct iio_event_attr - extends it with the event spec > struct iio_buffer_attr - extends it with the owning buffer > > Attribute creation is split into iio_chan_attr_prepare(), which builds > the full name and runs the duplicate check, and iio_chan_attr_add(), > which initializes an attribute allocated by the caller. Each context > allocates its own type and sets its own fields, so the core needs no > size, offset or context pointer. Nice. All looks good to me, but as it is a core change I'll let it sit for a little while before applying so others can take a good look. Jonathan