[PATCH] soc: fsl: dpio: Add prefetch.h includes fixing potential build errors

From: Youling Tang
Date: Thu May 30 2024 - 02:02:57 EST


From: Youling Tang <tangyouling@xxxxxxxxxx>

If the architecture does not implement prefetch() specifically, the
following build error occurs:
drivers/soc/fsl/dpio/dpio-service.c: In function 'dpaa2_io_store_next':
>> drivers/soc/fsl/dpio/dpio-service.c:745:17: error: implicit declaration of function 'prefetch'; did you mean 'prefetchw'? [-Werror=implicit-function-declaration]
745 | prefetch(&s->vaddr[s->idx]);
| ^~~~~~~~
| prefetchw
cc1: some warnings being treated as errors
--
drivers/soc/fsl/dpio/qbman-portal.c: In function 'qbman_swp_dqrr_next_direct':
>> drivers/soc/fsl/dpio/qbman-portal.c:1213:17: error: implicit declaration of function 'prefetch'; did you mean 'prefetchw'? [-Werror=implicit-function-declaration]
1213 | prefetch(qbman_get_cmd(s,
| ^~~~~~~~
| prefetchw
cc1: some warnings being treated as errors

Include the correct header file to fix the problem.

Fixes: f1e250bf3659 ("soc: fsl: dpio: Add prefetch instruction")
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202405300328.eZmSYZrP-lkp@xxxxxxxxx/
Signed-off-by: Youling Tang <tangyouling@xxxxxxxxxx>
---
drivers/soc/fsl/dpio/dpio-service.c | 1 +
drivers/soc/fsl/dpio/qbman-portal.c | 1 +
2 files changed, 2 insertions(+)

diff --git a/drivers/soc/fsl/dpio/dpio-service.c b/drivers/soc/fsl/dpio/dpio-service.c
index b811446e0fa5..a4692b9ad8d7 100644
--- a/drivers/soc/fsl/dpio/dpio-service.c
+++ b/drivers/soc/fsl/dpio/dpio-service.c
@@ -9,6 +9,7 @@
#include <soc/fsl/dpaa2-io.h>
#include <linux/init.h>
#include <linux/module.h>
+#include <linux/prefetch.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/dma-mapping.h>
diff --git a/drivers/soc/fsl/dpio/qbman-portal.c b/drivers/soc/fsl/dpio/qbman-portal.c
index 0a3fb6c115f4..1c0bf04b101c 100644
--- a/drivers/soc/fsl/dpio/qbman-portal.c
+++ b/drivers/soc/fsl/dpio/qbman-portal.c
@@ -7,6 +7,7 @@

#include <asm/cacheflush.h>
#include <linux/io.h>
+#include <linux/prefetch.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <soc/fsl/dpaa2-global.h>
--
2.34.1