2017-08-03 11:51:43

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 1/3] drm/msm: remove unused variable

A cleanup left behind an unused variable that we have to remove
in order to avoid this harmless warning:

drivers/gpu/drm/msm/adreno/a5xx_gpu.c: In function 'a5xx_zap_shader_init':
drivers/gpu/drm/msm/adreno/a5xx_gpu.c:493:19: error: unused variable 'a5xx_gpu' [-Werror=unused-variable]

Fixes: 8d6f08272b6f ("drm/msm: Remove uneeded platform dev members")
Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index ea0f6e5b3b1e..a0f69b2e593a 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -490,7 +490,6 @@ static int a5xx_zap_shader_init(struct msm_gpu *gpu)
{
static bool loaded;
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
- struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu);
struct platform_device *pdev = gpu->pdev;
int ret;

--
2.9.0


2017-08-03 11:52:12

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 2/3] drm/msm/mdp5: mark runtime_pm functions as __maybe_unused

When CONFIG_PM is disabled, we get harmless warnings about unused
functions:

drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c:1025:12: error: 'mdp5_runtime_resume' defined but not used [-Werror=unused-function]
static int mdp5_runtime_resume(struct device *dev)
^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c:1015:12: error: 'mdp5_runtime_suspend' defined but not used [-Werror=unused-function]
static int mdp5_runtime_suspend(struct device *dev)
^~~~~~~~~~~~~~~~~~~~

This marks both functions as __maybe_unused so the compiler
can drop them silently.

Fixes: d68fe15b1878 ("drm/msm/mdp5: Use runtime PM get/put API instead of toggling clocks")
Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
index 9f9d95f7c80f..f7c0698fec40 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
@@ -1012,7 +1012,7 @@ static int mdp5_dev_remove(struct platform_device *pdev)
return 0;
}

-static int mdp5_runtime_suspend(struct device *dev)
+static __maybe_unused int mdp5_runtime_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct mdp5_kms *mdp5_kms = platform_get_drvdata(pdev);
@@ -1022,7 +1022,7 @@ static int mdp5_runtime_suspend(struct device *dev)
return mdp5_disable(mdp5_kms);
}

-static int mdp5_runtime_resume(struct device *dev)
+static __maybe_unused int mdp5_runtime_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct mdp5_kms *mdp5_kms = platform_get_drvdata(pdev);
--
2.9.0

2017-08-03 11:52:20

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 3/3] drm/msm: use %z format modifier for printing size_t

The return type of ARRAY_SIZE() is size_t, so we have to use
%zu instead of %lu to avoid this warning:

drivers/gpu/drm/msm/msm_gpu.c: In function 'msm_gpu_init':
drivers/gpu/drm/msm/msm_gpu.c:742:31: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'unsigned int' [-Werror=format=]

The warning it otherwise harmless as size_t is always the
same size as unsigned long in all supported architectures,
but gcc doesn't know that.

Fixes: c2fceabca6d5 ("drm/msm: Support multiple ringbuffers")
Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/gpu/drm/msm/msm_gpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 1e44f8893490..66af5ac334ba 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -739,7 +739,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
}

if (nr_rings > ARRAY_SIZE(gpu->rb)) {
- DRM_DEV_INFO_ONCE(drm->dev, "Only creating %lu ringbuffers\n",
+ DRM_DEV_INFO_ONCE(drm->dev, "Only creating %zu ringbuffers\n",
ARRAY_SIZE(gpu->rb));
nr_rings = ARRAY_SIZE(gpu->rb);
}
--
2.9.0

2017-08-04 10:37:33

by Archit Taneja

[permalink] [raw]
Subject: Re: [PATCH 2/3] drm/msm/mdp5: mark runtime_pm functions as __maybe_unused



On 08/03/2017 05:20 PM, Arnd Bergmann wrote:
> When CONFIG_PM is disabled, we get harmless warnings about unused
> functions:
>
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c:1025:12: error: 'mdp5_runtime_resume' defined but not used [-Werror=unused-function]
> static int mdp5_runtime_resume(struct device *dev)
> ^~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c:1015:12: error: 'mdp5_runtime_suspend' defined but not used [-Werror=unused-function]
> static int mdp5_runtime_suspend(struct device *dev)
> ^~~~~~~~~~~~~~~~~~~~
>
> This marks both functions as __maybe_unused so the compiler
> can drop them silently.

Thanks for the fix. Since the commit is still in Rob's -next branch,
I'll post a new version which fixes this.

Archit

>
> Fixes: d68fe15b1878 ("drm/msm/mdp5: Use runtime PM get/put API instead of toggling clocks")
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
> index 9f9d95f7c80f..f7c0698fec40 100644
> --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
> +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
> @@ -1012,7 +1012,7 @@ static int mdp5_dev_remove(struct platform_device *pdev)
> return 0;
> }
>
> -static int mdp5_runtime_suspend(struct device *dev)
> +static __maybe_unused int mdp5_runtime_suspend(struct device *dev)
> {
> struct platform_device *pdev = to_platform_device(dev);
> struct mdp5_kms *mdp5_kms = platform_get_drvdata(pdev);
> @@ -1022,7 +1022,7 @@ static int mdp5_runtime_suspend(struct device *dev)
> return mdp5_disable(mdp5_kms);
> }
>
> -static int mdp5_runtime_resume(struct device *dev)
> +static __maybe_unused int mdp5_runtime_resume(struct device *dev)
> {
> struct platform_device *pdev = to_platform_device(dev);
> struct mdp5_kms *mdp5_kms = platform_get_drvdata(pdev);
>

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project