From nobody Tue Mar 3 03:40:07 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 2ED80282F1F; Mon, 2 Mar 2026 22:16:05 +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=1772489766; cv=none; b=TTgayw/r+wPGe9gji0VsLR+LyX/evsIUN0ggMOdlnp40MkLgUnAfsBImlFAK6bxeL78qO4hNphhEqIxHt/61xHj2aCJlcfbCJtIPyaX6uKbnkM5jlWuGRjrvAMFCNVGsqcVnmrh8AmWtwxAkhkNIFClSB8/V7XnG70cXiukwhxE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772489766; c=relaxed/simple; bh=N6pRa7MR4zOTf2tg5PnQq/tYXg/g2RnpUcrfDh85gRg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j2op9s4cPDDh3fOYqBs7Y0zOqBlzzYJyDlhmFqIaIe988i6u3QXHd0aZKkqcjdMqZ1QR/GLQYTAEjzykVaH7ohEjtlHbcixHF1bNV1W90gTGfY5EDOztdhsMU4saWczCpuljml7mSs1qQ3lWtUExGOCHFUvRGRJHT8Wv77nJNW0= 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=V/aCj/vh; 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="V/aCj/vh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1772489757; bh=N6pRa7MR4zOTf2tg5PnQq/tYXg/g2RnpUcrfDh85gRg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=V/aCj/vhj7KxdcVbX0Uzuo05Tttx7LzyeCkRnUtHNPHPs5s4nu930wqk9wl1F1ziD Dj0TZTBV2XFAScmoEGqy9Q9uU/GnPdEsRvWw/PAnRB1PpyateBI9/r26uUveJSvzGt TERmGlUVfavrfDN0CbcCW1Bw8uzfHQhOqghsIdL8= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 02 Mar 2026 23:15:53 +0100 Subject: [PATCH 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: <20260302-sysfs-const-ioat-v1-1-1229ee1c83f3@weissschuh.net> References: <20260302-sysfs-const-ioat-v1-0-1229ee1c83f3@weissschuh.net> In-Reply-To: <20260302-sysfs-const-ioat-v1-0-1229ee1c83f3@weissschuh.net> To: Vinod Koul , Frank Li Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772489756; l=2026; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=N6pRa7MR4zOTf2tg5PnQq/tYXg/g2RnpUcrfDh85gRg=; b=8ONKprOIfHXiF7lIUjKwMtjC2RP+3xd55DpTX0KwqCMsZ3d1yiwOtQPy4074tHWY+XiSmzRJz N5iV9R+Wy+fArlRY1ms7pBTpNYZONKyx2EwSwgYL82hUVU2Bzf1Vd/M 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 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 Tue Mar 3 03:40:07 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 28E981DE3B7; Mon, 2 Mar 2026 22:16:05 +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=1772489767; cv=none; b=GK4HPycJKJ/L+dGK4fFRzPiXATrpjpd0dwfpFLZ6AFDWwrhyOip39qWGoRoKq121drnmZpaKP+IB9eHvlilYZGCQfBRrfOnGctL0s8DVmaA3nyYXr9fg8wsOVL43zpyZIYh1W05KvN1Dovr3gSj0Z52KGWOaa5FJ0GUYiVPIEH4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772489767; c=relaxed/simple; bh=uCHVU4aMcslsNR62ySaA3wlI0q+wLxUZU06lIe7mkAQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cldlyJHYsfMxuLUGYeNSOreCr5wWAjLhTWvYQItQ5lX+yFYVpbclh2oJ++9CntP9UmU8KokWrT0B4iS4ejKBmDmHm/DZyO8Z+696lHpr5mgSa6qhew4HdOVA00AG/CBRnShYZSKzN5Iws05Vw2+NIY7tui8k+/js0hh48WE1GG8= 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=rHHjByPQ; 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="rHHjByPQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1772489757; bh=uCHVU4aMcslsNR62ySaA3wlI0q+wLxUZU06lIe7mkAQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rHHjByPQ7VSCVYmT/hFgPjBiI6rSh7dqWodNiFcZt8r2LpzVGeWOS9DlsySXkzF2/ XOi019NVuwhTaSK/P9dR3ta1dToGmuti8VwTg5MJ0ms4y5uDIEIZ8U7JIkjO5BIBTA jWdG/VeDz30TLfmxLFKix1GZjiIMMhzIw/z5eKmM= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 02 Mar 2026 23:15:54 +0100 Subject: [PATCH 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: <20260302-sysfs-const-ioat-v1-2-1229ee1c83f3@weissschuh.net> References: <20260302-sysfs-const-ioat-v1-0-1229ee1c83f3@weissschuh.net> In-Reply-To: <20260302-sysfs-const-ioat-v1-0-1229ee1c83f3@weissschuh.net> To: Vinod Koul , Frank Li Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772489756; l=1302; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=uCHVU4aMcslsNR62ySaA3wlI0q+wLxUZU06lIe7mkAQ=; b=cWF078ulHq3Rtdxph2M53Tytl9OqEu4aygFEl8VOH8vwEf6ksqSlB/7ZM5b2mDrnc1NTxjSbB OpQ0+VfIDueAt1mVbzReFwTnv7iJvsk1T8ibjIRUEJl0Gpk8LHq42Q7 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This structure is only ever used from sysfs.c. Move its definition there. Signed-off-by: Thomas Wei=C3=9Fschuh --- 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 Tue Mar 3 03:40:07 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 8AFA12773D3; Mon, 2 Mar 2026 22:16:04 +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=1772489766; cv=none; b=FRWc83tEYfnwr7R6wNFPlOYR54J/reu+pqXTOuj4M4iWeVW+7F+sQTHoq9yxvGyjiIc/hZMUcmPF83w+gT7OySYks82r2aPTxurOZVVGfMpi91WgMN400KkFPBGhwCdiFGjzb6afYwYnefr2BpmN9c5o7DbGCisOTqiX6DXAhdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772489766; c=relaxed/simple; bh=8qssZhIohoDDRPi+YpLr+uyOfmbuE0gxulu87WlTB7k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LH/eRY9p8l0zqVDIT+uYnuJiY5CLeTJM9xuuZ9SDeApla018Ssdo4rzv8sqfom9i/lA4qL+sZGZRilH4bUNQzpTq7Ekv6SAtsavFjC1rZN+bkben/ez2PmwXTilCGQNQnRtd4BvqnsRe+rsXYffV0R0ClLp/42Y/lQlFkV7PNNY= 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=Y+zUGUAn; 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="Y+zUGUAn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1772489757; bh=8qssZhIohoDDRPi+YpLr+uyOfmbuE0gxulu87WlTB7k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Y+zUGUAn66T8KY5lKVXH/XER7FhjZ3KNDNKMXXyCPZReIUKSa3dJMb2B0kdMYd9pP 5QYbRHqqFtjprGOJyIL6ny8uGw8cfkYWxWqeQUvzOEWzOXvwVryMvPyEUBJ5K9ukTq 6CzzSzXN/ECATCBibXbRmMPSTD5cKE5x9USdxu2Y= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 02 Mar 2026 23:15:55 +0100 Subject: [PATCH 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: <20260302-sysfs-const-ioat-v1-3-1229ee1c83f3@weissschuh.net> References: <20260302-sysfs-const-ioat-v1-0-1229ee1c83f3@weissschuh.net> In-Reply-To: <20260302-sysfs-const-ioat-v1-0-1229ee1c83f3@weissschuh.net> To: Vinod Koul , Frank Li Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772489756; l=2006; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=8qssZhIohoDDRPi+YpLr+uyOfmbuE0gxulu87WlTB7k=; b=q9lshFTjon3XTRnnsrCJWEEC8v3SCBoVYGY1TX2YjL3vxGTlnO0ZdBiK1XtoYt4upQNitfQNe 2J644+kEoGUDh5+ztJb4a9HOQ3nQBdYlA82NcQ6MI9QO2ZIo0NbeYQM X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This structure is never modified, mark is as read-only. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Dave Jiang --- 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 Tue Mar 3 03:40:07 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 30027282F20; Mon, 2 Mar 2026 22:16:05 +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=1772489766; cv=none; b=g1vHCUNudC//quUnl4q0MaOkXpPujVKCffBP6WEnCrfbCSFCXS/tuiOwyZPXb0ENOUpA2zhrDCnPr3gSPGHjfWSOXYES9brRccKVYXSEpSqgYSkujNJMUQ3QlfonoaCYL/nwWM5TgZanEU7eqFSFiZvFwGOZ2Epzi7v+CexR9G0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772489766; c=relaxed/simple; bh=Yx4uswrVJCSfE8uQc/bTycKNIy1H/0NEEIeSIPlEKB4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MyhLJBHZTgGw0dqnrRfBDODBSu0RB/fyhOPaWGbuViEvxAISYaZufnmlywzXku756PV0Q+uIeVqvpJTjpXBxm4ANKj4tYJJ8um1KeYFCSgxA94veGJVSu/f/kPpIyzbFAd3fmBSXFU5UQA3iI0nqT7XfM+a0Ctfk9FGEYzoxY2Y= 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=AOGGwHOh; 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="AOGGwHOh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1772489757; bh=Yx4uswrVJCSfE8uQc/bTycKNIy1H/0NEEIeSIPlEKB4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=AOGGwHOhMwrU3hr2+0OCWymQq5ROcDa7xKFfqE6+ph0wbHLGiPeXNZwwbuD2Nc5Uo vd7Olmc2WCMM5RRnf+drTfb5q7rMj/OWNSPDvCu/05vHQs/3xijs+aBkc7P+i/JcYb rVJ/r7VpwBLyb5DZVWMUAQI8aDAw3osOMNIgc8Y4= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 02 Mar 2026 23:15:56 +0100 Subject: [PATCH 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: <20260302-sysfs-const-ioat-v1-4-1229ee1c83f3@weissschuh.net> References: <20260302-sysfs-const-ioat-v1-0-1229ee1c83f3@weissschuh.net> In-Reply-To: <20260302-sysfs-const-ioat-v1-0-1229ee1c83f3@weissschuh.net> To: Vinod Koul , Frank Li Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772489756; l=3235; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=Yx4uswrVJCSfE8uQc/bTycKNIy1H/0NEEIeSIPlEKB4=; b=0JTEQCGs8kJZCdx+u9T9Q88P5vmDTWMyXLht9rO+1z+LW5siUf50kblsRtIX8jNCbef6PtPhM SsNLqyMoZzLBZHU0244VdopQOIjWGN3gj+4VWtoIklZtBi2z1NGCZrZ X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= These structures are never modified, mark them as read-only. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Dave Jiang --- 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