diff options
| author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2026-07-14 16:06:33 +0200 |
|---|---|---|
| committer | Vinod Koul <vkoul@kernel.org> | 2026-07-17 18:00:34 +0530 |
| commit | 338c853b7c3b422fefda195b9b8010e40611c96f (patch) | |
| tree | ff2a3b2b449f5c37c237615b352ddd05937f1af8 /include/linux | |
| parent | dc8a5238e1c7db74a7b4f02bcf0b05559b6627c5 (diff) | |
dmaengine: Constify struct dma_descriptor_metadata_ops
'struct dma_descriptor_metadata_ops' in not modified in these drivers.
Constifying these structures moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.
On a x86_64, with allmodconfig, as an example:
Before:
======
text data bss dec hex filename
120635 21584 64 142283 22bcb drivers/dma/xilinx/xilinx_dma.o
After:
=====
text data bss dec hex filename
120699 21520 64 142283 22bcb drivers/dma/xilinx/xilinx_dma.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Sai Sree Kartheek Adivi <s-adivi@ti.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Link: https://patch.msgid.link/b0a22171f3ed68e156a2fa84383e99c23ec6b2ff.1784037977.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/dmaengine.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 6fe46c0c9452..fe33a20abc61 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -631,7 +631,7 @@ struct dma_async_tx_descriptor { void *callback_param; struct dmaengine_unmap_data *unmap; enum dma_desc_metadata_mode desc_metadata_mode; - struct dma_descriptor_metadata_ops *metadata_ops; + const struct dma_descriptor_metadata_ops *metadata_ops; #ifdef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH struct dma_async_tx_descriptor *next; struct dma_async_tx_descriptor *parent; |
