Commit 1cc89467 authored by zhangyuyang's avatar zhangyuyang
Browse files

drivers:misc:sdma-dae: remove unnecessary return in void function

kunpeng inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/


CVE: NA

----------------------------------------------------------------------

1. remove unnecessary return statement in void function.

Fixes: f8eeb398 ("drivers: misc: sdma-dae: support channel management")
Signed-off-by: default avatarzhangyuyang <zhangyuyang31@huawei.com>
parent 22939594
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -263,8 +263,6 @@ static void sdma_pause_single_channel(struct hisi_sdma_channel *pchannel,
	else
		pr_warn("SDMA %u chn %hu hardware not write back all cqes!\n",
			psdma_dev->idx, idx);

	return;
}

static void sdma_pause_channels(struct hisi_sdma_device *psdma_dev)
@@ -276,8 +274,6 @@ static void sdma_pause_channels(struct hisi_sdma_device *psdma_dev)
		pchannel = psdma_dev->channels + i;
		sdma_pause_single_channel(pchannel, psdma_dev);
	}

	return;
}

static void sdma_wait_channel_quiescent(struct hisi_sdma_device *psdma_dev)
@@ -296,8 +292,6 @@ static void sdma_wait_channel_quiescent(struct hisi_sdma_device *psdma_dev)
			pr_warn("SDMA %u chn %d hardware not write back all cqes!\n",
				psdma_dev->idx, i);
	}

	return;
}

static void sdma_resume_channel(struct hisi_sdma_device *psdma_dev)
@@ -316,8 +310,6 @@ static void sdma_resume_channel(struct hisi_sdma_device *psdma_dev)
		if (sdma_channel_is_paused(pchannel) && sdma_channel_is_quiescent(pchannel))
			sdma_channel_write_resume(pchannel);
	}

	return;
}

static void sdma_mmu_release_pause(struct mmu_notifier *mn, struct mm_struct *mm)
@@ -343,8 +335,6 @@ static void sdma_mmu_release_pause(struct mmu_notifier *mn, struct mm_struct *mm
			sdma_wait_channel_quiescent(psdma_dev);
		}
	}

	return;
}

static void sdma_mmu_release_resume(struct mmu_notifier *mn, struct mm_struct *mm)
@@ -368,8 +358,6 @@ static void sdma_mmu_release_resume(struct mmu_notifier *mn, struct mm_struct *m
		}
		atomic_set(&exit_processes, 0);
	}

	return;
}

static void sdma_mmu_notifier_free(struct mmu_notifier *mn)
@@ -492,8 +480,6 @@ static void sdma_put_mmu_notifier(struct hisi_sdma_mn *sdma_mn)

	list_del(&sdma_mn->list);
	mmu_notifier_put(&sdma_mn->mn);

	return;
}

static void sdma_put_resume_mmu_notifier(void)
+13 −3
Original line number Diff line number Diff line
@@ -170,7 +170,9 @@ static inline void sdma_channel_set_pause(struct hisi_sdma_channel *pchan)

static inline bool sdma_channel_is_paused(struct hisi_sdma_channel *pchan)
{
	return chn_get_val(pchan, HISI_SDMA_CH_STATUS_REG, HISI_SDMA_CHN_FSM_PAUSE_MSK) == 1;
	u32 reg_val = readl(pchan->io_base + HISI_SDMA_CH_STATUS_REG);

	return FIELD_GET(HISI_SDMA_CHN_FSM_PAUSE_MSK, reg_val) == 1;
}

static inline bool sdma_channel_is_idle(struct hisi_sdma_channel *pchan)
@@ -190,7 +192,9 @@ static inline bool sdma_channel_is_abort(struct hisi_sdma_channel *pchan)

static inline bool sdma_channel_is_quiescent(struct hisi_sdma_channel *pchan)
{
	return chn_get_val(pchan, HISI_SDMA_CH_STATUS_REG, HISI_SDMA_CHN_FSM_QUIESCENT_MSK) == 1;
	u32 reg_val = readl(pchan->io_base + HISI_SDMA_CH_STATUS_REG);

	return FIELD_GET(HISI_SDMA_CHN_FSM_QUIESCENT_MSK, reg_val) == 1;
}

static inline void sdma_channel_write_reset(struct hisi_sdma_channel *pchan)
@@ -200,7 +204,13 @@ static inline void sdma_channel_write_reset(struct hisi_sdma_channel *pchan)

static inline void sdma_channel_write_resume(struct hisi_sdma_channel *pchan)
{
	chn_set_val(pchan, HISI_SDMA_CH_TEST_REG, 1, HISI_SDMA_CH_RESUME_MSK);
	u32 reg_val = readl(pchan->io_base + HISI_SDMA_CH_TEST_REG);

	reg_val &= ~HISI_SDMA_CH_RESUME_MSK;
	reg_val |= FIELD_PREP(HISI_SDMA_CH_RESUME_MSK, 1);
	wmb();

	writel(reg_val, pchan->io_base + HISI_SDMA_CH_TEST_REG);
}

static inline void sdma_channel_enable(struct hisi_sdma_channel *pchan)