Linux Samsung SOC development
 help / color / mirror / Atom feed
* [PATCH 1/1] [media] platform: Deletion of unnecessary checks before two function calls
       [not found]                                 ` <5317A59D.4@users.sourceforge.net>
@ 2014-11-20 10:50                                   ` SF Markus Elfring
  2014-11-21 10:12                                   ` [PATCH 1/1] thermal: Exynos: " SF Markus Elfring
  2015-02-04 21:00                                   ` [PATCH] GPU-DRM-Exynos: Delete " SF Markus Elfring
  2 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2014-11-20 10:50 UTC (permalink / raw)
  To: Kukjin Kim, Kyungmin Park, Mauro Carvalho Chehab,
	Sylwester Nawrocki, linux-media, linux-arm-kernel
  Cc: linux-samsung-soc, LKML, kernel-janitors, Julia Lawall

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 20 Nov 2014 11:44:20 +0100

The functions i2c_put_adapter() and release_firmware() test whether their
argument is NULL and then return immediately. Thus the test around the call
is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/media/platform/exynos4-is/fimc-is.c   | 6 ++----
 drivers/media/platform/s3c-camif/camif-core.c | 3 +--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/exynos4-is/fimc-is.c b/drivers/media/platform/exynos4-is/fimc-is.c
index 5476dce..a1db27b 100644
--- a/drivers/media/platform/exynos4-is/fimc-is.c
+++ b/drivers/media/platform/exynos4-is/fimc-is.c
@@ -428,8 +428,7 @@ static void fimc_is_load_firmware(const struct firmware *fw, void *context)
 	 * needed around for copying to the IS working memory every
 	 * time before the Cortex-A5 is restarted.
 	 */
-	if (is->fw.f_w)
-		release_firmware(is->fw.f_w);
+	release_firmware(is->fw.f_w);
 	is->fw.f_w = fw;
 done:
 	mutex_unlock(&is->lock);
@@ -937,8 +936,7 @@ static int fimc_is_remove(struct platform_device *pdev)
 	vb2_dma_contig_cleanup_ctx(is->alloc_ctx);
 	fimc_is_put_clocks(is);
 	fimc_is_debugfs_remove(is);
-	if (is->fw.f_w)
-		release_firmware(is->fw.f_w);
+	release_firmware(is->fw.f_w);
 	fimc_is_free_cpu_memory(is);
 
 	return 0;
diff --git a/drivers/media/platform/s3c-camif/camif-core.c b/drivers/media/platform/s3c-camif/camif-core.c
index b385747..3b09b5b 100644
--- a/drivers/media/platform/s3c-camif/camif-core.c
+++ b/drivers/media/platform/s3c-camif/camif-core.c
@@ -256,8 +256,7 @@ static void camif_unregister_sensor(struct camif_dev *camif)
 	v4l2_device_unregister_subdev(sd);
 	camif->sensor.sd = NULL;
 	i2c_unregister_device(client);
-	if (adapter)
-		i2c_put_adapter(adapter);
+	i2c_put_adapter(adapter);
 }
 
 static int camif_create_media_links(struct camif_dev *camif)
-- 
2.1.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 1/1] thermal: Exynos: Deletion of unnecessary checks before two function calls
       [not found]                                 ` <5317A59D.4@users.sourceforge.net>
  2014-11-20 10:50                                   ` [PATCH 1/1] [media] platform: Deletion of unnecessary checks before two function calls SF Markus Elfring
@ 2014-11-21 10:12                                   ` SF Markus Elfring
  2014-11-21 10:17                                     ` Julia Lawall
  2015-02-04 21:00                                   ` [PATCH] GPU-DRM-Exynos: Delete " SF Markus Elfring
  2 siblings, 1 reply; 10+ messages in thread
From: SF Markus Elfring @ 2014-11-21 10:12 UTC (permalink / raw)
  To: Eduardo Valentin, Kukjin Kim, Zhang Rui, linux-pm,
	linux-arm-kernel, linux-samsung-soc
  Cc: LKML, kernel-janitors, Julia Lawall

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 21 Nov 2014 11:06:33 +0100

The functions cpufreq_cooling_unregister() and thermal_zone_device_unregister()
test whether their argument is NULL and then return immediately.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/thermal/samsung/exynos_thermal_common.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c
index 3f5ad25..1cbb9d0 100644
--- a/drivers/thermal/samsung/exynos_thermal_common.c
+++ b/drivers/thermal/samsung/exynos_thermal_common.c
@@ -417,12 +417,10 @@ void exynos_unregister_thermal(struct thermal_sensor_conf *sensor_conf)
 
 	th_zone = sensor_conf->pzone_data;
 
-	if (th_zone->therm_dev)
-		thermal_zone_device_unregister(th_zone->therm_dev);
+	thermal_zone_device_unregister(th_zone->therm_dev);
 
 	for (i = 0; i < th_zone->cool_dev_size; i++) {
-		if (th_zone->cool_dev[i])
-			cpufreq_cooling_unregister(th_zone->cool_dev[i]);
+		cpufreq_cooling_unregister(th_zone->cool_dev[i]);
 	}
 
 	dev_info(sensor_conf->dev,
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/1] thermal: Exynos: Deletion of unnecessary checks before two function calls
  2014-11-21 10:12                                   ` [PATCH 1/1] thermal: Exynos: " SF Markus Elfring
@ 2014-11-21 10:17                                     ` Julia Lawall
  2014-11-21 13:25                                       ` SF Markus Elfring
  2014-11-21 16:17                                       ` [PATCH v2] " SF Markus Elfring
  0 siblings, 2 replies; 10+ messages in thread
From: Julia Lawall @ 2014-11-21 10:17 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: Eduardo Valentin, Kukjin Kim, Zhang Rui, linux-pm,
	linux-arm-kernel, linux-samsung-soc, LKML, kernel-janitors

On Fri, 21 Nov 2014, SF Markus Elfring wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 21 Nov 2014 11:06:33 +0100
>
> The functions cpufreq_cooling_unregister() and thermal_zone_device_unregister()
> test whether their argument is NULL and then return immediately.
> Thus the test around the call is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/thermal/samsung/exynos_thermal_common.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c
> index 3f5ad25..1cbb9d0 100644
> --- a/drivers/thermal/samsung/exynos_thermal_common.c
> +++ b/drivers/thermal/samsung/exynos_thermal_common.c
> @@ -417,12 +417,10 @@ void exynos_unregister_thermal(struct thermal_sensor_conf *sensor_conf)
>
>  	th_zone = sensor_conf->pzone_data;
>
> -	if (th_zone->therm_dev)
> -		thermal_zone_device_unregister(th_zone->therm_dev);
> +	thermal_zone_device_unregister(th_zone->therm_dev);
>
>  	for (i = 0; i < th_zone->cool_dev_size; i++) {
> -		if (th_zone->cool_dev[i])
> -			cpufreq_cooling_unregister(th_zone->cool_dev[i]);
> +		cpufreq_cooling_unregister(th_zone->cool_dev[i]);
>  	}

Now you have unnecessary {}

julia

>
>  	dev_info(sensor_conf->dev,
> --
> 2.1.3
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: thermal: Exynos: Deletion of unnecessary checks before two function calls
  2014-11-21 10:17                                     ` Julia Lawall
@ 2014-11-21 13:25                                       ` SF Markus Elfring
  2014-11-21 16:17                                       ` [PATCH v2] " SF Markus Elfring
  1 sibling, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2014-11-21 13:25 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Eduardo Valentin, Kukjin Kim, Zhang Rui, linux-pm,
	linux-arm-kernel, linux-samsung-soc, LKML, kernel-janitors

>>  	for (i = 0; i < th_zone->cool_dev_size; i++) {
>> -		if (th_zone->cool_dev[i])
>> -			cpufreq_cooling_unregister(th_zone->cool_dev[i]);
>> +		cpufreq_cooling_unregister(th_zone->cool_dev[i]);
>>  	}
> 
> Now you have unnecessary {}

How are the chances that your source code transformation tool
can also consider the deletion of curly brackets in such an use case?

Can any more pretty-printing rules be integrated from a specific
coding style configuration?

Regards,
Markus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2] thermal: Exynos: Deletion of unnecessary checks before two function calls
  2014-11-21 10:17                                     ` Julia Lawall
  2014-11-21 13:25                                       ` SF Markus Elfring
@ 2014-11-21 16:17                                       ` SF Markus Elfring
  1 sibling, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2014-11-21 16:17 UTC (permalink / raw)
  To: Eduardo Valentin, Kukjin Kim, Zhang Rui, linux-pm,
	linux-arm-kernel, linux-samsung-soc
  Cc: LKML, kernel-janitors, Julia Lawall

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 21 Nov 2014 17:11:49 +0100

The functions cpufreq_cooling_unregister() and thermal_zone_device_unregister()
test whether their argument is NULL and then return immediately.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/thermal/samsung/exynos_thermal_common.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c
index 3f5ad25..b6be572 100644
--- a/drivers/thermal/samsung/exynos_thermal_common.c
+++ b/drivers/thermal/samsung/exynos_thermal_common.c
@@ -417,13 +417,10 @@ void exynos_unregister_thermal(struct thermal_sensor_conf *sensor_conf)
 
 	th_zone = sensor_conf->pzone_data;
 
-	if (th_zone->therm_dev)
-		thermal_zone_device_unregister(th_zone->therm_dev);
+	thermal_zone_device_unregister(th_zone->therm_dev);
 
-	for (i = 0; i < th_zone->cool_dev_size; i++) {
-		if (th_zone->cool_dev[i])
-			cpufreq_cooling_unregister(th_zone->cool_dev[i]);
-	}
+	for (i = 0; i < th_zone->cool_dev_size; ++i)
+		cpufreq_cooling_unregister(th_zone->cool_dev[i]);
 
 	dev_info(sensor_conf->dev,
 		"Exynos: Kernel Thermal management unregistered\n");
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] GPU-DRM-Exynos: Delete unnecessary checks before two function calls
       [not found]                                 ` <5317A59D.4@users.sourceforge.net>
  2014-11-20 10:50                                   ` [PATCH 1/1] [media] platform: Deletion of unnecessary checks before two function calls SF Markus Elfring
  2014-11-21 10:12                                   ` [PATCH 1/1] thermal: Exynos: " SF Markus Elfring
@ 2015-02-04 21:00                                   ` SF Markus Elfring
  2015-02-05  8:29                                     ` Joonyoung Shim
  2 siblings, 1 reply; 10+ messages in thread
From: SF Markus Elfring @ 2015-02-04 21:00 UTC (permalink / raw)
  To: David Airlie, Inki Dae, Jingoo Han, Joonyoung Shim, Kukjin Kim,
	Kyungmin Park, Seung-Woo Kim, dri-devel, linux-arm-kernel,
	linux-samsung-soc
  Cc: LKML, kernel-janitors, Julia Lawall

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 4 Feb 2015 21:54:45 +0100

The functions phy_power_on() and vunmap() perform also input
parameter validation. Thus the test around their calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/gpu/drm/exynos/exynos_dp_core.c   | 6 ++----
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c
index 34d46aa..306cf1d 100644
--- a/drivers/gpu/drm/exynos/exynos_dp_core.c
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
@@ -1057,14 +1057,12 @@ static int exynos_dp_create_connector(struct exynos_drm_display *display,
 
 static void exynos_dp_phy_init(struct exynos_dp_device *dp)
 {
-	if (dp->phy)
-		phy_power_on(dp->phy);
+	phy_power_on(dp->phy);
 }
 
 static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
 {
-	if (dp->phy)
-		phy_power_off(dp->phy);
+	phy_power_off(dp->phy);
 }
 
 static void exynos_dp_poweron(struct exynos_drm_display *display)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index e12ea90..0dd448a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -313,7 +313,7 @@ static void exynos_drm_fbdev_destroy(struct drm_device *dev,
 	struct exynos_drm_gem_obj *exynos_gem_obj = exynos_fbd->exynos_gem_obj;
 	struct drm_framebuffer *fb;
 
-	if (is_drm_iommu_supported(dev) && exynos_gem_obj->buffer->kvaddr)
+	if (is_drm_iommu_supported(dev))
 		vunmap(exynos_gem_obj->buffer->kvaddr);
 
 	/* release drm framebuffer and real buffer */
-- 
2.2.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] GPU-DRM-Exynos: Delete unnecessary checks before two function calls
  2015-02-04 21:00                                   ` [PATCH] GPU-DRM-Exynos: Delete " SF Markus Elfring
@ 2015-02-05  8:29                                     ` Joonyoung Shim
  2015-06-27 17:17                                       ` SF Markus Elfring
  2016-07-21 17:42                                       ` [PATCH] GPU-DRM-Exynos: Delete an unnecessary check before the function call "vunmap" SF Markus Elfring
  0 siblings, 2 replies; 10+ messages in thread
From: Joonyoung Shim @ 2015-02-05  8:29 UTC (permalink / raw)
  To: SF Markus Elfring, David Airlie, Inki Dae, Jingoo Han, Kukjin Kim,
	Kyungmin Park, Seung-Woo Kim, dri-devel, linux-arm-kernel,
	linux-samsung-soc
  Cc: Julia Lawall, kernel-janitors, LKML

Hi,

On 02/05/2015 06:00 AM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 4 Feb 2015 21:54:45 +0100
> 
> The functions phy_power_on() and vunmap() perform also input
> parameter validation. Thus the test around their calls is not needed.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/gpu/drm/exynos/exynos_dp_core.c   | 6 ++----
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +-
>  2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c
> index 34d46aa..306cf1d 100644
> --- a/drivers/gpu/drm/exynos/exynos_dp_core.c
> +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
> @@ -1057,14 +1057,12 @@ static int exynos_dp_create_connector(struct exynos_drm_display *display,
>  
>  static void exynos_dp_phy_init(struct exynos_dp_device *dp)
>  {
> -	if (dp->phy)
> -		phy_power_on(dp->phy);
> +	phy_power_on(dp->phy);
>  }
>  
>  static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
>  {
> -	if (dp->phy)
> -		phy_power_off(dp->phy);
> +	phy_power_off(dp->phy);
>  }
>  
>  static void exynos_dp_poweron(struct exynos_drm_display *display)
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> index e12ea90..0dd448a 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> @@ -313,7 +313,7 @@ static void exynos_drm_fbdev_destroy(struct drm_device *dev,
>  	struct exynos_drm_gem_obj *exynos_gem_obj = exynos_fbd->exynos_gem_obj;
>  	struct drm_framebuffer *fb;
>  
> -	if (is_drm_iommu_supported(dev) && exynos_gem_obj->buffer->kvaddr)
> +	if (is_drm_iommu_supported(dev))
>  		vunmap(exynos_gem_obj->buffer->kvaddr);
>  
>  	/* release drm framebuffer and real buffer */
> 

Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>

Thanks.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] GPU-DRM-Exynos: Delete unnecessary checks before two function calls
  2015-02-05  8:29                                     ` Joonyoung Shim
@ 2015-06-27 17:17                                       ` SF Markus Elfring
  2016-07-21 17:42                                       ` [PATCH] GPU-DRM-Exynos: Delete an unnecessary check before the function call "vunmap" SF Markus Elfring
  1 sibling, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2015-06-27 17:17 UTC (permalink / raw)
  To: David Airlie, Inki Dae, Jingoo Han, Kukjin Kim, Kyungmin Park,
	Seung-Woo Kim, dri-devel, linux-arm-kernel, linux-samsung-soc
  Cc: Joonyoung Shim, Julia Lawall, kernel-janitors, LKML

>> From: Markus Elfring <elfring@users.sourceforge.net>
>> Date: Wed, 4 Feb 2015 21:54:45 +0100
>>
>> The functions phy_power_on() and vunmap() perform also input
>> parameter validation. Thus the test around their calls is not needed.
>>
>> This issue was detected by using the Coccinelle software.
>>
>> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
>> ---
>>  drivers/gpu/drm/exynos/exynos_dp_core.c   | 6 ++----
>>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +-
>>  2 files changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c
>> index 34d46aa..306cf1d 100644
>> --- a/drivers/gpu/drm/exynos/exynos_dp_core.c
>> +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
>> @@ -1057,14 +1057,12 @@ static int exynos_dp_create_connector(struct exynos_drm_display *display,
>>  
>>  static void exynos_dp_phy_init(struct exynos_dp_device *dp)
>>  {
>> -	if (dp->phy)
>> -		phy_power_on(dp->phy);
>> +	phy_power_on(dp->phy);
>>  }
>>  
>>  static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
>>  {
>> -	if (dp->phy)
>> -		phy_power_off(dp->phy);
>> +	phy_power_off(dp->phy);
>>  }
>>  
>>  static void exynos_dp_poweron(struct exynos_drm_display *display)
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
>> index e12ea90..0dd448a 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
>> @@ -313,7 +313,7 @@ static void exynos_drm_fbdev_destroy(struct drm_device *dev,
>>  	struct exynos_drm_gem_obj *exynos_gem_obj = exynos_fbd->exynos_gem_obj;
>>  	struct drm_framebuffer *fb;
>>  
>> -	if (is_drm_iommu_supported(dev) && exynos_gem_obj->buffer->kvaddr)
>> +	if (is_drm_iommu_supported(dev))
>>  		vunmap(exynos_gem_obj->buffer->kvaddr);
>>  
>>  	/* release drm framebuffer and real buffer */
>>
> 
> Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>

Do the chances increase to integrate this update suggestion
into another source code repository?

Regards,
Markus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] GPU-DRM-Exynos: Delete an unnecessary check before the function call "vunmap"
  2015-02-05  8:29                                     ` Joonyoung Shim
  2015-06-27 17:17                                       ` SF Markus Elfring
@ 2016-07-21 17:42                                       ` SF Markus Elfring
  2016-07-21 18:07                                         ` Sean Paul
  1 sibling, 1 reply; 10+ messages in thread
From: SF Markus Elfring @ 2016-07-21 17:42 UTC (permalink / raw)
  To: dri-devel, linux-arm-kernel, linux-samsung-soc, Daniel Vetter,
	David Airlie, Inki Dae, Joonyoung Shim, Krzysztof Kozlowski,
	Kukjin Kim, Kyungmin Park, Seung-Woo Kim
  Cc: Julia Lawall, kernel-janitors, LKML

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 21 Jul 2016 19:23:25 +0200

The vunmap() function performs also input parameter validation.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index dd09117..4cfb39d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -269,8 +269,7 @@ static void exynos_drm_fbdev_destroy(struct drm_device *dev,
 	struct exynos_drm_gem *exynos_gem = exynos_fbd->exynos_gem;
 	struct drm_framebuffer *fb;
 
-	if (exynos_gem->kvaddr)
-		vunmap(exynos_gem->kvaddr);
+	vunmap(exynos_gem->kvaddr);
 
 	/* release drm framebuffer and real buffer */
 	if (fb_helper->fb && fb_helper->fb->funcs) {
-- 
2.9.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] GPU-DRM-Exynos: Delete an unnecessary check before the function call "vunmap"
  2016-07-21 17:42                                       ` [PATCH] GPU-DRM-Exynos: Delete an unnecessary check before the function call "vunmap" SF Markus Elfring
@ 2016-07-21 18:07                                         ` Sean Paul
  0 siblings, 0 replies; 10+ messages in thread
From: Sean Paul @ 2016-07-21 18:07 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: dri-devel, Linux ARM Kernel, linux-samsung-soc, Daniel Vetter,
	David Airlie, Inki Dae, Joonyoung Shim, Krzysztof Kozlowski,
	Kukjin Kim, Kyungmin Park, Seung-Woo Kim, Julia Lawall,
	kernel-janitors, LKML

On Thu, Jul 21, 2016 at 1:42 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 21 Jul 2016 19:23:25 +0200
>
> The vunmap() function performs also input parameter validation.
> Thus the test around the call is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Applied to drm-misc

> ---
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> index dd09117..4cfb39d 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> @@ -269,8 +269,7 @@ static void exynos_drm_fbdev_destroy(struct drm_device *dev,
>         struct exynos_drm_gem *exynos_gem = exynos_fbd->exynos_gem;
>         struct drm_framebuffer *fb;
>
> -       if (exynos_gem->kvaddr)
> -               vunmap(exynos_gem->kvaddr);
> +       vunmap(exynos_gem->kvaddr);
>
>         /* release drm framebuffer and real buffer */
>         if (fb_helper->fb && fb_helper->fb->funcs) {
> --
> 2.9.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-07-21 18:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <5307CAA2.8060406@users.sourceforge.net>
     [not found] ` <alpine.DEB.2.02.1402212321410.2043@localhost6.localdomain6>
     [not found]   ` <530A086E.8010901@users.sourceforge.net>
     [not found]     ` <alpine.DEB.2.02.1402231635510.1985@localhost6.localdomain6>
     [not found]       ` <530A72AA.3000601@users.sourceforge.net>
     [not found]         ` <alpine.DEB.2.02.1402240658210.2090@localhost6.localdomain6>
     [not found]           ` <530B5FB6.6010207@users.sourceforge.net>
     [not found]             ` <alpine.DEB.2.10.1402241710370.2074@hadrien>
     [not found]               ` <530C5E18.1020800@users.sourceforge.net>
     [not found]                 ` <alpine.DEB.2.10.1402251014170.2080@hadrien>
     [not found]                   ` <530CD2C4.4050903@users.sourceforge.net>
     [not found]                     ` <alpine.DEB.2.10.1402251840450.7035@hadrien>
     [not found]                       ` <530CF8FF.8080600@users.sourceforge.net>
     [not found]                         ` <alpine.DEB.2.02.1402252117150.2047@localhost6.localdomain6>
     [not found]                           ` <530DD06F.4090703@users.sourceforge.net>
     [not found]                             ` <alpine.DEB.2.02.1402262129250.2221@localhost6.localdomain6>
     [not found]                               ` <5317A59D.4@users.so urceforge.net>
     [not found]                                 ` <5317A59D.4@users.sourceforge.net>
2014-11-20 10:50                                   ` [PATCH 1/1] [media] platform: Deletion of unnecessary checks before two function calls SF Markus Elfring
2014-11-21 10:12                                   ` [PATCH 1/1] thermal: Exynos: " SF Markus Elfring
2014-11-21 10:17                                     ` Julia Lawall
2014-11-21 13:25                                       ` SF Markus Elfring
2014-11-21 16:17                                       ` [PATCH v2] " SF Markus Elfring
2015-02-04 21:00                                   ` [PATCH] GPU-DRM-Exynos: Delete " SF Markus Elfring
2015-02-05  8:29                                     ` Joonyoung Shim
2015-06-27 17:17                                       ` SF Markus Elfring
2016-07-21 17:42                                       ` [PATCH] GPU-DRM-Exynos: Delete an unnecessary check before the function call "vunmap" SF Markus Elfring
2016-07-21 18:07                                         ` Sean Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox