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

Youling Tang posted 1 patch 1 year, 6 months ago
drivers/soc/fsl/dpio/dpio-service.c | 1 +
drivers/soc/fsl/dpio/qbman-portal.c | 1 +
2 files changed, 2 insertions(+)
[PATCH] soc: fsl: dpio: Add prefetch.h includes fixing potential build errors
Posted by Youling Tang 1 year, 6 months ago
From: Youling Tang <tangyouling@kylinos.cn>

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@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202405300328.eZmSYZrP-lkp@intel.com/
Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
---
 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