From nobody Thu Apr 9 23:26:36 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 5AC37391509; Wed, 4 Mar 2026 21:44:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772660689; cv=none; b=t6sF6xvT4Wand7Oa5SsG2FHfMLZkI6cgEOPxlHwN5eLF9mLGdeOpyIj8LlnGWhWganFTjvwzquTHBqvTR4WGOja6vCWW73WaVSk/img6GvHWM6bZ0qoH7Fi7owSt11Vb2IBeR70DxspOS/MXnt+NL9S0aDWT3WUbWL0A3pQhj5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772660689; c=relaxed/simple; bh=0UDMDkjb8WJZMULKSnbYf1ZtZnInuZDplfeZj4cMVHI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K2MhHB+dHPE07lhv9CynxBvRUQ37fJGPq/6kppgYRIDFc+gG3c7kn3Ol9cLwu54+vq9croJFYXup1cohQD6JSlbgpT/h/BbC6Z6eC5Q14eJ1Lrk0lPwHQjizy/0wxnOaGDuA/Ns0MwYvKakpz8bc6M+p6UYfa2qa/21g10aOlZM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=SdckAATa; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="SdckAATa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1772660680; bh=0UDMDkjb8WJZMULKSnbYf1ZtZnInuZDplfeZj4cMVHI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=SdckAATaaM+GFlu9CQuoIwHUYwHWbFC5a4LKAx0eW22B2syaDw33fu/q8IN8KDIkq P3+GhIA8ZUuyNlWTktMk0jVgQUsnHnqH1KqFXcczbs40NDX94ML1GNZbgyAp7ev+Ps tmuqkCS5hYdkn+9rI9igMoguGZkuqgxOglGPROXI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Wed, 04 Mar 2026 22:44:37 +0100 Subject: [PATCH v2 1/4] dmaengine: ioatdma: make some sysfs structures static 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260304-sysfs-const-ioat-v2-1-b9b82651219b@weissschuh.net> References: <20260304-sysfs-const-ioat-v2-0-b9b82651219b@weissschuh.net> In-Reply-To: <20260304-sysfs-const-ioat-v2-0-b9b82651219b@weissschuh.net> To: Vinod Koul , Frank Li Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Jiang , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Frank Li X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772660679; l=2113; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=0UDMDkjb8WJZMULKSnbYf1ZtZnInuZDplfeZj4cMVHI=; b=FWxr734bTV6PkJ8vhahxJmV/D+Zq737jUY1VxZso72vv8sBxIKOZsjxTUbwMPNC8Gx+lssu9n uiVF2oklLTfCRWKe3FZRDO/7on4b0j4LUWIbUm8IxzJWa2Bm+nupJT4 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= These structures are only used in sysfs.c, where are defined. Make them static and remove them from the header. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Frank Li Acked-by: Dave Jiang --- drivers/dma/ioat/dma.h | 3 --- drivers/dma/ioat/sysfs.c | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h index 12a4a4860a74..27d2b411853f 100644 --- a/drivers/dma/ioat/dma.h +++ b/drivers/dma/ioat/dma.h @@ -195,9 +195,6 @@ struct ioat_ring_ent { struct ioat_sed_ent *sed; }; =20 -extern const struct sysfs_ops ioat_sysfs_ops; -extern struct ioat_sysfs_entry ioat_version_attr; -extern struct ioat_sysfs_entry ioat_cap_attr; extern int ioat_pending_level; extern struct kobj_type ioat_ktype; extern struct kmem_cache *ioat_cache; diff --git a/drivers/dma/ioat/sysfs.c b/drivers/dma/ioat/sysfs.c index 168adf28c5b1..5da9b0a7b2bb 100644 --- a/drivers/dma/ioat/sysfs.c +++ b/drivers/dma/ioat/sysfs.c @@ -26,7 +26,7 @@ static ssize_t cap_show(struct dma_chan *c, char *page) dma_has_cap(DMA_INTERRUPT, dma->cap_mask) ? " intr" : ""); =20 } -struct ioat_sysfs_entry ioat_cap_attr =3D __ATTR_RO(cap); +static struct ioat_sysfs_entry ioat_cap_attr =3D __ATTR_RO(cap); =20 static ssize_t version_show(struct dma_chan *c, char *page) { @@ -36,7 +36,7 @@ static ssize_t version_show(struct dma_chan *c, char *pag= e) return sprintf(page, "%d.%d\n", ioat_dma->version >> 4, ioat_dma->version & 0xf); } -struct ioat_sysfs_entry ioat_version_attr =3D __ATTR_RO(version); +static struct ioat_sysfs_entry ioat_version_attr =3D __ATTR_RO(version); =20 static ssize_t ioat_attr_show(struct kobject *kobj, struct attribute *attr, char *page) @@ -67,7 +67,7 @@ const char *page, size_t count) return entry->store(&ioat_chan->dma_chan, page, count); } =20 -const struct sysfs_ops ioat_sysfs_ops =3D { +static const struct sysfs_ops ioat_sysfs_ops =3D { .show =3D ioat_attr_show, .store =3D ioat_attr_store, }; --=20 2.53.0 From nobody Thu Apr 9 23:26:36 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 5AAF138654B; Wed, 4 Mar 2026 21:44:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772660689; cv=none; b=CYYsyoXyP/lH/ywqN8fleoi5gLKJ4K47F5TAohGqMjPZ/Ko4/7+6xIDXGxXtYjlSsharNBjRMfaD7vEx+29U4nf+aC3he177Wz2THBnd3D9NNlEVrqqkfzO3YO61Pn6mr4lK5PBXI1qYFIGeG7RApL3/XKWZawCcG9uYenzrVd0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772660689; c=relaxed/simple; bh=TOXRp74+x+/yWvNgf1Ny0A5lDlWUPBA5uza0wqVRIFg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nShttqEn55wVnVF4bZV0rzo3FgTDR/0kS9YDbvA5Eelprnvnr0sERjXba7sJdwRxhyS6WzFrp58wJtNmiq1Xxb9aoQ2GycgnZ9v1ayWebBK0nkgEzU/KKnIGqCrklyKwRaAbvxhMag7dhhr+Z3lUG02c4Nas6kn7cYEdflzo5cE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=GwK0aRrt; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="GwK0aRrt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1772660680; bh=TOXRp74+x+/yWvNgf1Ny0A5lDlWUPBA5uza0wqVRIFg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GwK0aRrt+hnxIeZOdZkXS2tL5Qz9PagpWqa5Skwu/akdKmGPq7TX9DBLQMV7Lcmn8 5DmWIvBu7OEYkY1LEzz6y6qxE2S149k410aJ8MrA7USV1akQYk2yHbwydd4moB9OF2 HVktU987am5ET1QQxHblqmwAA3TYrMAg2VZWTM/A= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Wed, 04 Mar 2026 22:44:38 +0100 Subject: [PATCH v2 2/4] dmaengine: ioatdma: move sysfs entry definition out of header 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260304-sysfs-const-ioat-v2-2-b9b82651219b@weissschuh.net> References: <20260304-sysfs-const-ioat-v2-0-b9b82651219b@weissschuh.net> In-Reply-To: <20260304-sysfs-const-ioat-v2-0-b9b82651219b@weissschuh.net> To: Vinod Koul , Frank Li Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Jiang , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772660679; l=1298; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=TOXRp74+x+/yWvNgf1Ny0A5lDlWUPBA5uza0wqVRIFg=; b=CHQCaKvX35Z1k3FgBg5VqYQx1Nq71cCbr9dqaCsJPOPIZ+KSte+vT1Hf6YqOTmyz6hbsfpWov yjMS/3BhRrRDVkYem1GF/PQJORHWblD5ummZwS3jctLOI8U0BkIcyR5 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Move struct ioat_sysfs_entry into sysfs.c because it is only used in it. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Dave Jiang Reviewed-by: Frank Li --- drivers/dma/ioat/dma.h | 6 ------ drivers/dma/ioat/sysfs.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h index 27d2b411853f..e187f3a7e968 100644 --- a/drivers/dma/ioat/dma.h +++ b/drivers/dma/ioat/dma.h @@ -140,12 +140,6 @@ struct ioatdma_chan { int prev_intr_coalesce; }; =20 -struct ioat_sysfs_entry { - struct attribute attr; - ssize_t (*show)(struct dma_chan *, char *); - ssize_t (*store)(struct dma_chan *, const char *, size_t); -}; - /** * struct ioat_sed_ent - wrapper around super extended hardware descriptor * @hw: hardware SED diff --git a/drivers/dma/ioat/sysfs.c b/drivers/dma/ioat/sysfs.c index 5da9b0a7b2bb..709d672bae51 100644 --- a/drivers/dma/ioat/sysfs.c +++ b/drivers/dma/ioat/sysfs.c @@ -14,6 +14,12 @@ =20 #include "../dmaengine.h" =20 +struct ioat_sysfs_entry { + struct attribute attr; + ssize_t (*show)(struct dma_chan *, char *); + ssize_t (*store)(struct dma_chan *, const char *, size_t); +}; + static ssize_t cap_show(struct dma_chan *c, char *page) { struct dma_device *dma =3D c->device; --=20 2.53.0 From nobody Thu Apr 9 23:26:36 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 5AB7A390217; Wed, 4 Mar 2026 21:44:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772660691; cv=none; b=nEhqCI1fwjnycXXUJGrwC0Eo1K2HiNwTkOrdp/H+AAn6NptMGnkCU7cHi7pxywFqlEE3p7lf3kxnmwu2HZApm1WCemOnZfyB/4GB9GL6easPsQgyksvm6o2ftf/Pibg5oukINclrkPF7Zgs+h66fqOsYZnRN4d6rSbUnuhjWqH0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772660691; c=relaxed/simple; bh=2FdnGFzqnWpzV8ZyzR2XFjyDCkUhaUkEmqYLduGNUsQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Wno/qySQo9MI3afyY50xR1b3oFn0D3AYHuLR2eEBFckV2xpsVa3qJa+gaJycvqrMHKjF0pFxReC1xYy2dO56H/GwdiLn1zrXVfhfPyB5Jkrb3D5k/4QOWANZNNPGqjCcT2SlW85oEXrqkK3NHRFn2eymV9trBP8L6KG6j8WcB94= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=Oaf578yf; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Oaf578yf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1772660680; bh=2FdnGFzqnWpzV8ZyzR2XFjyDCkUhaUkEmqYLduGNUsQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Oaf578yfokBrfEm08oghzR85cRfndXg5jVo3/LKZ0s7jWrcCmZv9nx61KIX7hO7iV Br+lb3DCi5ZCKaGzUEpYqy7skCG1LgOuW5HXI//iUVCPBE+zAjubHMc3x8kisl9SzW O28rhbxn0uzPvxqSKmxsgNWh+S+co9VW9yZh2TaQ= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Wed, 04 Mar 2026 22:44:39 +0100 Subject: [PATCH v2 3/4] dmaengine: ioatdma: make ioat_ktype const 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260304-sysfs-const-ioat-v2-3-b9b82651219b@weissschuh.net> References: <20260304-sysfs-const-ioat-v2-0-b9b82651219b@weissschuh.net> In-Reply-To: <20260304-sysfs-const-ioat-v2-0-b9b82651219b@weissschuh.net> To: Vinod Koul , Frank Li Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Jiang , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772660679; l=2043; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=2FdnGFzqnWpzV8ZyzR2XFjyDCkUhaUkEmqYLduGNUsQ=; b=BBVWmQRTOugoALdhYAZSFgCTvgSc7VlBvawmr1XtSlCTLOqoMkJXScSKMvosL6Q+EfBfSBP19 rpPlDc4+uE6DbscSx0dmVesB1TFnoYquEhmuqE9PPACuE7wPSV5n7De X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= ioat_ktype is never modified, so make it const. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Dave Jiang Reviewed-by: Frank Li --- drivers/dma/ioat/dma.h | 4 ++-- drivers/dma/ioat/sysfs.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h index e187f3a7e968..e8a880f338c6 100644 --- a/drivers/dma/ioat/dma.h +++ b/drivers/dma/ioat/dma.h @@ -190,7 +190,7 @@ struct ioat_ring_ent { }; =20 extern int ioat_pending_level; -extern struct kobj_type ioat_ktype; +extern const struct kobj_type ioat_ktype; extern struct kmem_cache *ioat_cache; extern struct kmem_cache *ioat_sed_cache; =20 @@ -393,7 +393,7 @@ void ioat_issue_pending(struct dma_chan *chan); /* IOAT Init functions */ bool is_bwd_ioat(struct pci_dev *pdev); struct dca_provider *ioat_dca_init(struct pci_dev *pdev, void __iomem *iob= ase); -void ioat_kobject_add(struct ioatdma_device *ioat_dma, struct kobj_type *t= ype); +void ioat_kobject_add(struct ioatdma_device *ioat_dma, const struct kobj_t= ype *type); void ioat_kobject_del(struct ioatdma_device *ioat_dma); int ioat_dma_setup_interrupts(struct ioatdma_device *ioat_dma); void ioat_stop(struct ioatdma_chan *ioat_chan); diff --git a/drivers/dma/ioat/sysfs.c b/drivers/dma/ioat/sysfs.c index 709d672bae51..da616365fef5 100644 --- a/drivers/dma/ioat/sysfs.c +++ b/drivers/dma/ioat/sysfs.c @@ -78,7 +78,7 @@ static const struct sysfs_ops ioat_sysfs_ops =3D { .store =3D ioat_attr_store, }; =20 -void ioat_kobject_add(struct ioatdma_device *ioat_dma, struct kobj_type *t= ype) +void ioat_kobject_add(struct ioatdma_device *ioat_dma, const struct kobj_t= ype *type) { struct dma_device *dma =3D &ioat_dma->dma_dev; struct dma_chan *c; @@ -166,7 +166,7 @@ static struct attribute *ioat_attrs[] =3D { }; ATTRIBUTE_GROUPS(ioat); =20 -struct kobj_type ioat_ktype =3D { +const struct kobj_type ioat_ktype =3D { .sysfs_ops =3D &ioat_sysfs_ops, .default_groups =3D ioat_groups, }; --=20 2.53.0 From nobody Thu Apr 9 23:26:36 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 6A7D53932D6; Wed, 4 Mar 2026 21:44:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772660689; cv=none; b=Yq6Ol9z2dgRf4N6mIBzD/uz6Nq6K/cUk7jsG3V+TOjDHLvFtxjeVLLqx/Mpl84Fln1g/TjRLyfb2HBKjlhavMfkTdPQzQiwFg+ha5DOZRpjLPzgf37OImNoz+/4M0sapFblJnWaFkt9+quZRMPo7ZI+f21qZNVdLA1JkiNsJvBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772660689; c=relaxed/simple; bh=au4hr4SRiPU1CnIo4lT89wqmdY1G78qriD+p3/2be7Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MvvsyHrRka69QE5sdFTZdnirBjw4gt4jBnyg3F1Rtj+P+37yz/vCZuQBT37qEol0JWqPYdZ6xyd7eGhkTOqsoNhJK8K/gDugGi090NhXDGO8iQ36M0Dleihc3z+WvqUU+7qb5p3JAzT/L35iCJ01MX9fYtLRuD/J/e3inhBw2oU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=lkt88XuF; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="lkt88XuF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1772660680; bh=au4hr4SRiPU1CnIo4lT89wqmdY1G78qriD+p3/2be7Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lkt88XuF0bgl6pcTn8jxSitfEx7DlWgFtA845JlrIBEbEd5hembPHPdb8QxWncDns 36WA+A3Bnj/u91yff9U9QW//AHOnX6uY49Z8f0tF+VwOeyQ8k2roBWkBs+MI/wjFth vUIAmfjCQNPIrxH/2Mh/8bv40ryLbatEhBg5Rf+0= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Wed, 04 Mar 2026 22:44:40 +0100 Subject: [PATCH v2 4/4] dmaengine: ioatdma: make sysfs attributes const 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260304-sysfs-const-ioat-v2-4-b9b82651219b@weissschuh.net> References: <20260304-sysfs-const-ioat-v2-0-b9b82651219b@weissschuh.net> In-Reply-To: <20260304-sysfs-const-ioat-v2-0-b9b82651219b@weissschuh.net> To: Vinod Koul , Frank Li Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Jiang , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772660679; l=3296; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=au4hr4SRiPU1CnIo4lT89wqmdY1G78qriD+p3/2be7Y=; b=cgSBUmOQFXnxgLvDYscfzOi34Fp2hRFph9czGTcEg/5uzj8K7iwgPvAIdVS8AJf+rtW1DRN+X bYdWmqXG6t4CCSaN+X1mFPDgX1I3lJIzIPg93ypVZpDXS9PjN84Txm4 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The ioat_sysfs_entry structures are never modified, mark them as read-only. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Dave Jiang Reviewed-by: Frank Li --- drivers/dma/ioat/sysfs.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/dma/ioat/sysfs.c b/drivers/dma/ioat/sysfs.c index da616365fef5..e796ddb5383f 100644 --- a/drivers/dma/ioat/sysfs.c +++ b/drivers/dma/ioat/sysfs.c @@ -32,7 +32,7 @@ static ssize_t cap_show(struct dma_chan *c, char *page) dma_has_cap(DMA_INTERRUPT, dma->cap_mask) ? " intr" : ""); =20 } -static struct ioat_sysfs_entry ioat_cap_attr =3D __ATTR_RO(cap); +static const struct ioat_sysfs_entry ioat_cap_attr =3D __ATTR_RO(cap); =20 static ssize_t version_show(struct dma_chan *c, char *page) { @@ -42,15 +42,15 @@ static ssize_t version_show(struct dma_chan *c, char *p= age) return sprintf(page, "%d.%d\n", ioat_dma->version >> 4, ioat_dma->version & 0xf); } -static struct ioat_sysfs_entry ioat_version_attr =3D __ATTR_RO(version); +static const struct ioat_sysfs_entry ioat_version_attr =3D __ATTR_RO(versi= on); =20 static ssize_t ioat_attr_show(struct kobject *kobj, struct attribute *attr, char *page) { - struct ioat_sysfs_entry *entry; + const struct ioat_sysfs_entry *entry; struct ioatdma_chan *ioat_chan; =20 - entry =3D container_of(attr, struct ioat_sysfs_entry, attr); + entry =3D container_of_const(attr, struct ioat_sysfs_entry, attr); ioat_chan =3D container_of(kobj, struct ioatdma_chan, kobj); =20 if (!entry->show) @@ -62,10 +62,10 @@ static ssize_t ioat_attr_store(struct kobject *kobj, struct attribute *attr, const char *page, size_t count) { - struct ioat_sysfs_entry *entry; + const struct ioat_sysfs_entry *entry; struct ioatdma_chan *ioat_chan; =20 - entry =3D container_of(attr, struct ioat_sysfs_entry, attr); + entry =3D container_of_const(attr, struct ioat_sysfs_entry, attr); ioat_chan =3D container_of(kobj, struct ioatdma_chan, kobj); =20 if (!entry->store) @@ -120,7 +120,7 @@ static ssize_t ring_size_show(struct dma_chan *c, char = *page) =20 return sprintf(page, "%d\n", (1 << ioat_chan->alloc_order) & ~1); } -static struct ioat_sysfs_entry ring_size_attr =3D __ATTR_RO(ring_size); +static const struct ioat_sysfs_entry ring_size_attr =3D __ATTR_RO(ring_siz= e); =20 static ssize_t ring_active_show(struct dma_chan *c, char *page) { @@ -129,7 +129,7 @@ static ssize_t ring_active_show(struct dma_chan *c, cha= r *page) /* ...taken outside the lock, no need to be precise */ return sprintf(page, "%d\n", ioat_ring_active(ioat_chan)); } -static struct ioat_sysfs_entry ring_active_attr =3D __ATTR_RO(ring_active); +static const struct ioat_sysfs_entry ring_active_attr =3D __ATTR_RO(ring_a= ctive); =20 static ssize_t intr_coalesce_show(struct dma_chan *c, char *page) { @@ -154,9 +154,9 @@ size_t count) return count; } =20 -static struct ioat_sysfs_entry intr_coalesce_attr =3D __ATTR_RW(intr_coale= sce); +static const struct ioat_sysfs_entry intr_coalesce_attr =3D __ATTR_RW(intr= _coalesce); =20 -static struct attribute *ioat_attrs[] =3D { +static const struct attribute *const ioat_attrs[] =3D { &ring_size_attr.attr, &ring_active_attr.attr, &ioat_cap_attr.attr, --=20 2.53.0