Skip to content

Commit 724d82f

Browse files
committed
dmaengine: sdxi: context: Use named constants for shifting DMA addrs
Use the *_PTR_SHIFT macros we have already defined instead of 3, 4, 6. Signed-off-by: Nathan Lynch <nathan.lynch@amd.com>
1 parent 6c138ad commit 724d82f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/dma/sdxi/context.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ static int configure_cxt_ctl(struct sdxi_cxt_ctl *ctl, const struct sdxi_cxt_ctl
123123
u64 ds_ring_ptr, cxt_sts_ptr, write_index_ptr;
124124

125125
write_index_ptr = FIELD_PREP(SDXI_CXT_CTL_WRITE_INDEX_PTR,
126-
cfg->write_index_ptr >> 3);
126+
cfg->write_index_ptr >> WRT_INDEX_PTR_SHIFT);
127127
cxt_sts_ptr = FIELD_PREP(SDXI_CXT_CTL_CXT_STS_PTR,
128-
cfg->cxt_sts_ptr >> 4);
128+
cfg->cxt_sts_ptr >> CXT_STATUS_PTR_SHIFT);
129129

130130
*ctl = (typeof(*ctl)) {
131131
/*
@@ -141,7 +141,8 @@ static int configure_cxt_ctl(struct sdxi_cxt_ctl *ctl, const struct sdxi_cxt_ctl
141141
FIELD_PREP(SDXI_CXT_CTL_QOS, cfg->qos) |
142142
FIELD_PREP(SDXI_CXT_CTL_SE, cfg->se) |
143143
FIELD_PREP(SDXI_CXT_CTL_CSA, cfg->csa) |
144-
FIELD_PREP(SDXI_CXT_CTL_DS_RING_PTR, cfg->ds_ring_ptr >> 6);
144+
FIELD_PREP(SDXI_CXT_CTL_DS_RING_PTR,
145+
cfg->ds_ring_ptr >> DESC_RING_BASE_PTR_SHIFT);
145146
/* Ensure other fields are visible before hw sees vl=1. */
146147
dma_wmb();
147148
WRITE_ONCE(ctl->ds_ring_ptr, cpu_to_le64(ds_ring_ptr));

0 commit comments

Comments
 (0)