Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: amd: qdma: make read-only arrays h2c_types and c2h_types static const

Don't populate the read-only arrays h2c_types and c2h_types on the
stack at run time, instead make them static const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20240912131017.588141-1-colin.i.king@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Colin Ian King and committed by
Vinod Koul
9d880452 24947be1

+13 -9
+13 -9
drivers/dma/amd/qdma/qdma.c
··· 283 283 284 284 static int qdma_clear_queue_context(const struct qdma_queue *queue) 285 285 { 286 - enum qdma_ctxt_type h2c_types[] = { QDMA_CTXT_DESC_SW_H2C, 287 - QDMA_CTXT_DESC_HW_H2C, 288 - QDMA_CTXT_DESC_CR_H2C, 289 - QDMA_CTXT_PFTCH, }; 290 - enum qdma_ctxt_type c2h_types[] = { QDMA_CTXT_DESC_SW_C2H, 291 - QDMA_CTXT_DESC_HW_C2H, 292 - QDMA_CTXT_DESC_CR_C2H, 293 - QDMA_CTXT_PFTCH, }; 286 + static const enum qdma_ctxt_type h2c_types[] = { 287 + QDMA_CTXT_DESC_SW_H2C, 288 + QDMA_CTXT_DESC_HW_H2C, 289 + QDMA_CTXT_DESC_CR_H2C, 290 + QDMA_CTXT_PFTCH, 291 + }; 292 + static const enum qdma_ctxt_type c2h_types[] = { 293 + QDMA_CTXT_DESC_SW_C2H, 294 + QDMA_CTXT_DESC_HW_C2H, 295 + QDMA_CTXT_DESC_CR_C2H, 296 + QDMA_CTXT_PFTCH, 297 + }; 294 298 struct qdma_device *qdev = queue->qdev; 295 - enum qdma_ctxt_type *type; 299 + const enum qdma_ctxt_type *type; 296 300 int ret, num, i; 297 301 298 302 if (queue->dir == DMA_MEM_TO_DEV) {