* [PATCH 1/3] drm/exynos/dsi: Use common error handling code in exynos_dsi_enable()
2017-10-24 8:48 [PATCH 0/3] GPU-DRM-Exynos: Fine-tuning for six function implementations SF Markus Elfring
@ 2017-10-24 8:49 ` SF Markus Elfring
2017-10-24 8:51 ` Krzysztof Kozlowski
2017-10-24 8:50 ` [PATCH 2/3] drm/exynos/gem: Use common error handling code in exynos_drm_gem_init() SF Markus Elfring
2017-10-24 8:52 ` [PATCH 3/3] drm/exynos: Fix typos in five comment lines SF Markus Elfring
2 siblings, 1 reply; 6+ messages in thread
From: SF Markus Elfring @ 2017-10-24 8:49 UTC (permalink / raw)
To: dri-devel, linux-arm-kernel, linux-samsung-soc, David Airlie,
Inki Dae, Joonyoung Shim, Krzysztof Kozlowski, Kukjin Kim,
Kyungmin Park, Seung-Woo Kim
Cc: kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 24 Oct 2017 09:32:18 +0200
Add a jump target so that a bit of exception handling can be better reused
at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/exynos/exynos_drm_dsi.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 7904ffa9abfb..ba5fb49c5491 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -1389,8 +1389,7 @@ static void exynos_dsi_enable(struct drm_encoder *encoder)
ret = drm_panel_prepare(dsi->panel);
if (ret < 0) {
dsi->state &= ~DSIM_STATE_ENABLED;
- pm_runtime_put_sync(dsi->dev);
- return;
+ goto put_sync;
}
exynos_dsi_set_display_mode(dsi);
@@ -1401,11 +1400,14 @@ static void exynos_dsi_enable(struct drm_encoder *encoder)
dsi->state &= ~DSIM_STATE_ENABLED;
exynos_dsi_set_display_enable(dsi, false);
drm_panel_unprepare(dsi->panel);
- pm_runtime_put_sync(dsi->dev);
- return;
+ goto put_sync;
}
dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE;
+ return;
+
+put_sync:
+ pm_runtime_put_sync(dsi->dev);
}
static void exynos_dsi_disable(struct drm_encoder *encoder)
--
2.14.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 1/3] drm/exynos/dsi: Use common error handling code in exynos_dsi_enable()
2017-10-24 8:49 ` [PATCH 1/3] drm/exynos/dsi: Use common error handling code in exynos_dsi_enable() SF Markus Elfring
@ 2017-10-24 8:51 ` Krzysztof Kozlowski
2017-10-24 9:08 ` SF Markus Elfring
0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2017-10-24 8:51 UTC (permalink / raw)
To: SF Markus Elfring
Cc: linux-samsung-soc, kernel-janitors, Seung-Woo Kim, LKML,
dri-devel, Kyungmin Park, Kukjin Kim, linux-arm-kernel
On Tue, Oct 24, 2017 at 10:49 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 24 Oct 2017 09:32:18 +0200
>
> Add a jump target so that a bit of exception handling can be better reused
> at the end of this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/gpu/drm/exynos/exynos_drm_dsi.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> index 7904ffa9abfb..ba5fb49c5491 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> @@ -1389,8 +1389,7 @@ static void exynos_dsi_enable(struct drm_encoder *encoder)
> ret = drm_panel_prepare(dsi->panel);
> if (ret < 0) {
> dsi->state &= ~DSIM_STATE_ENABLED;
> - pm_runtime_put_sync(dsi->dev);
> - return;
> + goto put_sync;
> }
>
> exynos_dsi_set_display_mode(dsi);
> @@ -1401,11 +1400,14 @@ static void exynos_dsi_enable(struct drm_encoder *encoder)
> dsi->state &= ~DSIM_STATE_ENABLED;
> exynos_dsi_set_display_enable(dsi, false);
> drm_panel_unprepare(dsi->panel);
> - pm_runtime_put_sync(dsi->dev);
> - return;
> + goto put_sync;
> }
>
> dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE;
> + return;
> +
> +put_sync:
> + pm_runtime_put_sync(dsi->dev);
> }
No, this does not simplify the code. Stop using coccinelle.
BR,
Krzysztof
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/3] drm/exynos/dsi: Use common error handling code in exynos_dsi_enable()
2017-10-24 8:51 ` Krzysztof Kozlowski
@ 2017-10-24 9:08 ` SF Markus Elfring
0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-10-24 9:08 UTC (permalink / raw)
To: Krzysztof Kozlowski, dri-devel, linux-arm-kernel,
linux-samsung-soc
Cc: kernel-janitors, Seung-Woo Kim, LKML, Kyungmin Park, Kukjin Kim
>> @@ -1401,11 +1400,14 @@ static void exynos_dsi_enable(struct drm_encoder *encoder)
>> dsi->state &= ~DSIM_STATE_ENABLED;
>> exynos_dsi_set_display_enable(dsi, false);
>> drm_panel_unprepare(dsi->panel);
>> - pm_runtime_put_sync(dsi->dev);
>> - return;
>> + goto put_sync;
>> }
>>
>> dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE;
>> + return;
>> +
>> +put_sync:
>> + pm_runtime_put_sync(dsi->dev);
>> }
>
> No, this does not simplify the code.
How do you think about to check a bit more if there are desired effects to consider
when the shown function call is stored only once at the end of this function implementation?
> Stop using coccinelle.
This will not happen for a while. - There are so many source code places left over
where you might care more for similar software improvements.
Regards,
Markus
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/3] drm/exynos/gem: Use common error handling code in exynos_drm_gem_init()
2017-10-24 8:48 [PATCH 0/3] GPU-DRM-Exynos: Fine-tuning for six function implementations SF Markus Elfring
2017-10-24 8:49 ` [PATCH 1/3] drm/exynos/dsi: Use common error handling code in exynos_dsi_enable() SF Markus Elfring
@ 2017-10-24 8:50 ` SF Markus Elfring
2017-10-24 8:52 ` [PATCH 3/3] drm/exynos: Fix typos in five comment lines SF Markus Elfring
2 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-10-24 8:50 UTC (permalink / raw)
To: dri-devel, linux-arm-kernel, linux-samsung-soc, David Airlie,
Inki Dae, Joonyoung Shim, Krzysztof Kozlowski, Kukjin Kim,
Kyungmin Park, Seung-Woo Kim
Cc: kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 24 Oct 2017 09:50:54 +0200
Adjust jump targets so that a bit of exception handling can be better
reused at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/exynos/exynos_drm_gem.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index 077de014d610..1b3c9324cdd5 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -208,20 +208,22 @@ static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev,
ret = drm_gem_object_init(dev, obj, size);
if (ret < 0) {
DRM_ERROR("failed to initialize gem object\n");
- kfree(exynos_gem);
- return ERR_PTR(ret);
+ goto free_gem;
}
ret = drm_gem_create_mmap_offset(obj);
- if (ret < 0) {
- drm_gem_object_release(obj);
- kfree(exynos_gem);
- return ERR_PTR(ret);
- }
+ if (ret < 0)
+ goto release_object;
DRM_DEBUG_KMS("created file object = %pK\n", obj->filp);
return exynos_gem;
+
+release_object:
+ drm_gem_object_release(obj);
+free_gem:
+ kfree(exynos_gem);
+ return ERR_PTR(ret);
}
struct exynos_drm_gem *exynos_drm_gem_create(struct drm_device *dev,
--
2.14.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/3] drm/exynos: Fix typos in five comment lines
2017-10-24 8:48 [PATCH 0/3] GPU-DRM-Exynos: Fine-tuning for six function implementations SF Markus Elfring
2017-10-24 8:49 ` [PATCH 1/3] drm/exynos/dsi: Use common error handling code in exynos_dsi_enable() SF Markus Elfring
2017-10-24 8:50 ` [PATCH 2/3] drm/exynos/gem: Use common error handling code in exynos_drm_gem_init() SF Markus Elfring
@ 2017-10-24 8:52 ` SF Markus Elfring
2 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-10-24 8:52 UTC (permalink / raw)
To: dri-devel, linux-arm-kernel, linux-samsung-soc, David Airlie,
Inki Dae, Joonyoung Shim, Krzysztof Kozlowski, Kukjin Kim,
Kyungmin Park, Seung-Woo Kim
Cc: trivial, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 24 Oct 2017 10:20:20 +0200
The script "checkpatch.pl" pointed misspelled words out.
Thus fix the affected places.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +-
drivers/gpu/drm/exynos/exynos_drm_fimc.c | 2 +-
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +-
drivers/gpu/drm/exynos/exynos_drm_g2d.c | 2 +-
drivers/gpu/drm/exynos/exynos_drm_ipp.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index ba5fb49c5491..08cdfe7e82a0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -841,7 +841,7 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi)
* Use non-continuous clock mode if the periparal wants and
* host controller supports
*
- * In non-continous clock mode, host controller will turn off
+ * In non-continuous clock mode, host controller will turn off
* the HS clock between high-speed transmissions to reduce
* power consumption.
*/
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
index 5b18b5c5fdf2..a14738e81a5a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
@@ -1437,7 +1437,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
return ret;
}
- /* If set ture, we can save jpeg about screen */
+ /* If set true, we can save jpeg about screen */
fimc_handle_jpeg(ctx, false);
fimc_set_scaler(ctx, &ctx->sc);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index d42ae2bc3e56..50a4c3435cd0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -594,7 +594,7 @@ static void fimd_win_set_pixfmt(struct fimd_context *ctx, unsigned int win,
/*
* Setting dma-burst to 16Word causes permanent tearing for very small
* buffers, e.g. cursor buffer. Burst Mode switching which based on
- * plane size is not recommended as plane size varies alot towards the
+ * plane size is not recommended as plane size varies a lot towards the
* end of the screen and rapid movement causes unstable DMA, but it is
* still better to change dma-burst than displaying garbage.
*/
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index 2b8bf2dd6387..f4de1f3d37a3 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -29,7 +29,7 @@
#define G2D_HW_MAJOR_VER 4
#define G2D_HW_MINOR_VER 1
-/* vaild register range set from user: 0x0104 ~ 0x0880 */
+/* valid register range set from user: 0x0104 ~ 0x0880 */
#define G2D_VALID_START 0x0104
#define G2D_VALID_END 0x0880
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 3edda18cc2d2..2feeba705c1f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -1747,7 +1747,7 @@ static int ipp_probe(struct platform_device *pdev)
goto err_event_workq;
}
- /* set sub driver informations */
+ /* set sub driver information */
subdrv = &ctx->subdrv;
subdrv->dev = dev;
subdrv->probe = ipp_subdrv_probe;
--
2.14.2
^ permalink raw reply related [flat|nested] 6+ messages in thread