media: camss: add missing includes
Subsystems (4)
PATCH v2 1/1 media: camss: add missing includes
Multiple files in this driver fail to build because of missing header inclusions:
drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c: In function 'csiphy_hw_version_read':drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c:31:18: error: implicit declaration of function 'readl_relaxed'; did you mean 'xchg_relaxed'? [-Werror=implicit-function-declaration] drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c: In function 'csiphy_hw_version_read':drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c:52:2: error: implicit declaration of function 'writel' [-Werror=implicit-function-declaration] drivers/media/platform/qcom/camss/camss-ispif.c: In function 'msm_ispif_subdev_init':drivers/media/platform/qcom/camss/camss-ispif.c:1079:16: error: implicit declaration of function 'kcalloc'; did you mean 'kvcalloc'? [-Werror=implicit-function-declaration]
Add the ones that I observed, plus linux/io.h in all other files that call readl/writel and related interfaces.
---
v2: actually add the linux/io.h instances for files that did not show the error but might still be affected because of the readl/writel usage
--- drivers/media/platform/qcom/camss/camss-csid.c | 1 + drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c | 1 + drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c | 1 + drivers/media/platform/qcom/camss/camss-csiphy.c | 1 + drivers/media/platform/qcom/camss/camss-ispif.c | 2 ++ drivers/media/platform/qcom/camss/camss-vfe-4-1.c | 1 + drivers/media/platform/qcom/camss/camss-vfe-4-7.c | 1 + 7 files changed, 8 insertions(+)
drivers/media/platform/qcom/camss/camss-csid.c +1 -0
@@ -10,6 +10,7 @@#include <linux/clk.h> #include <linux/completion.h> #include <linux/interrupt.h> +#include <linux/io.h> #include <linux/kernel.h> #include <linux/of.h> #include <linux/platform_device.h>
drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c +1 -0
@@ -12,6 +12,7 @@#include <linux/delay.h> #include <linux/interrupt.h> +#include <linux/io.h> #define CAMSS_CSI_PHY_LNn_CFG2 (n) (0x004 + 0x40 * (n))#define CAMSS_CSI_PHY_LNn_CFG3 (n) (0x008 + 0x40 * (n))
drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c +1 -0
@@ -12,6 +12,7 @@#include <linux/delay.h> #include <linux/interrupt.h> +#include <linux/io.h> #define CSIPHY_3PH_LNn_CFG1 (n) (0x000 + 0x100 * (n))#define CSIPHY_3PH_LNn_CFG1_SWI_REC_DLY_PRG (BIT(7) | BIT(6))
drivers/media/platform/qcom/camss/camss-csiphy.c +1 -0
@@ -10,6 +10,7 @@#include <linux/clk.h> #include <linux/delay.h> #include <linux/interrupt.h> +#include <linux/io.h> #include <linux/kernel.h> #include <linux/of.h> #include <linux/platform_device.h>
drivers/media/platform/qcom/camss/camss-ispif.c +2 -0
@@ -10,11 +10,13 @@#include <linux/clk.h> #include <linux/completion.h> #include <linux/interrupt.h> +#include <linux/io.h> #include <linux/iopoll.h> #include <linux/kernel.h> #include <linux/mutex.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> +#include <linux/slab.h> #include <media/media-entity.h> #include <media/v4l2-device.h> #include <media/v4l2-subdev.h>
drivers/media/platform/qcom/camss/camss-vfe-4-1.c +1 -0
@@ -9,6 +9,7 @@*/ #include <linux/interrupt.h> +#include <linux/io.h> #include <linux/iopoll.h> #include "camss-vfe.h"
drivers/media/platform/qcom/camss/camss-vfe-4-7.c +1 -0
@@ -9,6 +9,7 @@*/ #include <linux/interrupt.h> +#include <linux/io.h> #include <linux/iopoll.h> #include "camss-vfe.h"
Signature · 1 line
2.18.0
Hi Arnd,
Quoted 7 lines · Arnd Bergmann
Multiple files in this driver fail to build because of missing header inclusions:
drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c: In function 'csiphy_hw_version_read':drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c:31:18: error: implicit declaration of function 'readl_relaxed'; did you mean 'xchg_relaxed'? [-Werror=implicit-function-declaration]drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c: In function 'csiphy_hw_version_read':drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c:52:2: error: implicit declaration of function 'writel' [-Werror=implicit-function-declaration]
Thank you for noticing this and preparing a patch.
I build for arm64 and x86_64 with compile test enabled and I don't see these errors. Do you have a guess what is different that I don't have them?
Quoted 2 lines
drivers/media/platform/qcom/camss/camss-ispif.c: In function 'msm_ispif_subdev_init':drivers/media/platform/qcom/camss/camss-ispif.c:1079:16: error: implicit declaration of function 'kcalloc'; did you mean 'kvcalloc'? [-Werror=implicit-function-declaration]
Maybe we have to use devm_kcalloc instead of kcalloc here, I will check this.
Best regards,
Todor
Quoted 109 lines
Add the ones that I observed, plus
linux/io.hin all other files that call readl/writel and related interfaces.Signed-off-by Arnd Bergmann <[email protected]>---
v2: actually add thelinux/io.hinstances for files that did not show the error but might still be affected because of the readl/writel usage--- drivers/media/platform/qcom/camss/camss-csid.c | 1 + drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c | 1 + drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c | 1 + drivers/media/platform/qcom/camss/camss-csiphy.c | 1 + drivers/media/platform/qcom/camss/camss-ispif.c | 2 ++ drivers/media/platform/qcom/camss/camss-vfe-4-1.c | 1 + drivers/media/platform/qcom/camss/camss-vfe-4-7.c | 1 + 7 files changed, 8 insertions(+)drivers/media/platform/qcom/camss/camss-csid.c +1
-0@@ -10,6 +10,7 @@#include <linux/clk.h> #include <linux/completion.h> #include <linux/interrupt.h> +#include <linux/io.h> #include <linux/kernel.h> #include <linux/of.h> #include <linux/platform_device.h> drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c +1
-0@@ -12,6 +12,7 @@#include <linux/delay.h> #include <linux/interrupt.h> +#include <linux/io.h> #define CAMSS_CSI_PHY_LNn_CFG2 (n) (0x004 + 0x40 * (n))#define CAMSS_CSI_PHY_LNn_CFG3 (n) (0x008 + 0x40 * (n))drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c +1
-0@@ -12,6 +12,7 @@#include <linux/delay.h> #include <linux/interrupt.h> +#include <linux/io.h> #define CSIPHY_3PH_LNn_CFG1 (n) (0x000 + 0x100 * (n))#define CSIPHY_3PH_LNn_CFG1_SWI_REC_DLY_PRG (BIT(7) | BIT(6))drivers/media/platform/qcom/camss/camss-csiphy.c +1
-0@@ -10,6 +10,7 @@#include <linux/clk.h> #include <linux/delay.h> #include <linux/interrupt.h> +#include <linux/io.h> #include <linux/kernel.h> #include <linux/of.h> #include <linux/platform_device.h> drivers/media/platform/qcom/camss/camss-ispif.c +2
-0@@ -10,11 +10,13 @@#include <linux/clk.h> #include <linux/completion.h> #include <linux/interrupt.h> +#include <linux/io.h> #include <linux/iopoll.h> #include <linux/kernel.h> #include <linux/mutex.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> +#include <linux/slab.h> #include <media/media-entity.h> #include <media/v4l2-device.h> #include <media/v4l2-subdev.h> drivers/media/platform/qcom/camss/camss-vfe-4-1.c +1
-0@@ -9,6 +9,7 @@*/ #include <linux/interrupt.h> +#include <linux/io.h> #include <linux/iopoll.h> #include "camss-vfe.h" drivers/media/platform/qcom/camss/camss-vfe-4-7.c +1
-0@@ -9,6 +9,7 @@*/ #include <linux/interrupt.h> +#include <linux/io.h> #include <linux/iopoll.h> #include "camss-vfe.h"
Signature · 2 lines
Best regards, Todor Tomov
Quoted 7 lines · Todor Tomov
Hi Arnd,
Quoted 3 lines · Arnd Bergmann
Multiple files in this driver fail to build because of missing header inclusions:
Quoted 7 lines
Quoted 4 lines
drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c: In function 'csiphy_hw_version_read':drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c:31:18: error: implicit declaration of function 'readl_relaxed'; did you mean 'xchg_relaxed'? [-Werror=implicit-function-declaration]drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c: In function 'csiphy_hw_version_read':drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c:52:2: error: implicit declaration of function 'writel' [-Werror=implicit-function-declaration]Thank you for noticing this and preparing a patch.
I build for arm64 andx86_64with compile test enabled and I don't see these errors. Do you have a guess what is different that I don't have them?
I try lots of randconfig builds, and only one of them hit this, so it's surely some
header that may or may not include io.h and slab.h depending on the configuration,
or based on some other changes in linux-next.
Since the solution seemed obvious, I did not investigate further.
If you want to try reproducing the problem, see the arm64 config file at https://pastebin.com/raw/bNTPvYfZ
Arnd
Todor Tomov
Acked-byHi Arnd,
Quoted 22 lines · Arnd Bergmann
Quoted 7 lines · Todor Tomov
Hi Arnd,
Quoted 3 lines · Arnd Bergmann
Multiple files in this driver fail to build because of missing header inclusions:
Quoted 7 lines
Quoted 4 lines
drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c: In function 'csiphy_hw_version_read':drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c:31:18: error: implicit declaration of function 'readl_relaxed'; did you mean 'xchg_relaxed'? [-Werror=implicit-function-declaration]drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c: In function 'csiphy_hw_version_read':drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c:52:2: error: implicit declaration of function 'writel' [-Werror=implicit-function-declaration]Thank you for noticing this and preparing a patch.
I build for arm64 andx86_64with compile test enabled and I don't see these errors. Do you have a guess what is different that I don't have them?I try lots of randconfig builds, and only one of them hit this, so it's surely some
header that may or may not includeio.handslab.hdepending on the configuration,
or based on some other changes in linux-next.
Quoted 4 lines
Since the solution seemed obvious, I did not investigate further.
If you want to try reproducing the problem, see the arm64 config file at https://pastebin.com/raw/bNTPvYfZ
Thank you, I was able to reproduce it.
I have sent another patch which changes kcalloc to devm_kcalloc so the hunk including slab.h is not needed anymore. For the rest of the patch you can have my:
Signature · 2 lines
Best regards, Todor Tomov