mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-09 22:24:04 +08:00
soc: qcom: smd: Use __iowrite32_copy() instead of open-coding it
We already have a function to do this and it silences some sparse warnings along the way. Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Andy Gross <agross@codeaurora.org>
This commit is contained in:
parent
f02dc82523
commit
3b781e55c6
@ -371,20 +371,15 @@ static void qcom_smd_channel_set_state(struct qcom_smd_channel *channel,
|
|||||||
/*
|
/*
|
||||||
* Copy count bytes of data using 32bit accesses, if that's required.
|
* Copy count bytes of data using 32bit accesses, if that's required.
|
||||||
*/
|
*/
|
||||||
static void smd_copy_to_fifo(void __iomem *_dst,
|
static void smd_copy_to_fifo(void __iomem *dst,
|
||||||
const void *_src,
|
const void *src,
|
||||||
size_t count,
|
size_t count,
|
||||||
bool word_aligned)
|
bool word_aligned)
|
||||||
{
|
{
|
||||||
u32 *dst = (u32 *)_dst;
|
|
||||||
u32 *src = (u32 *)_src;
|
|
||||||
|
|
||||||
if (word_aligned) {
|
if (word_aligned) {
|
||||||
count /= sizeof(u32);
|
__iowrite32_copy(dst, src, count / sizeof(u32));
|
||||||
while (count--)
|
|
||||||
writel_relaxed(*src++, dst++);
|
|
||||||
} else {
|
} else {
|
||||||
memcpy_toio(_dst, _src, count);
|
memcpy_toio(dst, src, count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user