Skip to content

Commit

Permalink
dmaengine: amd: qdma: make read-only arrays h2c_types and c2h_types s…
Browse files Browse the repository at this point in the history
…tatic 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>
  • Loading branch information
Colin Ian King authored and Vinod Koul committed Dec 11, 2024
1 parent 24947be commit 9d88045
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions drivers/dma/amd/qdma/qdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,20 @@ static int qdma_check_queue_status(struct qdma_device *qdev,

static int qdma_clear_queue_context(const struct qdma_queue *queue)
{
enum qdma_ctxt_type h2c_types[] = { QDMA_CTXT_DESC_SW_H2C,
QDMA_CTXT_DESC_HW_H2C,
QDMA_CTXT_DESC_CR_H2C,
QDMA_CTXT_PFTCH, };
enum qdma_ctxt_type c2h_types[] = { QDMA_CTXT_DESC_SW_C2H,
QDMA_CTXT_DESC_HW_C2H,
QDMA_CTXT_DESC_CR_C2H,
QDMA_CTXT_PFTCH, };
static const enum qdma_ctxt_type h2c_types[] = {
QDMA_CTXT_DESC_SW_H2C,
QDMA_CTXT_DESC_HW_H2C,
QDMA_CTXT_DESC_CR_H2C,
QDMA_CTXT_PFTCH,
};
static const enum qdma_ctxt_type c2h_types[] = {
QDMA_CTXT_DESC_SW_C2H,
QDMA_CTXT_DESC_HW_C2H,
QDMA_CTXT_DESC_CR_C2H,
QDMA_CTXT_PFTCH,
};
struct qdma_device *qdev = queue->qdev;
enum qdma_ctxt_type *type;
const enum qdma_ctxt_type *type;
int ret, num, i;

if (queue->dir == DMA_MEM_TO_DEV) {
Expand Down

0 comments on commit 9d88045

Please sign in to comment.