* Re: [PATCH 1/1] GPU-DRM-nouveau: Deletion of unnecessary checks before two function calls
[not found] ` <5317A59D.4@users.sourceforge.net>
@ 2014-10-22 14:30 ` SF Markus Elfring
2015-07-05 18:22 ` [PATCH] GPU-DRM-nouveau: Delete " SF Markus Elfring
2014-10-22 16:48 ` [PATCH 1/1] GPU-DRM-GMA500: Deletion of unnecessary checks before two function calls SF Markus Elfring
` (33 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2014-10-22 14:30 UTC (permalink / raw)
To: David Airlie, dri-devel
Cc: Ben Skeggs, Ilia Mirkin, Alexandre Courbot, Thierry Reding,
linux-kernel, kernel-janitors, trivial, Coccinelle
>> If you are convinced that dropping the null tests is a good idea, then you
>> can submit the patch that makes the change to the relevant maintainers and
>> mailing lists.
Would you like to integrate the following proposal into your source code repository?
Regards,
Markus
>From 29e61d5ccc44cd5e5961acff61b6938e0705044d Mon Sep 17 00:00:00 2001
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 22 Oct 2014 15:45:22 +0200
Subject: [PATCH] GPU-DRM-nouveau: Deletion of unnecessary checks before two
function calls
A semantic patch approach was proposed with the subject "[PATCH with
Coccinelle?] Deletion of unnecessary checks before specific function calls"
on 2014-03-05.
https://lkml.org/lkml/2014/3/5/344
http://article.gmane.org/gmane.comp.version-control.coccinelle/3513/
This patch pattern application was repeated with the help of the software
"Coccinelle 1.0.0-rc22" on the source files for Linux 3.17.1. An extract
of the automatically generated update suggestions is shown here.
It was determined that the affected source code places call functions
which perform input parameter validation already. It is therefore not
needed that a similar safety check is repeated at the call site.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/nouveau/core/core/handle.c | 3 +--
drivers/gpu/drm/nouveau/nouveau_drm.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/core/core/handle.c
b/drivers/gpu/drm/nouveau/core/core/handle.c
index a490b80..75d0c2c 100644
--- a/drivers/gpu/drm/nouveau/core/core/handle.c
+++ b/drivers/gpu/drm/nouveau/core/core/handle.c
@@ -219,8 +219,7 @@ nouveau_handle_get_cinst(struct nouveau_object *engctx, u32
cinst)
void
nouveau_handle_put(struct nouveau_handle *handle)
{
- if (handle)
- nouveau_namedb_put(handle);
+ nouveau_namedb_put(handle);
}
int
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c
b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 5723807..5c29079 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -512,8 +512,7 @@ nouveau_drm_unload(struct drm_device *dev)
nouveau_vga_fini(drm);
nvif_device_fini(&drm->device);
- if (drm->hdmi_device)
- pci_dev_put(drm->hdmi_device);
+ pci_dev_put(drm->hdmi_device);
nouveau_cli_destroy(&drm->client);
return 0;
}
--
2.1.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] GPU-DRM-GMA500: Deletion of unnecessary checks before two function calls
[not found] ` <5317A59D.4@users.sourceforge.net>
2014-10-22 14:30 ` [PATCH 1/1] GPU-DRM-nouveau: Deletion of unnecessary checks before two function calls SF Markus Elfring
@ 2014-10-22 16:48 ` SF Markus Elfring
2014-10-23 11:26 ` One Thousand Gnomes
2016-07-22 8:45 ` [PATCH] GPU-DRM-GMA500: Delete " SF Markus Elfring
2014-11-19 15:40 ` [PATCH 1/1] DRM-EDID: Deletion of an unnecessary check before the function call "release_firmware" SF Markus Elfring
` (32 subsequent siblings)
34 siblings, 2 replies; 123+ messages in thread
From: SF Markus Elfring @ 2014-10-22 16:48 UTC (permalink / raw)
To: David Airlie, dri-devel
Cc: Daniel Vetter, Matt Roper, David Herrmann, Thomas Wood, Rob Clark,
Patrik Jakobsson, Arthur Borsboom, Thierry Reding, Benoit Taine,
linux-kernel, kernel-janitors, trivial, Coccinelle
>> If you are convinced that dropping the null tests is a good idea, then you
>> can submit the patch that makes the change to the relevant maintainers and
>> mailing lists.
Would you like to integrate the following proposal into your source code repository?
Regards,
Markus
>From e61965bbcb143a54696fbd468989110519e41497 Mon Sep 17 00:00:00 2001
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 22 Oct 2014 18:28:12 +0200
Subject: [PATCH] GPU-DRM-GMA500: Deletion of unnecessary checks before two
function calls
A semantic patch approach was proposed with the subject "[PATCH with
Coccinelle?] Deletion of unnecessary checks before specific function calls"
on 2014-03-05.
https://lkml.org/lkml/2014/3/5/344
http://article.gmane.org/gmane.comp.version-control.coccinelle/3513/
This patch pattern application was repeated with the help of the software
"Coccinelle 1.0.0-rc22" on the source files for Linux 3.17.1. An extract
of the automatically generated update suggestions is shown here.
It was determined that the affected source code places call functions
which perform input parameter validation already. It is therefore not
needed that a similar safety check is repeated at the call site.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 3 +--
drivers/gpu/drm/gma500/cdv_intel_lvds.c | 9 +++------
drivers/gpu/drm/gma500/oaktrail_lvds.c | 3 +--
drivers/gpu/drm/gma500/psb_drv.c | 3 +--
drivers/gpu/drm/gma500/psb_intel_lvds.c | 9 +++------
5 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
index 4268bf2..0d69624 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
@@ -246,8 +246,7 @@ static void cdv_hdmi_destroy(struct drm_connector *connector)
{
struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
- if (gma_encoder->i2c_bus)
- psb_intel_i2c_destroy(gma_encoder->i2c_bus);
+ psb_intel_i2c_destroy(gma_encoder->i2c_bus);
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
kfree(connector);
diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
index 0b77039..8f24013 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
@@ -444,8 +444,7 @@ static void cdv_intel_lvds_destroy(struct drm_connector
*connector)
{
struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
- if (gma_encoder->i2c_bus)
- psb_intel_i2c_destroy(gma_encoder->i2c_bus);
+ psb_intel_i2c_destroy(gma_encoder->i2c_bus);
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
kfree(connector);
@@ -780,12 +779,10 @@ out:
failed_find:
mutex_unlock(&dev->mode_config.mutex);
printk(KERN_ERR "Failed find\n");
- if (gma_encoder->ddc_bus)
- psb_intel_i2c_destroy(gma_encoder->ddc_bus);
+ psb_intel_i2c_destroy(gma_encoder->ddc_bus);
failed_ddc:
printk(KERN_ERR "Failed DDC\n");
- if (gma_encoder->i2c_bus)
- psb_intel_i2c_destroy(gma_encoder->i2c_bus);
+ psb_intel_i2c_destroy(gma_encoder->i2c_bus);
failed_blc_i2c:
printk(KERN_ERR "Failed BLC\n");
drm_encoder_cleanup(encoder);
diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c
b/drivers/gpu/drm/gma500/oaktrail_lvds.c
index 0d39da6..49c5c415 100644
--- a/drivers/gpu/drm/gma500/oaktrail_lvds.c
+++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c
@@ -411,8 +411,7 @@ failed_find:
mutex_unlock(&dev->mode_config.mutex);
dev_dbg(dev->dev, "No LVDS modes found, disabling.\n");
- if (gma_encoder->ddc_bus)
- psb_intel_i2c_destroy(gma_encoder->ddc_bus);
+ psb_intel_i2c_destroy(gma_encoder->ddc_bus);
/* failed_ddc: */
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 6ec3a90..0efe165 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -210,8 +210,7 @@ static int psb_driver_unload(struct drm_device *dev)
iounmap(dev_priv->aux_reg);
dev_priv->aux_reg = NULL;
}
- if (dev_priv->aux_pdev)
- pci_dev_put(dev_priv->aux_pdev);
+ pci_dev_put(dev_priv->aux_pdev);
/* Destroy VBT data */
psb_intel_destroy_bios(dev);
diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c
b/drivers/gpu/drm/gma500/psb_intel_lvds.c
index 88aad95..e73c3f9 100644
--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
@@ -561,8 +561,7 @@ void psb_intel_lvds_destroy(struct drm_connector *connector)
struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
struct psb_intel_lvds_priv *lvds_priv = gma_encoder->dev_priv;
- if (lvds_priv->ddc_bus)
- psb_intel_i2c_destroy(lvds_priv->ddc_bus);
+ psb_intel_i2c_destroy(lvds_priv->ddc_bus);
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
kfree(connector);
@@ -834,11 +833,9 @@ out:
failed_find:
mutex_unlock(&dev->mode_config.mutex);
- if (lvds_priv->ddc_bus)
- psb_intel_i2c_destroy(lvds_priv->ddc_bus);
+ psb_intel_i2c_destroy(lvds_priv->ddc_bus);
failed_ddc:
- if (lvds_priv->i2c_bus)
- psb_intel_i2c_destroy(lvds_priv->i2c_bus);
+ psb_intel_i2c_destroy(lvds_priv->i2c_bus);
failed_blc_i2c:
drm_encoder_cleanup(encoder);
drm_connector_cleanup(connector);
--
2.1.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] GPU-DRM-GMA500: Deletion of unnecessary checks before two function calls
2014-10-22 16:48 ` [PATCH 1/1] GPU-DRM-GMA500: Deletion of unnecessary checks before two function calls SF Markus Elfring
@ 2014-10-23 11:26 ` One Thousand Gnomes
2014-10-26 12:10 ` SF Markus Elfring
2016-07-22 8:45 ` [PATCH] GPU-DRM-GMA500: Delete " SF Markus Elfring
1 sibling, 1 reply; 123+ messages in thread
From: One Thousand Gnomes @ 2014-10-23 11:26 UTC (permalink / raw)
To: SF Markus Elfring
Cc: David Airlie, dri-devel, Daniel Vetter, Matt Roper,
David Herrmann, Thomas Wood, Rob Clark, Patrik Jakobsson,
Arthur Borsboom, Thierry Reding, Benoit Taine, linux-kernel,
kernel-janitors, trivial, Coccinelle
On Wed, 22 Oct 2014 18:48:21 +0200
SF Markus Elfring <elfring@users.sourceforge.net> wrote:
> >> If you are convinced that dropping the null tests is a good idea, then you
> >> can submit the patch that makes the change to the relevant maintainers and
> >> mailing lists.
>
> Would you like to integrate the following proposal into your source code repository?
What platforms have you tested the code on at this point ?
Alan
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] GPU-DRM-GMA500: Deletion of unnecessary checks before two function calls
2014-10-23 11:26 ` One Thousand Gnomes
@ 2014-10-26 12:10 ` SF Markus Elfring
2014-10-26 14:56 ` Arthur Borsboom
0 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2014-10-26 12:10 UTC (permalink / raw)
To: One Thousand Gnomes
Cc: David Airlie, dri-devel, Daniel Vetter, Matt Roper,
David Herrmann, Thomas Wood, Rob Clark, Patrik Jakobsson,
Arthur Borsboom, Thierry Reding, Benoit Taine, linux-kernel,
kernel-janitors, trivial, Coccinelle
> What platforms have you tested the code on at this point ?
None. - My "test computer" does not provide the corresponding hardware for the
affected driver source files.
Regards,
Markus
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] GPU-DRM-GMA500: Deletion of unnecessary checks before two function calls
2014-10-26 12:10 ` SF Markus Elfring
@ 2014-10-26 14:56 ` Arthur Borsboom
0 siblings, 0 replies; 123+ messages in thread
From: Arthur Borsboom @ 2014-10-26 14:56 UTC (permalink / raw)
To: SF Markus Elfring
Cc: One Thousand Gnomes, trivial, Daniel Vetter, kernel-janitors,
linux-kernel, dri-devel, Benoit Taine, Thierry Reding, Coccinelle,
Thomas Wood
[-- Attachment #1.1: Type: text/plain, Size: 665 bytes --]
I still have the hardware in use and I am willing to test.
If necessary, please send me a URL to the snapshot of the kernel with the
modified code. I can compile this (takes about 8 hours ;-) on the high
speed atom n2600) and run a couple of random tests, such as starting the
WM, browsing some webpages, changing resolution, and run a 2D benchmark.
Greetings,
Arthur Borsboom
On 26 Oct 2014 13:10, "SF Markus Elfring" <elfring@users.sourceforge.net>
wrote:
> > What platforms have you tested the code on at this point ?
>
> None. - My "test computer" does not provide the corresponding hardware for
> the
> affected driver source files.
>
> Regards,
> Markus
>
[-- Attachment #1.2: Type: text/html, Size: 990 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH 1/1] DRM-EDID: Deletion of an unnecessary check before the function call "release_firmware"
[not found] ` <5317A59D.4@users.sourceforge.net>
2014-10-22 14:30 ` [PATCH 1/1] GPU-DRM-nouveau: Deletion of unnecessary checks before two function calls SF Markus Elfring
2014-10-22 16:48 ` [PATCH 1/1] GPU-DRM-GMA500: Deletion of unnecessary checks before two function calls SF Markus Elfring
@ 2014-11-19 15:40 ` SF Markus Elfring
2014-11-20 4:03 ` Thierry Reding
2014-11-19 16:14 ` [PATCH 1/1] DRM-tilcdc: Deletion of an unnecessary check before the function call "drm_fbdev_cma_hotplug_event" SF Markus Elfring
` (31 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2014-11-19 15:40 UTC (permalink / raw)
To: David Airlie, dri-devel; +Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 19 Nov 2014 16:33:17 +0100
The release_firmware() function tests whether its argument is NULL and then
returns 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/gpu/drm/drm_edid_load.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c
index 0a235fe..732cb6f 100644
--- a/drivers/gpu/drm/drm_edid_load.c
+++ b/drivers/gpu/drm/drm_edid_load.c
@@ -254,8 +254,7 @@ static void *edid_load(struct drm_connector *connector, const char *name,
name, connector_name);
out:
- if (fw)
- release_firmware(fw);
+ release_firmware(fw);
return edid;
}
--
2.1.3
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 1/1] DRM-tilcdc: Deletion of an unnecessary check before the function call "drm_fbdev_cma_hotplug_event"
[not found] ` <5317A59D.4@users.sourceforge.net>
` (2 preceding siblings ...)
2014-11-19 15:40 ` [PATCH 1/1] DRM-EDID: Deletion of an unnecessary check before the function call "release_firmware" SF Markus Elfring
@ 2014-11-19 16:14 ` SF Markus Elfring
2014-11-20 4:11 ` Thierry Reding
2014-11-19 16:37 ` [PATCH 1/1] DRM-UDL: Deletion of an unnecessary check before the function call "vunmap" SF Markus Elfring
` (30 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2014-11-19 16:14 UTC (permalink / raw)
To: David Airlie, dri-devel; +Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 19 Nov 2014 17:05:20 +0100
The drm_fbdev_cma_hotplug_event() function tests whether its argument is NULL
and then returns 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/gpu/drm/tilcdc/tilcdc_drv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 000428e..335b1dc 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -58,8 +58,7 @@ static struct drm_framebuffer *tilcdc_fb_create(struct drm_device *dev,
static void tilcdc_fb_output_poll_changed(struct drm_device *dev)
{
struct tilcdc_drm_private *priv = dev->dev_private;
- if (priv->fbdev)
- drm_fbdev_cma_hotplug_event(priv->fbdev);
+ drm_fbdev_cma_hotplug_event(priv->fbdev);
}
static const struct drm_mode_config_funcs mode_config_funcs = {
--
2.1.3
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 1/1] DRM-UDL: Deletion of an unnecessary check before the function call "vunmap"
[not found] ` <5317A59D.4@users.sourceforge.net>
` (3 preceding siblings ...)
2014-11-19 16:14 ` [PATCH 1/1] DRM-tilcdc: Deletion of an unnecessary check before the function call "drm_fbdev_cma_hotplug_event" SF Markus Elfring
@ 2014-11-19 16:37 ` SF Markus Elfring
2014-11-20 4:17 ` Thierry Reding
2014-11-19 16:55 ` [PATCH 1/1] DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree" SF Markus Elfring
` (29 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2014-11-19 16:37 UTC (permalink / raw)
To: David Airlie, dri-devel; +Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 19 Nov 2014 17:33:32 +0100
The vunmap() function performes 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/udl/udl_gem.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c
index 8044f5f..2979625 100644
--- a/drivers/gpu/drm/udl/udl_gem.c
+++ b/drivers/gpu/drm/udl/udl_gem.c
@@ -164,8 +164,7 @@ void udl_gem_vunmap(struct udl_gem_object *obj)
return;
}
- if (obj->vmapping)
- vunmap(obj->vmapping);
+ vunmap(obj->vmapping);
udl_gem_put_pages(obj);
}
--
2.1.3
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 1/1] DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree"
[not found] ` <5317A59D.4@users.sourceforge.net>
` (4 preceding siblings ...)
2014-11-19 16:37 ` [PATCH 1/1] DRM-UDL: Deletion of an unnecessary check before the function call "vunmap" SF Markus Elfring
@ 2014-11-19 16:55 ` SF Markus Elfring
2014-11-20 4:22 ` Thierry Reding
2015-07-06 8:01 ` SF Markus Elfring
2014-11-25 12:50 ` [PATCH 1/1] GPU-DRM-MSM-Adreno: Deletion of unnecessary checks before the function call "release_firmware" SF Markus Elfring
` (28 subsequent siblings)
34 siblings, 2 replies; 123+ messages in thread
From: SF Markus Elfring @ 2014-11-19 16:55 UTC (permalink / raw)
To: David Airlie, dri-devel; +Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 19 Nov 2014 17:50:19 +0100
The vfree() function performes 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/vmwgfx/vmwgfx_drv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 14b2f50..f9a67b8 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -889,8 +889,7 @@ static int vmw_driver_unload(struct drm_device *dev)
if (dev_priv->ctx.res_ht_initialized)
drm_ht_remove(&dev_priv->ctx.res_ht);
- if (dev_priv->ctx.cmd_bounce)
- vfree(dev_priv->ctx.cmd_bounce);
+ vfree(dev_priv->ctx.cmd_bounce);
if (dev_priv->enable_fb) {
vmw_fb_close(dev_priv);
vmw_kms_restore_vga(dev_priv);
--
2.1.3
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] DRM-EDID: Deletion of an unnecessary check before the function call "release_firmware"
2014-11-19 15:40 ` [PATCH 1/1] DRM-EDID: Deletion of an unnecessary check before the function call "release_firmware" SF Markus Elfring
@ 2014-11-20 4:03 ` Thierry Reding
0 siblings, 0 replies; 123+ messages in thread
From: Thierry Reding @ 2014-11-20 4:03 UTC (permalink / raw)
To: SF Markus Elfring; +Cc: Julia Lawall, kernel-janitors, linux-kernel, dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 1070 bytes --]
On Nov 19, 2014 4:41 PM, "SF Markus Elfring" <elfring@users.sourceforge.net>
wrote:
>
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 19 Nov 2014 16:33:17 +0100
>
> The release_firmware() function tests whether its argument is NULL and
then
> returns 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/gpu/drm/drm_edid_load.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid_load.c
b/drivers/gpu/drm/drm_edid_load.c
> index 0a235fe..732cb6f 100644
> --- a/drivers/gpu/drm/drm_edid_load.c
> +++ b/drivers/gpu/drm/drm_edid_load.c
> @@ -254,8 +254,7 @@ static void *edid_load(struct drm_connector
*connector, const char *name,
> name, connector_name);
>
> out:
> - if (fw)
> - release_firmware(fw);
> + release_firmware(fw);
> return edid;
> }
>
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
[-- Attachment #1.2: Type: text/html, Size: 1592 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] DRM-tilcdc: Deletion of an unnecessary check before the function call "drm_fbdev_cma_hotplug_event"
2014-11-19 16:14 ` [PATCH 1/1] DRM-tilcdc: Deletion of an unnecessary check before the function call "drm_fbdev_cma_hotplug_event" SF Markus Elfring
@ 2014-11-20 4:11 ` Thierry Reding
0 siblings, 0 replies; 123+ messages in thread
From: Thierry Reding @ 2014-11-20 4:11 UTC (permalink / raw)
To: SF Markus Elfring, David Airlie, dri-devel
Cc: Julia Lawall, kernel-janitors, LKML
On November 19, 2014 5:28:59 PM SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 19 Nov 2014 17:05:20 +0100
>
> The drm_fbdev_cma_hotplug_event() function tests whether its argument is NULL
> and then returns 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/gpu/drm/tilcdc/tilcdc_drv.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> index 000428e..335b1dc 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -58,8 +58,7 @@ static struct drm_framebuffer *tilcdc_fb_create(struct
> drm_device *dev,
> static void tilcdc_fb_output_poll_changed(struct drm_device *dev)
> {
> struct tilcdc_drm_private *priv = dev->dev_private;
> - if (priv->fbdev)
> - drm_fbdev_cma_hotplug_event(priv->fbdev);
> + drm_fbdev_cma_hotplug_event(priv->fbdev);
> }
>
> static const struct drm_mode_config_funcs mode_config_funcs = {
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] DRM-UDL: Deletion of an unnecessary check before the function call "vunmap"
2014-11-19 16:37 ` [PATCH 1/1] DRM-UDL: Deletion of an unnecessary check before the function call "vunmap" SF Markus Elfring
@ 2014-11-20 4:17 ` Thierry Reding
0 siblings, 0 replies; 123+ messages in thread
From: Thierry Reding @ 2014-11-20 4:17 UTC (permalink / raw)
To: SF Markus Elfring, David Airlie, dri-devel
Cc: Julia Lawall, kernel-janitors, LKML
On November 19, 2014 5:42:26 PM SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 19 Nov 2014 17:33:32 +0100
>
> The vunmap() function performes 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/udl/udl_gem.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c
> index 8044f5f..2979625 100644
> --- a/drivers/gpu/drm/udl/udl_gem.c
> +++ b/drivers/gpu/drm/udl/udl_gem.c
> @@ -164,8 +164,7 @@ void udl_gem_vunmap(struct udl_gem_object *obj)
> return;
> }
>
> - if (obj->vmapping)
> - vunmap(obj->vmapping);
> + vunmap(obj->vmapping);
>
> udl_gem_put_pages(obj);
> }
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree"
2014-11-19 16:55 ` [PATCH 1/1] DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree" SF Markus Elfring
@ 2014-11-20 4:22 ` Thierry Reding
2015-07-06 8:01 ` SF Markus Elfring
1 sibling, 0 replies; 123+ messages in thread
From: Thierry Reding @ 2014-11-20 4:22 UTC (permalink / raw)
To: SF Markus Elfring, David Airlie, dri-devel
Cc: Julia Lawall, kernel-janitors, LKML
On November 19, 2014 5:57:13 PM SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 19 Nov 2014 17:50:19 +0100
>
> The vfree() function performes 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/vmwgfx/vmwgfx_drv.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> index 14b2f50..f9a67b8 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> @@ -889,8 +889,7 @@ static int vmw_driver_unload(struct drm_device *dev)
>
> if (dev_priv->ctx.res_ht_initialized)
> drm_ht_remove(&dev_priv->ctx.res_ht);
> - if (dev_priv->ctx.cmd_bounce)
> - vfree(dev_priv->ctx.cmd_bounce);
> + vfree(dev_priv->ctx.cmd_bounce);
> if (dev_priv->enable_fb) {
> vmw_fb_close(dev_priv);
> vmw_kms_restore_vga(dev_priv);
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH 1/1] GPU-DRM-MSM-Adreno: Deletion of unnecessary checks before the function call "release_firmware"
[not found] ` <5317A59D.4@users.sourceforge.net>
` (5 preceding siblings ...)
2014-11-19 16:55 ` [PATCH 1/1] DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree" SF Markus Elfring
@ 2014-11-25 12:50 ` SF Markus Elfring
2014-12-01 16:01 ` Thierry Reding
2014-11-25 13:33 ` [PATCH 1/1] GPU-DRM-MSM: Deletion of unnecessary checks before two function calls SF Markus Elfring
` (27 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2014-11-25 12:50 UTC (permalink / raw)
To: David Airlie, dri-devel; +Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 25 Nov 2014 13:44:20 +0100
The release_firmware() function tests whether its argument is NULL
and then returns 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/gpu/drm/msm/adreno/adreno_gpu.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 655ce5b..757052c 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -404,9 +404,7 @@ void adreno_gpu_cleanup(struct adreno_gpu *gpu)
msm_gem_put_iova(gpu->memptrs_bo, gpu->base.id);
drm_gem_object_unreference(gpu->memptrs_bo);
}
- if (gpu->pm4)
- release_firmware(gpu->pm4);
- if (gpu->pfp)
- release_firmware(gpu->pfp);
+ release_firmware(gpu->pm4);
+ release_firmware(gpu->pfp);
msm_gpu_cleanup(&gpu->base);
}
--
2.1.3
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 1/1] GPU-DRM-MSM: Deletion of unnecessary checks before two function calls
[not found] ` <5317A59D.4@users.sourceforge.net>
` (6 preceding siblings ...)
2014-11-25 12:50 ` [PATCH 1/1] GPU-DRM-MSM-Adreno: Deletion of unnecessary checks before the function call "release_firmware" SF Markus Elfring
@ 2014-11-25 13:33 ` SF Markus Elfring
2014-12-01 16:04 ` Thierry Reding
2014-12-01 16:14 ` Rob Clark
2015-02-04 21:00 ` [PATCH] GPU-DRM-Exynos: Delete " SF Markus Elfring
` (26 subsequent siblings)
34 siblings, 2 replies; 123+ messages in thread
From: SF Markus Elfring @ 2014-11-25 13:33 UTC (permalink / raw)
To: David Airlie, dri-devel; +Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 25 Nov 2014 14:30:28 +0100
The functions framebuffer_release() and vunmap() perform 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/msm/msm_fbdev.c | 3 +--
drivers/gpu/drm/msm/msm_gem.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index ab5bfd2..fd5a6f3 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -193,8 +193,7 @@ fail_unlock:
fail:
if (ret) {
- if (fbi)
- framebuffer_release(fbi);
+ framebuffer_release(fbi);
if (fb) {
drm_framebuffer_unregister_private(fb);
drm_framebuffer_remove(fb);
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index 4b1b82a..157cf21 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -543,8 +543,7 @@ void msm_gem_free_object(struct drm_gem_object *obj)
drm_free_large(msm_obj->pages);
} else {
- if (msm_obj->vaddr)
- vunmap(msm_obj->vaddr);
+ vunmap(msm_obj->vaddr);
put_pages(obj);
}
--
2.1.3
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] GPU-DRM-MSM-Adreno: Deletion of unnecessary checks before the function call "release_firmware"
2014-11-25 12:50 ` [PATCH 1/1] GPU-DRM-MSM-Adreno: Deletion of unnecessary checks before the function call "release_firmware" SF Markus Elfring
@ 2014-12-01 16:01 ` Thierry Reding
0 siblings, 0 replies; 123+ messages in thread
From: Thierry Reding @ 2014-12-01 16:01 UTC (permalink / raw)
To: SF Markus Elfring; +Cc: Julia Lawall, kernel-janitors, LKML, dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 1612 bytes --]
On Tue, Nov 25, 2014 at 01:50:25PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
You can probably get rid of this if you configure your emailer properly.
> Date: Tue, 25 Nov 2014 13:44:20 +0100
This is odd. I've never seen git send-email generate these.
I didn't notice with your earlier patches, but the subject prefix is
wrong. Please use something more consistent with existing patches, in
this case: "drm/msm: ..." or "drm/msm/adreno: ..."
> The release_firmware() function tests whether its argument is NULL
> and then returns 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/gpu/drm/msm/adreno/adreno_gpu.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> index 655ce5b..757052c 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> @@ -404,9 +404,7 @@ void adreno_gpu_cleanup(struct adreno_gpu *gpu)
> msm_gem_put_iova(gpu->memptrs_bo, gpu->base.id);
> drm_gem_object_unreference(gpu->memptrs_bo);
> }
> - if (gpu->pm4)
> - release_firmware(gpu->pm4);
> - if (gpu->pfp)
> - release_firmware(gpu->pfp);
> + release_firmware(gpu->pm4);
> + release_firmware(gpu->pfp);
> msm_gpu_cleanup(&gpu->base);
> }
Besides the subject prefix,
Reviewed-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] GPU-DRM-MSM: Deletion of unnecessary checks before two function calls
2014-11-25 13:33 ` [PATCH 1/1] GPU-DRM-MSM: Deletion of unnecessary checks before two function calls SF Markus Elfring
@ 2014-12-01 16:04 ` Thierry Reding
2014-12-01 16:09 ` Rob Clark
2014-12-01 16:14 ` Rob Clark
1 sibling, 1 reply; 123+ messages in thread
From: Thierry Reding @ 2014-12-01 16:04 UTC (permalink / raw)
To: SF Markus Elfring; +Cc: Julia Lawall, kernel-janitors, LKML, dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 988 bytes --]
On Tue, Nov 25, 2014 at 02:33:53PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 25 Nov 2014 14:30:28 +0100
>
> The functions framebuffer_release() and vunmap() perform 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/msm/msm_fbdev.c | 3 +--
> drivers/gpu/drm/msm/msm_gem.c | 3 +--
> 2 files changed, 2 insertions(+), 4 deletions(-)
This needs the same fix for the subject prefix that I mentioned for your
other patch, otherwise:
Reviewed-by: Thierry Reding <treding@nvidia.com>
Perhaps a good idea would be to send all of these patches with the
subject prefix fixed up as a second version and threaded in a series.
That makes it easier for people to pick them up (assuming Dave will take
them directly).
Thierry
[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] GPU-DRM-MSM: Deletion of unnecessary checks before two function calls
2014-12-01 16:04 ` Thierry Reding
@ 2014-12-01 16:09 ` Rob Clark
0 siblings, 0 replies; 123+ messages in thread
From: Rob Clark @ 2014-12-01 16:09 UTC (permalink / raw)
To: Thierry Reding
Cc: Julia Lawall, kernel-janitors, SF Markus Elfring,
dri-devel@lists.freedesktop.org, LKML
On Mon, Dec 1, 2014 at 11:04 AM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Tue, Nov 25, 2014 at 02:33:53PM +0100, SF Markus Elfring wrote:
>> From: Markus Elfring <elfring@users.sourceforge.net>
>> Date: Tue, 25 Nov 2014 14:30:28 +0100
>>
>> The functions framebuffer_release() and vunmap() perform 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/msm/msm_fbdev.c | 3 +--
>> drivers/gpu/drm/msm/msm_gem.c | 3 +--
>> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> This needs the same fix for the subject prefix that I mentioned for your
> other patch, otherwise:
>
> Reviewed-by: Thierry Reding <treding@nvidia.com>
>
> Perhaps a good idea would be to send all of these patches with the
> subject prefix fixed up as a second version and threaded in a series.
> That makes it easier for people to pick them up (assuming Dave will take
> them directly).
>
no worries, I'll fix up the subject lines when I apply..
BR,
-R
> Thierry
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] GPU-DRM-MSM: Deletion of unnecessary checks before two function calls
2014-11-25 13:33 ` [PATCH 1/1] GPU-DRM-MSM: Deletion of unnecessary checks before two function calls SF Markus Elfring
2014-12-01 16:04 ` Thierry Reding
@ 2014-12-01 16:14 ` Rob Clark
1 sibling, 0 replies; 123+ messages in thread
From: Rob Clark @ 2014-12-01 16:14 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Julia Lawall, kernel-janitors, LKML,
dri-devel@lists.freedesktop.org
btw, I have these two queued up on msm-next, thanks
BR,
-R
On Tue, Nov 25, 2014 at 8:33 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 25 Nov 2014 14:30:28 +0100
>
> The functions framebuffer_release() and vunmap() perform 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/msm/msm_fbdev.c | 3 +--
> drivers/gpu/drm/msm/msm_gem.c | 3 +--
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
> index ab5bfd2..fd5a6f3 100644
> --- a/drivers/gpu/drm/msm/msm_fbdev.c
> +++ b/drivers/gpu/drm/msm/msm_fbdev.c
> @@ -193,8 +193,7 @@ fail_unlock:
> fail:
>
> if (ret) {
> - if (fbi)
> - framebuffer_release(fbi);
> + framebuffer_release(fbi);
> if (fb) {
> drm_framebuffer_unregister_private(fb);
> drm_framebuffer_remove(fb);
> diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
> index 4b1b82a..157cf21 100644
> --- a/drivers/gpu/drm/msm/msm_gem.c
> +++ b/drivers/gpu/drm/msm/msm_gem.c
> @@ -543,8 +543,7 @@ void msm_gem_free_object(struct drm_gem_object *obj)
> drm_free_large(msm_obj->pages);
>
> } else {
> - if (msm_obj->vaddr)
> - vunmap(msm_obj->vaddr);
> + vunmap(msm_obj->vaddr);
> put_pages(obj);
> }
>
> --
> 2.1.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM-Exynos: Delete unnecessary checks before two function calls
[not found] ` <5317A59D.4@users.sourceforge.net>
` (7 preceding siblings ...)
2014-11-25 13:33 ` [PATCH 1/1] GPU-DRM-MSM: Deletion of unnecessary checks before two function calls SF Markus Elfring
@ 2015-02-04 21:00 ` SF Markus Elfring
2015-02-05 8:29 ` Joonyoung Shim
2015-02-04 21:25 ` [PATCH] GPU-DRM-OMAP: Delete unnecessary checks before two function calls SF Markus Elfring
` (25 subsequent siblings)
34 siblings, 1 reply; 123+ 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] 123+ messages in thread
* [PATCH] GPU-DRM-OMAP: Delete unnecessary checks before two function calls
[not found] ` <5317A59D.4@users.sourceforge.net>
` (8 preceding siblings ...)
2015-02-04 21:00 ` [PATCH] GPU-DRM-Exynos: Delete " SF Markus Elfring
@ 2015-02-04 21:25 ` SF Markus Elfring
2016-07-22 6:45 ` SF Markus Elfring
2015-02-05 9:20 ` [PATCH] GPU-DRM-Tegra: Delete an unnecessary check before the function call "vunmap" SF Markus Elfring
` (24 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-02-04 21:25 UTC (permalink / raw)
To: David Airlie, dri-devel; +Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 4 Feb 2015 22:22:36 +0100
The functions framebuffer_release() 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/omapdrm/omap_fbdev.c | 3 +--
drivers/gpu/drm/omapdrm/omap_gem.c | 5 ++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index d292d24..fcc02b0 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -270,8 +270,7 @@ fail_unlock:
fail:
if (ret) {
- if (fbi)
- framebuffer_release(fbi);
+ framebuffer_release(fbi);
if (fb) {
drm_framebuffer_unregister_private(fb);
drm_framebuffer_remove(fb);
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index aeb91ed..18a4137 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -1292,12 +1292,11 @@ void omap_gem_free_object(struct drm_gem_object *obj)
if (omap_obj->pages)
omap_gem_detach_pages(obj);
- if (!is_shmem(obj)) {
+ if (!is_shmem(obj))
dma_free_writecombine(dev->dev, obj->size,
omap_obj->vaddr, omap_obj->paddr);
- } else if (omap_obj->vaddr) {
+ else
vunmap(omap_obj->vaddr);
- }
}
/* don't free externally allocated syncobj */
--
2.2.2
^ permalink raw reply related [flat|nested] 123+ 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; 123+ 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] 123+ messages in thread
* [PATCH] GPU-DRM-Tegra: Delete an unnecessary check before the function call "vunmap"
[not found] ` <5317A59D.4@users.sourceforge.net>
` (9 preceding siblings ...)
2015-02-04 21:25 ` [PATCH] GPU-DRM-OMAP: Delete unnecessary checks before two function calls SF Markus Elfring
@ 2015-02-05 9:20 ` SF Markus Elfring
2015-07-08 18:40 ` SF Markus Elfring
2015-06-27 18:51 ` [PATCH] drm/bridge: ps8622: Delete a check before backlight_device_unregister() SF Markus Elfring
` (23 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-02-05 9:20 UTC (permalink / raw)
To: Alexandre Courbot, David Airlie, Stephen Warren,
Terje Bergström, Thierry Reding, dri-devel, linux-tegra
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 5 Feb 2015 10:12:51 +0100
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/tegra/fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c
index e9c715d..803598e 100644
--- a/drivers/gpu/drm/tegra/fb.c
+++ b/drivers/gpu/drm/tegra/fb.c
@@ -66,7 +66,7 @@ static void tegra_fb_destroy(struct drm_framebuffer *framebuffer)
struct tegra_bo *bo = fb->planes[i];
if (bo) {
- if (bo->pages && bo->vaddr)
+ if (bo->pages)
vunmap(bo->vaddr);
drm_gem_object_unreference_unlocked(&bo->gem);
--
2.2.2
^ permalink raw reply related [flat|nested] 123+ 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; 123+ 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] 123+ messages in thread
* [PATCH] drm/bridge: ps8622: Delete a check before backlight_device_unregister()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (10 preceding siblings ...)
2015-02-05 9:20 ` [PATCH] GPU-DRM-Tegra: Delete an unnecessary check before the function call "vunmap" SF Markus Elfring
@ 2015-06-27 18:51 ` SF Markus Elfring
2016-07-22 12:54 ` [PATCH] drm/bridge: ps8622: Delete an unnecessary " SF Markus Elfring
2015-06-27 21:16 ` [PATCH 0/2] drm/msm/dsi: Deletion of an unnecessary check SF Markus Elfring
` (22 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-06-27 18:51 UTC (permalink / raw)
To: David Airlie, dri-devel; +Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 27 Jun 2015 20:44:49 +0200
The backlight_device_unregister() function tests whether its argument is NULL
and then returns 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/gpu/drm/bridge/ps8622.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ps8622.c b/drivers/gpu/drm/bridge/ps8622.c
index 1a6607b..70dacb8 100644
--- a/drivers/gpu/drm/bridge/ps8622.c
+++ b/drivers/gpu/drm/bridge/ps8622.c
@@ -646,9 +646,7 @@ static int ps8622_remove(struct i2c_client *client)
{
struct ps8622_bridge *ps8622 = i2c_get_clientdata(client);
- if (ps8622->bl)
- backlight_device_unregister(ps8622->bl);
-
+ backlight_device_unregister(ps8622->bl);
drm_bridge_remove(&ps8622->bridge);
return 0;
--
2.4.4
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 0/2] drm/msm/dsi: Deletion of an unnecessary check
[not found] ` <5317A59D.4@users.sourceforge.net>
` (11 preceding siblings ...)
2015-06-27 18:51 ` [PATCH] drm/bridge: ps8622: Delete a check before backlight_device_unregister() SF Markus Elfring
@ 2015-06-27 21:16 ` SF Markus Elfring
2015-06-27 21:20 ` [PATCH 1/2] drm/msm/dsi: Delete an unnecessary check before the function call "dsi_destroy" SF Markus Elfring
2015-06-27 21:23 ` [PATCH 2/2] drm/msm/dsi: One function call less in dsi_init() after error detection SF Markus Elfring
2015-06-28 8:45 ` [PATCH] drm/amdgpu: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
` (21 subsequent siblings)
34 siblings, 2 replies; 123+ messages in thread
From: SF Markus Elfring @ 2015-06-27 21:16 UTC (permalink / raw)
To: David Airlie, Hai Li, dri-devel
Cc: LKML, kernel-janitors, Rob Clark, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Further update suggestions were taken into account after a patch was applied
from static source code analysis.
Markus Elfring (2):
Delete an unnecessary check before the function call "dsi_destroy"
One function call less in dsi_init() after error detection
drivers/gpu/drm/msm/dsi/dsi.c | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
--
2.4.4
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH 1/2] drm/msm/dsi: Delete an unnecessary check before the function call "dsi_destroy"
2015-06-27 21:16 ` [PATCH 0/2] drm/msm/dsi: Deletion of an unnecessary check SF Markus Elfring
@ 2015-06-27 21:20 ` SF Markus Elfring
2015-06-27 21:23 ` [PATCH 2/2] drm/msm/dsi: One function call less in dsi_init() after error detection SF Markus Elfring
1 sibling, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2015-06-27 21:20 UTC (permalink / raw)
To: David Airlie, Hai Li, dri-devel
Cc: LKML, kernel-janitors, Rob Clark, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 27 Jun 2015 22:05:31 +0200
The dsi_destroy() function tests whether its argument is NULL and then
returns 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/gpu/drm/msm/dsi/dsi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 1f2561e..dc4f38f 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -110,9 +110,7 @@ static struct msm_dsi *dsi_init(struct platform_device *pdev)
return msm_dsi;
fail:
- if (msm_dsi)
- dsi_destroy(msm_dsi);
-
+ dsi_destroy(msm_dsi);
return ERR_PTR(ret);
}
--
2.4.4
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 2/2] drm/msm/dsi: One function call less in dsi_init() after error detection
2015-06-27 21:16 ` [PATCH 0/2] drm/msm/dsi: Deletion of an unnecessary check SF Markus Elfring
2015-06-27 21:20 ` [PATCH 1/2] drm/msm/dsi: Delete an unnecessary check before the function call "dsi_destroy" SF Markus Elfring
@ 2015-06-27 21:23 ` SF Markus Elfring
1 sibling, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2015-06-27 21:23 UTC (permalink / raw)
To: David Airlie, Hai Li, dri-devel
Cc: LKML, kernel-janitors, Rob Clark, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 27 Jun 2015 22:23:28 +0200
The dsi_destroy() function was called in two cases by the dsi_init() function
during error handling even if the passed variable contained a null pointer.
* This implementation detail could be improved by adjustments for jump
targets according to the Linux coding style convention.
* Drop an unnecessary initialisation for the variable "msm_dsi" then.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/msm/dsi/dsi.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index dc4f38f..971f000 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -74,19 +74,15 @@ static void dsi_destroy(struct msm_dsi *msm_dsi)
static struct msm_dsi *dsi_init(struct platform_device *pdev)
{
- struct msm_dsi *msm_dsi = NULL;
+ struct msm_dsi *msm_dsi;
int ret;
- if (!pdev) {
- ret = -ENXIO;
- goto fail;
- }
+ if (!pdev)
+ return -ENXIO;
msm_dsi = devm_kzalloc(&pdev->dev, sizeof(*msm_dsi), GFP_KERNEL);
- if (!msm_dsi) {
- ret = -ENOMEM;
- goto fail;
- }
+ if (!msm_dsi)
+ return -ENOMEM;
DBG("dsi probed=%p", msm_dsi);
msm_dsi->pdev = pdev;
@@ -95,21 +91,21 @@ static struct msm_dsi *dsi_init(struct platform_device *pdev)
/* Init dsi host */
ret = msm_dsi_host_init(msm_dsi);
if (ret)
- goto fail;
+ goto destroy_dsi;
/* GET dsi PHY */
ret = dsi_get_phy(msm_dsi);
if (ret)
- goto fail;
+ goto destroy_dsi;
/* Register to dsi manager */
ret = msm_dsi_manager_register(msm_dsi);
if (ret)
- goto fail;
+ goto destroy_dsi;
return msm_dsi;
-fail:
+destroy_dsi:
dsi_destroy(msm_dsi);
return ERR_PTR(ret);
}
--
2.4.4
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] drm/amdgpu: Delete an unnecessary check before the function call "kfree"
[not found] ` <5317A59D.4@users.sourceforge.net>
` (12 preceding siblings ...)
2015-06-27 21:16 ` [PATCH 0/2] drm/msm/dsi: Deletion of an unnecessary check SF Markus Elfring
@ 2015-06-28 8:45 ` SF Markus Elfring
2015-06-29 15:30 ` Alex Deucher
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
2015-07-05 20:00 ` [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob() SF Markus Elfring
` (20 subsequent siblings)
34 siblings, 2 replies; 123+ messages in thread
From: SF Markus Elfring @ 2015-06-28 8:45 UTC (permalink / raw)
To: Alex Deucher, David Airlie, dri-devel; +Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 28 Jun 2015 10:27:35 +0200
The kfree() function tests whether its argument is NULL and then
returns 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/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index fec487d..a85cd08 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1575,8 +1575,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
amdgpu_fence_driver_fini(adev);
amdgpu_fbdev_fini(adev);
r = amdgpu_fini(adev);
- if (adev->ip_block_enabled)
- kfree(adev->ip_block_enabled);
+ kfree(adev->ip_block_enabled);
adev->ip_block_enabled = NULL;
adev->accel_working = false;
/* free i2c buses */
--
2.4.4
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH] drm/amdgpu: Delete an unnecessary check before the function call "kfree"
2015-06-28 8:45 ` [PATCH] drm/amdgpu: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
@ 2015-06-29 15:30 ` Alex Deucher
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
1 sibling, 0 replies; 123+ messages in thread
From: Alex Deucher @ 2015-06-29 15:30 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Alex Deucher, David Airlie, Maling list - DRI developers,
Julia Lawall, kernel-janitors, LKML
On Sun, Jun 28, 2015 at 4:45 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 28 Jun 2015 10:27:35 +0200
>
> The kfree() function tests whether its argument is NULL and then
> returns 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>
I already have the same patch from Maninder Singh.
Thanks!
Alex
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index fec487d..a85cd08 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1575,8 +1575,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
> amdgpu_fence_driver_fini(adev);
> amdgpu_fbdev_fini(adev);
> r = amdgpu_fini(adev);
> - if (adev->ip_block_enabled)
> - kfree(adev->ip_block_enabled);
> + kfree(adev->ip_block_enabled);
> adev->ip_block_enabled = NULL;
> adev->accel_working = false;
> /* free i2c buses */
> --
> 2.4.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM-nouveau: Delete unnecessary checks before two function calls
2014-10-22 14:30 ` [PATCH 1/1] GPU-DRM-nouveau: Deletion of unnecessary checks before two function calls SF Markus Elfring
@ 2015-07-05 18:22 ` SF Markus Elfring
2016-07-20 17:50 ` [PATCH] GPU-DRM-nouveau: Delete an unnecessary check before the function call "pci_dev_put" SF Markus Elfring
0 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-07-05 18:22 UTC (permalink / raw)
To: David Airlie, dri-devel
Cc: Linux Kernel Mailing List, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 5 Jul 2015 20:15:12 +0200
The functions nvkm_namedb_put() and pci_dev_put() test whether their
argument is NULL and then return immediately.
Thus the test around the 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/nouveau/nouveau_drm.c | 3 +--
drivers/gpu/drm/nouveau/nvkm/core/handle.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 36b40c9..8ca3d0c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -515,8 +515,7 @@ nouveau_drm_unload(struct drm_device *dev)
nouveau_vga_fini(drm);
nvif_device_fini(&drm->device);
- if (drm->hdmi_device)
- pci_dev_put(drm->hdmi_device);
+ pci_dev_put(drm->hdmi_device);
nouveau_cli_destroy(&drm->client);
return 0;
}
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/handle.c b/drivers/gpu/drm/nouveau/nvkm/core/handle.c
index dc7ff10..165f3ff 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/handle.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/handle.c
@@ -216,6 +216,5 @@ nvkm_handle_get_cinst(struct nvkm_object *engctx, u32 cinst)
void
nvkm_handle_put(struct nvkm_handle *handle)
{
- if (handle)
- nvkm_namedb_put(handle);
+ nvkm_namedb_put(handle);
}
--
2.4.5
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (13 preceding siblings ...)
2015-06-28 8:45 ` [PATCH] drm/amdgpu: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
@ 2015-07-05 20:00 ` SF Markus Elfring
2015-07-06 2:01 ` John Hunter
2015-07-05 20:50 ` [PATCH] GPU-DRM-IMX: Delete an unnecessary check before drm_fbdev_cma_restore_mode() SF Markus Elfring
` (19 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-07-05 20:00 UTC (permalink / raw)
To: David Airlie, dri-devel
Cc: Linux Kernel Mailing List, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 5 Jul 2015 21:55:10 +0200
The drm_property_unreference_blob() function tests whether its argument
is NULL and then returns 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/gpu/drm/drm_crtc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 2d57fc5..6e4c8b0 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -4469,9 +4469,7 @@ static int drm_property_replace_global_blob(struct drm_device *dev,
goto err_created;
}
- if (old_blob)
- drm_property_unreference_blob(old_blob);
-
+ drm_property_unreference_blob(old_blob);
*replace = new_blob;
return 0;
--
2.4.5
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM-IMX: Delete an unnecessary check before drm_fbdev_cma_restore_mode()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (14 preceding siblings ...)
2015-07-05 20:00 ` [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob() SF Markus Elfring
@ 2015-07-05 20:50 ` SF Markus Elfring
2015-11-20 12:53 ` Philipp Zabel
2015-11-06 12:43 ` [PATCH] GPU-DRM-i915: Delete an unnecessary check before the function call "pwm_put" SF Markus Elfring
` (18 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-07-05 20:50 UTC (permalink / raw)
To: David Airlie, Philipp Zabel, dri-devel
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 5 Jul 2015 22:45:23 +0200
The drm_fbdev_cma_restore_mode() function tests whether its argument
is NULL and then returns 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/gpu/drm/imx/imx-drm-core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 74f505b..9172c0e 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -63,8 +63,7 @@ static void imx_drm_driver_lastclose(struct drm_device *drm)
#if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
struct imx_drm_device *imxdrm = drm->dev_private;
- if (imxdrm->fbhelper)
- drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
+ drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
#endif
}
--
2.4.5
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()
2015-07-05 20:00 ` [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob() SF Markus Elfring
@ 2015-07-06 2:01 ` John Hunter
2015-07-06 6:53 ` Daniel Vetter
0 siblings, 1 reply; 123+ messages in thread
From: John Hunter @ 2015-07-06 2:01 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Julia Lawall, kernel-janitors, Linux Kernel Mailing List,
dri-devel@lists.freedesktop.org
[-- Attachment #1.1: Type: text/plain, Size: 1481 bytes --]
On Mon, Jul 6, 2015 at 4:00 AM, SF Markus Elfring <
elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 5 Jul 2015 21:55:10 +0200
>
> The drm_property_unreference_blob() function tests whether its argument
> is NULL and then returns 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>
>
Reviewed-by: Zhao Junwang <zhjwpku@gmail.com>
> ---
> drivers/gpu/drm/drm_crtc.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 2d57fc5..6e4c8b0 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -4469,9 +4469,7 @@ static int drm_property_replace_global_blob(struct
> drm_device *dev,
> goto err_created;
> }
>
> - if (old_blob)
> - drm_property_unreference_blob(old_blob);
> -
> + drm_property_unreference_blob(old_blob);
> *replace = new_blob;
>
> return 0;
> --
> 2.4.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
--
Best regards
Junwang Zhao
Microprocessor Research and Develop Center
Department of Computer Science &Technology
Peking University
Beijing, 100871, PRC
[-- Attachment #1.2: Type: text/html, Size: 2610 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()
2015-07-06 2:01 ` John Hunter
@ 2015-07-06 6:53 ` Daniel Vetter
2015-11-06 11:13 ` [PATCH] GPU-DRM: Delete unnecessary checks " SF Markus Elfring
0 siblings, 1 reply; 123+ messages in thread
From: Daniel Vetter @ 2015-07-06 6:53 UTC (permalink / raw)
To: John Hunter
Cc: SF Markus Elfring, Julia Lawall, kernel-janitors,
Linux Kernel Mailing List, dri-devel@lists.freedesktop.org
On Mon, Jul 06, 2015 at 10:01:52AM +0800, John Hunter wrote:
> On Mon, Jul 6, 2015 at 4:00 AM, SF Markus Elfring <
> elfring@users.sourceforge.net> wrote:
>
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Sun, 5 Jul 2015 21:55:10 +0200
> >
> > The drm_property_unreference_blob() function tests whether its argument
> > is NULL and then returns 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>
> >
>
> Reviewed-by: Zhao Junwang <zhjwpku@gmail.com>
Applied to topic/drm-misc, thanks.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree"
2014-11-19 16:55 ` [PATCH 1/1] DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree" SF Markus Elfring
2014-11-20 4:22 ` Thierry Reding
@ 2015-07-06 8:01 ` SF Markus Elfring
2015-07-08 5:49 ` John Hunter
2016-07-22 11:45 ` [PATCH] drm/vmwgfx: Delete " SF Markus Elfring
1 sibling, 2 replies; 123+ messages in thread
From: SF Markus Elfring @ 2015-07-06 8:01 UTC (permalink / raw)
To: David Airlie, dri-devel; +Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 6 Jul 2015 09:49:11 +0200
The vfree() 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/vmwgfx/vmwgfx_execbuf.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
index 654c8da..f718a6d 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
@@ -2292,9 +2292,7 @@ static int vmw_resize_cmd_bounce(struct vmw_sw_context *sw_context,
(sw_context->cmd_bounce_size >> 1));
}
- if (sw_context->cmd_bounce != NULL)
- vfree(sw_context->cmd_bounce);
-
+ vfree(sw_context->cmd_bounce);
sw_context->cmd_bounce = vmalloc(sw_context->cmd_bounce_size);
if (sw_context->cmd_bounce == NULL) {
--
2.4.5
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH 1/1] DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree"
2015-07-06 8:01 ` SF Markus Elfring
@ 2015-07-08 5:49 ` John Hunter
2015-07-08 16:55 ` SF Markus Elfring
2016-07-22 11:45 ` [PATCH] drm/vmwgfx: Delete " SF Markus Elfring
1 sibling, 1 reply; 123+ messages in thread
From: John Hunter @ 2015-07-08 5:49 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Julia Lawall, kernel-janitors, LKML,
dri-devel@lists.freedesktop.org
[-- Attachment #1.1: Type: text/plain, Size: 1625 bytes --]
On Mon, Jul 6, 2015 at 4:01 PM, SF Markus Elfring <
elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 6 Jul 2015 09:49:11 +0200
>
> The vfree() 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>
>
Reviewed-by: Zhao Junwang <zhjwpku@gmail.com>
kfree will check that.
> ---
> drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> index 654c8da..f718a6d 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> @@ -2292,9 +2292,7 @@ static int vmw_resize_cmd_bounce(struct
> vmw_sw_context *sw_context,
> (sw_context->cmd_bounce_size >> 1));
> }
>
> - if (sw_context->cmd_bounce != NULL)
> - vfree(sw_context->cmd_bounce);
> -
> + vfree(sw_context->cmd_bounce);
> sw_context->cmd_bounce = vmalloc(sw_context->cmd_bounce_size);
>
> if (sw_context->cmd_bounce == NULL) {
> --
> 2.4.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
--
Best regards
Junwang Zhao
Microprocessor Research and Develop Center
Department of Computer Science &Technology
Peking University
Beijing, 100871, PRC
[-- Attachment #1.2: Type: text/html, Size: 2806 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree"
2015-07-08 5:49 ` John Hunter
@ 2015-07-08 16:55 ` SF Markus Elfring
2015-07-09 0:08 ` John Hunter
0 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-07-08 16:55 UTC (permalink / raw)
To: Zhao Junwang
Cc: David Airlie, dri-devel@lists.freedesktop.org, Julia Lawall,
kernel-janitors, LKML
> Reviewed-by: Zhao Junwang <zhjwpku@gmail.com>
>
> kfree will check that.
How does this feedback fit to a check before a call
of the vfree() function?
Regards,
Markus
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH] GPU-DRM-Tegra: Delete an unnecessary check before the function call "vunmap"
2015-02-05 9:20 ` [PATCH] GPU-DRM-Tegra: Delete an unnecessary check before the function call "vunmap" SF Markus Elfring
@ 2015-07-08 18:40 ` SF Markus Elfring
2015-07-13 14:16 ` Alexandre Courbot
0 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-07-08 18:40 UTC (permalink / raw)
To: Alexandre Courbot, David Airlie, Stephen Warren,
Terje Bergström, Thierry Reding, dri-devel, linux-tegra
Cc: LKML, kernel-janitors, Julia Lawall
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 5 Feb 2015 10:12:51 +0100
>
> 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/tegra/fb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c
> index e9c715d..803598e 100644
> --- a/drivers/gpu/drm/tegra/fb.c
> +++ b/drivers/gpu/drm/tegra/fb.c
> @@ -66,7 +66,7 @@ static void tegra_fb_destroy(struct drm_framebuffer *framebuffer)
> struct tegra_bo *bo = fb->planes[i];
>
> if (bo) {
> - if (bo->pages && bo->vaddr)
> + if (bo->pages)
> vunmap(bo->vaddr);
>
> drm_gem_object_unreference_unlocked(&bo->gem);
>
Would you like to integrate this update suggestion
into another source code repository?
Regards,
Markus
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree"
2015-07-08 16:55 ` SF Markus Elfring
@ 2015-07-09 0:08 ` John Hunter
0 siblings, 0 replies; 123+ messages in thread
From: John Hunter @ 2015-07-09 0:08 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Julia Lawall, kernel-janitors, LKML,
dri-devel@lists.freedesktop.org
[-- Attachment #1.1: Type: text/plain, Size: 609 bytes --]
On Thu, Jul 9, 2015 at 12:55 AM, SF Markus Elfring <
elfring@users.sourceforge.net> wrote:
> > Reviewed-by: Zhao Junwang <zhjwpku@gmail.com>
> >
> > kfree will check that.
>
> How does this feedback fit to a check before a call
> of the vfree() function?
>
> I might have made a mistake, the ctl^] lead me to the vfree in mm/nommu.c,
there is also a vfree() function in mm/vmalloc.c.
Anyway, I think the catch is reasonable.
> Regards,
> Markus
>
--
Best regards
Junwang Zhao
Microprocessor Research and Develop Center
Department of Computer Science &Technology
Peking University
Beijing, 100871, PRC
[-- Attachment #1.2: Type: text/html, Size: 1324 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH] GPU-DRM-Tegra: Delete an unnecessary check before the function call "vunmap"
2015-07-08 18:40 ` SF Markus Elfring
@ 2015-07-13 14:16 ` Alexandre Courbot
2016-07-16 5:30 ` [PATCH] drm/tegra: " SF Markus Elfring
0 siblings, 1 reply; 123+ messages in thread
From: Alexandre Courbot @ 2015-07-13 14:16 UTC (permalink / raw)
To: SF Markus Elfring, Thierry Reding
Cc: Terje Bergström, Stephen Warren, kernel-janitors, LKML,
dri-devel@lists.freedesktop.org, Julia Lawall,
linux-tegra@vger.kernel.org
On Thu, Jul 9, 2015 at 3:40 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
>> From: Markus Elfring <elfring@users.sourceforge.net>
>> Date: Thu, 5 Feb 2015 10:12:51 +0100
>>
>> 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.
The fix is correct, but the subject looks weird.
"GPU-DRM-Tegra:"should be "drm/tegra:".
Otherwise,
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Maybe Thierry can take it through his tree once this issue is addressed?
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM: Delete unnecessary checks before drm_property_unreference_blob()
2015-07-06 6:53 ` Daniel Vetter
@ 2015-11-06 11:13 ` SF Markus Elfring
2015-11-16 14:04 ` Daniel Vetter
0 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-11-06 11:13 UTC (permalink / raw)
To: Daniel Vetter, David Airlie, dri-devel
Cc: LKML, kernel-janitors, Julia Lawall, Junwang Zhao
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 6 Nov 2015 12:03:46 +0100
The drm_property_unreference_blob() function tests whether its argument
is NULL and then returns immediately.
Thus the tests around the calls are not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/drm_atomic.c | 9 +++------
drivers/gpu/drm/drm_atomic_helper.c | 5 ++---
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 7bb3845..d65dc31 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -316,8 +316,7 @@ int drm_atomic_set_mode_for_crtc(struct drm_crtc_state *state,
if (mode && memcmp(&state->mode, mode, sizeof(*mode)) == 0)
return 0;
- if (state->mode_blob)
- drm_property_unreference_blob(state->mode_blob);
+ drm_property_unreference_blob(state->mode_blob);
state->mode_blob = NULL;
if (mode) {
@@ -363,8 +362,7 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state,
if (blob == state->mode_blob)
return 0;
- if (state->mode_blob)
- drm_property_unreference_blob(state->mode_blob);
+ drm_property_unreference_blob(state->mode_blob);
state->mode_blob = NULL;
if (blob) {
@@ -419,8 +417,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
struct drm_property_blob *mode =
drm_property_lookup_blob(dev, val);
ret = drm_atomic_set_mode_prop_for_crtc(state, mode);
- if (mode)
- drm_property_unreference_blob(mode);
+ drm_property_unreference_blob(mode);
return ret;
}
else if (crtc->funcs->atomic_set_property)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 0c6f621..9870c70 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2173,7 +2173,7 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_dpms);
*/
void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc)
{
- if (crtc->state && crtc->state->mode_blob)
+ if (crtc->state)
drm_property_unreference_blob(crtc->state->mode_blob);
kfree(crtc->state);
crtc->state = kzalloc(sizeof(*crtc->state), GFP_KERNEL);
@@ -2241,8 +2241,7 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_duplicate_state);
void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
struct drm_crtc_state *state)
{
- if (state->mode_blob)
- drm_property_unreference_blob(state->mode_blob);
+ drm_property_unreference_blob(state->mode_blob);
}
EXPORT_SYMBOL(__drm_atomic_helper_crtc_destroy_state);
--
2.6.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM-i915: Delete an unnecessary check before the function call "pwm_put"
[not found] ` <5317A59D.4@users.sourceforge.net>
` (15 preceding siblings ...)
2015-07-05 20:50 ` [PATCH] GPU-DRM-IMX: Delete an unnecessary check before drm_fbdev_cma_restore_mode() SF Markus Elfring
@ 2015-11-06 12:43 ` SF Markus Elfring
2015-11-06 12:52 ` Jani Nikula
2015-11-06 13:45 ` [PATCH] GPU-DRM-ps8622: Delete an unnecessary check before backlight_device_unregister() SF Markus Elfring
` (17 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-11-06 12:43 UTC (permalink / raw)
To: Daniel Vetter, David Airlie, Jani Nikula, intel-gfx, dri-devel
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 6 Nov 2015 13:38:22 +0100
The pwm_put() function tests whether its argument is NULL and then
returns 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/gpu/drm/i915/intel_panel.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index a24df35..3d8d913 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -1729,8 +1729,7 @@ void intel_panel_destroy_backlight(struct drm_connector *connector)
struct intel_panel *panel = &intel_connector->panel;
/* dispose of the pwm */
- if (panel->backlight.pwm)
- pwm_put(panel->backlight.pwm);
+ pwm_put(panel->backlight.pwm);
panel->backlight.present = false;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH] GPU-DRM-i915: Delete an unnecessary check before the function call "pwm_put"
2015-11-06 12:43 ` [PATCH] GPU-DRM-i915: Delete an unnecessary check before the function call "pwm_put" SF Markus Elfring
@ 2015-11-06 12:52 ` Jani Nikula
2015-11-06 12:55 ` SF Markus Elfring
0 siblings, 1 reply; 123+ messages in thread
From: Jani Nikula @ 2015-11-06 12:52 UTC (permalink / raw)
To: SF Markus Elfring, Daniel Vetter, David Airlie, intel-gfx,
dri-devel
Cc: Julia Lawall, kernel-janitors, LKML
On Fri, 06 Nov 2015, SF Markus Elfring <elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 6 Nov 2015 13:38:22 +0100
>
> The pwm_put() function tests whether its argument is NULL and then
> returns immediately. Thus the test around the call is not needed.
The compiler doesn't need it, but IMO it's useful documentation for
humans.
BR,
Jani.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/gpu/drm/i915/intel_panel.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> index a24df35..3d8d913 100644
> --- a/drivers/gpu/drm/i915/intel_panel.c
> +++ b/drivers/gpu/drm/i915/intel_panel.c
> @@ -1729,8 +1729,7 @@ void intel_panel_destroy_backlight(struct drm_connector *connector)
> struct intel_panel *panel = &intel_connector->panel;
>
> /* dispose of the pwm */
> - if (panel->backlight.pwm)
> - pwm_put(panel->backlight.pwm);
> + pwm_put(panel->backlight.pwm);
>
> panel->backlight.present = false;
> }
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: GPU-DRM-i915: Delete an unnecessary check before the function call "pwm_put"
2015-11-06 12:52 ` Jani Nikula
@ 2015-11-06 12:55 ` SF Markus Elfring
2015-11-06 13:17 ` Jani Nikula
0 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-11-06 12:55 UTC (permalink / raw)
To: Jani Nikula, Daniel Vetter, David Airlie, intel-gfx, dri-devel
Cc: LKML, kernel-janitors, Julia Lawall
>> The pwm_put() function tests whether its argument is NULL and then
>> returns immediately. Thus the test around the call is not needed.
>
> The compiler doesn't need it, but IMO it's useful documentation for humans.
How do you think about to extend the explicit documentation for
the affected parameters in the Linux programming interfaces?
Regards,
Markus
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: GPU-DRM-i915: Delete an unnecessary check before the function call "pwm_put"
2015-11-06 12:55 ` SF Markus Elfring
@ 2015-11-06 13:17 ` Jani Nikula
0 siblings, 0 replies; 123+ messages in thread
From: Jani Nikula @ 2015-11-06 13:17 UTC (permalink / raw)
To: SF Markus Elfring, Daniel Vetter, David Airlie, intel-gfx,
dri-devel
Cc: Julia Lawall, kernel-janitors, LKML
On Fri, 06 Nov 2015, SF Markus Elfring <elfring@users.sourceforge.net> wrote:
>>> The pwm_put() function tests whether its argument is NULL and then
>>> returns immediately. Thus the test around the call is not needed.
>>
>> The compiler doesn't need it, but IMO it's useful documentation for humans.
>
> How do you think about to extend the explicit documentation for
> the affected parameters in the Linux programming interfaces?
The question is, while reading intel_panel.c, which one conveys the
reader better the idea that panel->backlight.pwm may be NULL for some
connectors:
a) if (panel->backlight.pwm)
pwm_put(panel->backlight.pwm);
b) pwm_put(panel->backlight.pwm);
No amount of documentation in pwm_put() kernel-doc is going to help with
that. In most cases, panel->backlight.pwm is in fact NULL. IMO
unconditionally calling pwm_put() on it gives the reader the wrong idea.
Others may disagree.
BR,
Jani.
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM-ps8622: Delete an unnecessary check before backlight_device_unregister()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (16 preceding siblings ...)
2015-11-06 12:43 ` [PATCH] GPU-DRM-i915: Delete an unnecessary check before the function call "pwm_put" SF Markus Elfring
@ 2015-11-06 13:45 ` SF Markus Elfring
2015-11-06 14:05 ` [PATCH] HDMI-HDCP: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
` (16 subsequent siblings)
34 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2015-11-06 13:45 UTC (permalink / raw)
To: David Airlie, dri-devel; +Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 6 Nov 2015 14:38:34 +0100
The backlight_device_unregister() function tests whether its argument is NULL
and then returns 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/gpu/drm/bridge/parade-ps8622.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c
index be881e9..046fba0 100644
--- a/drivers/gpu/drm/bridge/parade-ps8622.c
+++ b/drivers/gpu/drm/bridge/parade-ps8622.c
@@ -646,9 +646,7 @@ static int ps8622_remove(struct i2c_client *client)
{
struct ps8622_bridge *ps8622 = i2c_get_clientdata(client);
- if (ps8622->bl)
- backlight_device_unregister(ps8622->bl);
-
+ backlight_device_unregister(ps8622->bl);
drm_bridge_remove(&ps8622->bridge);
return 0;
--
2.6.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] HDMI-HDCP: Delete an unnecessary check before the function call "kfree"
[not found] ` <5317A59D.4@users.sourceforge.net>
` (17 preceding siblings ...)
2015-11-06 13:45 ` [PATCH] GPU-DRM-ps8622: Delete an unnecessary check before backlight_device_unregister() SF Markus Elfring
@ 2015-11-06 14:05 ` SF Markus Elfring
2015-11-06 15:08 ` [PATCH] GPU-DRM-vc4: Delete unnecessary checks before two function calls SF Markus Elfring
` (15 subsequent siblings)
34 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2015-11-06 14:05 UTC (permalink / raw)
To: David Airlie, dri-devel
Cc: Linux Kernel Mailing List, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 6 Nov 2015 15:00:22 +0100
The kfree() function tests whether its argument is NULL and then
returns 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/gpu/drm/msm/hdmi/hdmi_hdcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c
index 1dc9c34..205e931 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c
@@ -1430,7 +1430,7 @@ struct hdmi_hdcp_ctrl *hdmi_hdcp_init(struct hdmi *hdmi)
void hdmi_hdcp_destroy(struct hdmi *hdmi)
{
- if (hdmi && hdmi->hdcp_ctrl) {
+ if (hdmi) {
kfree(hdmi->hdcp_ctrl);
hdmi->hdcp_ctrl = NULL;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM-vc4: Delete unnecessary checks before two function calls
[not found] ` <5317A59D.4@users.sourceforge.net>
` (18 preceding siblings ...)
2015-11-06 14:05 ` [PATCH] HDMI-HDCP: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
@ 2015-11-06 15:08 ` SF Markus Elfring
2016-07-15 19:21 ` [PATCH] drm/vc4: " SF Markus Elfring
2015-11-16 14:45 ` [PATCH] GPU-DRM-TTM: Delete an unnecessary check before the function call "ttm_tt_destroy" SF Markus Elfring
` (14 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-11-06 15:08 UTC (permalink / raw)
To: dri-devel, David Airlie
Cc: Linux Kernel Mailing List, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 6 Nov 2015 16:04:22 +0100
The following functions test whether their argument is NULL and then
return immediately.
* drm_fbdev_cma_hotplug_event
* drm_fbdev_cma_restore_mode
Thus the tests around their calls are not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/vc4/vc4_drv.c | 3 +--
drivers/gpu/drm/vc4/vc4_kms.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index 6e73060..df348c0 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -54,8 +54,7 @@ static void vc4_lastclose(struct drm_device *dev)
{
struct vc4_dev *vc4 = to_vc4_dev(dev);
- if (vc4->fbdev)
- drm_fbdev_cma_restore_mode(vc4->fbdev);
+ drm_fbdev_cma_restore_mode(vc4->fbdev);
}
static const struct file_operations vc4_drm_fops = {
diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
index 2e5597d..1778203 100644
--- a/drivers/gpu/drm/vc4/vc4_kms.c
+++ b/drivers/gpu/drm/vc4/vc4_kms.c
@@ -25,8 +25,7 @@ static void vc4_output_poll_changed(struct drm_device *dev)
{
struct vc4_dev *vc4 = to_vc4_dev(dev);
- if (vc4->fbdev)
- drm_fbdev_cma_hotplug_event(vc4->fbdev);
+ drm_fbdev_cma_hotplug_event(vc4->fbdev);
}
static const struct drm_mode_config_funcs vc4_mode_funcs = {
--
2.6.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH] GPU-DRM: Delete unnecessary checks before drm_property_unreference_blob()
2015-11-06 11:13 ` [PATCH] GPU-DRM: Delete unnecessary checks " SF Markus Elfring
@ 2015-11-16 14:04 ` Daniel Vetter
2016-07-20 16:02 ` [PATCH] drm/atomic: Delete an unnecessary check " SF Markus Elfring
0 siblings, 1 reply; 123+ messages in thread
From: Daniel Vetter @ 2015-11-16 14:04 UTC (permalink / raw)
To: SF Markus Elfring
Cc: kernel-janitors, LKML, dri-devel, Julia Lawall, Junwang Zhao
On Fri, Nov 06, 2015 at 12:13:02PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 6 Nov 2015 12:03:46 +0100
>
> The drm_property_unreference_blob() function tests whether its argument
> is NULL and then returns immediately.
> Thus the tests around the calls are not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Applied to drm-misc, thanks.
-Daniel
> ---
> drivers/gpu/drm/drm_atomic.c | 9 +++------
> drivers/gpu/drm/drm_atomic_helper.c | 5 ++---
> 2 files changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 7bb3845..d65dc31 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -316,8 +316,7 @@ int drm_atomic_set_mode_for_crtc(struct drm_crtc_state *state,
> if (mode && memcmp(&state->mode, mode, sizeof(*mode)) == 0)
> return 0;
>
> - if (state->mode_blob)
> - drm_property_unreference_blob(state->mode_blob);
> + drm_property_unreference_blob(state->mode_blob);
> state->mode_blob = NULL;
>
> if (mode) {
> @@ -363,8 +362,7 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state,
> if (blob == state->mode_blob)
> return 0;
>
> - if (state->mode_blob)
> - drm_property_unreference_blob(state->mode_blob);
> + drm_property_unreference_blob(state->mode_blob);
> state->mode_blob = NULL;
>
> if (blob) {
> @@ -419,8 +417,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
> struct drm_property_blob *mode =
> drm_property_lookup_blob(dev, val);
> ret = drm_atomic_set_mode_prop_for_crtc(state, mode);
> - if (mode)
> - drm_property_unreference_blob(mode);
> + drm_property_unreference_blob(mode);
> return ret;
> }
> else if (crtc->funcs->atomic_set_property)
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 0c6f621..9870c70 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2173,7 +2173,7 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_dpms);
> */
> void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc)
> {
> - if (crtc->state && crtc->state->mode_blob)
> + if (crtc->state)
> drm_property_unreference_blob(crtc->state->mode_blob);
> kfree(crtc->state);
> crtc->state = kzalloc(sizeof(*crtc->state), GFP_KERNEL);
> @@ -2241,8 +2241,7 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_duplicate_state);
> void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
> struct drm_crtc_state *state)
> {
> - if (state->mode_blob)
> - drm_property_unreference_blob(state->mode_blob);
> + drm_property_unreference_blob(state->mode_blob);
> }
> EXPORT_SYMBOL(__drm_atomic_helper_crtc_destroy_state);
>
> --
> 2.6.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM-TTM: Delete an unnecessary check before the function call "ttm_tt_destroy"
[not found] ` <5317A59D.4@users.sourceforge.net>
` (19 preceding siblings ...)
2015-11-06 15:08 ` [PATCH] GPU-DRM-vc4: Delete unnecessary checks before two function calls SF Markus Elfring
@ 2015-11-16 14:45 ` SF Markus Elfring
2016-07-15 18:28 ` [PATCH] drm/ttm: " SF Markus Elfring
2016-07-12 20:22 ` [PATCH] GPU-DRM-Radeon: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
` (13 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2015-11-16 14:45 UTC (permalink / raw)
To: dri-devel, David Airlie; +Cc: Julia Lawall, kernel-janitors, linux-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 16 Nov 2015 15:40:58 +0100
The ttm_tt_destroy() function tests whether its argument is NULL
and then returns 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/gpu/drm/ttm/ttm_bo.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 745e996..d6736e6 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -147,8 +147,7 @@ static void ttm_bo_release_list(struct kref *list_kref)
BUG_ON(!list_empty(&bo->lru));
BUG_ON(!list_empty(&bo->ddestroy));
- if (bo->ttm)
- ttm_tt_destroy(bo->ttm);
+ ttm_tt_destroy(bo->ttm);
atomic_dec(&bo->glob->bo_count);
if (bo->resv == &bo->ttm_resv)
reservation_object_fini(&bo->ttm_resv);
--
2.6.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH] GPU-DRM-IMX: Delete an unnecessary check before drm_fbdev_cma_restore_mode()
2015-07-05 20:50 ` [PATCH] GPU-DRM-IMX: Delete an unnecessary check before drm_fbdev_cma_restore_mode() SF Markus Elfring
@ 2015-11-20 12:53 ` Philipp Zabel
0 siblings, 0 replies; 123+ messages in thread
From: Philipp Zabel @ 2015-11-20 12:53 UTC (permalink / raw)
To: SF Markus Elfring; +Cc: Julia Lawall, kernel-janitors, LKML, dri-devel
Am Sonntag, den 05.07.2015, 22:50 +0200 schrieb SF Markus Elfring:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 5 Jul 2015 22:45:23 +0200
>
> The drm_fbdev_cma_restore_mode() function tests whether its argument
> is NULL and then returns 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/gpu/drm/imx/imx-drm-core.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
> index 74f505b..9172c0e 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -63,8 +63,7 @@ static void imx_drm_driver_lastclose(struct drm_device *drm)
> #if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
> struct imx_drm_device *imxdrm = drm->dev_private;
>
> - if (imxdrm->fbhelper)
> - drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
> + drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
> #endif
> }
>
Applied, sorry I missed this before.
regards
Philipp
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM-Radeon: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (20 preceding siblings ...)
2015-11-16 14:45 ` [PATCH] GPU-DRM-TTM: Delete an unnecessary check before the function call "ttm_tt_destroy" SF Markus Elfring
@ 2016-07-12 20:22 ` SF Markus Elfring
2016-07-28 15:58 ` Alex Deucher
2016-07-13 17:54 ` [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks SF Markus Elfring
` (12 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-12 20:22 UTC (permalink / raw)
To: Alex Deucher, Christian König, David Airlie, dri-devel
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 12 Jul 2016 22:00:55 +0200
The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns 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/gpu/drm/radeon/radeon_display.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 5f1cd69..1efab5f 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -1324,9 +1324,7 @@ static void radeon_user_framebuffer_destroy(struct drm_framebuffer *fb)
{
struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb);
- if (radeon_fb->obj) {
- drm_gem_object_unreference_unlocked(radeon_fb->obj);
- }
+ drm_gem_object_unreference_unlocked(radeon_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(radeon_fb);
}
--
2.9.0
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks
[not found] ` <5317A59D.4@users.sourceforge.net>
` (21 preceding siblings ...)
2016-07-12 20:22 ` [PATCH] GPU-DRM-Radeon: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
@ 2016-07-13 17:54 ` SF Markus Elfring
2016-07-13 18:00 ` [PATCH 1/3] drm/msm/hdmi: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
` (3 more replies)
2016-07-15 12:30 ` [PATCH] drm/bochs: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
` (11 subsequent siblings)
34 siblings, 4 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-13 17:54 UTC (permalink / raw)
To: David Airlie, Rob Clark, dri-devel, freedreno, linux-arm-msm
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 13 Jul 2016 19:46:45 +0200
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
HDMI: Delete an unnecessary check before the function call "kfree"
Delete unnecessary checks before drm_gem_object_unreference_unlocked()
Delete an unnecessary check before drm_gem_object_unreference()
drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c | 2 +-
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 3 +--
drivers/gpu/drm/msm/msm_fb.c | 4 ++--
drivers/gpu/drm/msm/msm_gem.c | 8 ++------
4 files changed, 6 insertions(+), 11 deletions(-)
--
2.9.0
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH 1/3] drm/msm/hdmi: Delete an unnecessary check before the function call "kfree"
2016-07-13 17:54 ` [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks SF Markus Elfring
@ 2016-07-13 18:00 ` SF Markus Elfring
2016-07-13 18:01 ` [PATCH 2/3] drm/msm: Delete unnecessary checks before drm_gem_object_unreference_unlocked() SF Markus Elfring
` (2 subsequent siblings)
3 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-13 18:00 UTC (permalink / raw)
To: David Airlie, Rob Clark, dri-devel, freedreno, linux-arm-msm
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 13 Jul 2016 18:54:11 +0200
The kfree() function tests whether its argument is NULL and then
returns 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/gpu/drm/msm/hdmi/hdmi_hdcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c
index 0baaaaa..6e76797 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c
@@ -1430,7 +1430,7 @@ struct hdmi_hdcp_ctrl *msm_hdmi_hdcp_init(struct hdmi *hdmi)
void msm_hdmi_hdcp_destroy(struct hdmi *hdmi)
{
- if (hdmi && hdmi->hdcp_ctrl) {
+ if (hdmi) {
kfree(hdmi->hdcp_ctrl);
hdmi->hdcp_ctrl = NULL;
}
--
2.9.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 2/3] drm/msm: Delete unnecessary checks before drm_gem_object_unreference_unlocked()
2016-07-13 17:54 ` [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks SF Markus Elfring
2016-07-13 18:00 ` [PATCH 1/3] drm/msm/hdmi: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
@ 2016-07-13 18:01 ` SF Markus Elfring
2016-07-13 18:02 ` [PATCH 3/3] drm/msm: Delete an unnecessary check before drm_gem_object_unreference() SF Markus Elfring
2016-07-15 2:08 ` [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks Rob Clark
3 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-13 18:01 UTC (permalink / raw)
To: David Airlie, Rob Clark, dri-devel, freedreno, linux-arm-msm
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 13 Jul 2016 19:15:35 +0200
The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns immediately.
Thus the test around the 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/msm/mdp/mdp4/mdp4_kms.c | 3 +--
drivers/gpu/drm/msm/msm_fb.c | 4 ++--
drivers/gpu/drm/msm/msm_gem.c | 4 +---
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
index ba8df15..7b39e89 100644
--- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
+++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
@@ -168,8 +168,7 @@ static void mdp4_destroy(struct msm_kms *kms)
if (mdp4_kms->blank_cursor_iova)
msm_gem_put_iova(mdp4_kms->blank_cursor_bo, mdp4_kms->id);
- if (mdp4_kms->blank_cursor_bo)
- drm_gem_object_unreference_unlocked(mdp4_kms->blank_cursor_bo);
+ drm_gem_object_unreference_unlocked(mdp4_kms->blank_cursor_bo);
if (mdp4_kms->rpm_enabled)
pm_runtime_disable(dev);
diff --git a/drivers/gpu/drm/msm/msm_fb.c b/drivers/gpu/drm/msm/msm_fb.c
index 7919c24..95cf8fe 100644
--- a/drivers/gpu/drm/msm/msm_fb.c
+++ b/drivers/gpu/drm/msm/msm_fb.c
@@ -49,8 +49,8 @@ static void msm_framebuffer_destroy(struct drm_framebuffer *fb)
for (i = 0; i < n; i++) {
struct drm_gem_object *bo = msm_fb->planes[i];
- if (bo)
- drm_gem_object_unreference_unlocked(bo);
+
+ drm_gem_object_unreference_unlocked(bo);
}
kfree(msm_fb);
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index 886cfe0..9a713fb 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -875,8 +875,6 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev,
return obj;
fail:
- if (obj)
- drm_gem_object_unreference_unlocked(obj);
-
+ drm_gem_object_unreference_unlocked(obj);
return ERR_PTR(ret);
}
--
2.9.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 3/3] drm/msm: Delete an unnecessary check before drm_gem_object_unreference()
2016-07-13 17:54 ` [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks SF Markus Elfring
2016-07-13 18:00 ` [PATCH 1/3] drm/msm/hdmi: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2016-07-13 18:01 ` [PATCH 2/3] drm/msm: Delete unnecessary checks before drm_gem_object_unreference_unlocked() SF Markus Elfring
@ 2016-07-13 18:02 ` SF Markus Elfring
2016-07-15 2:08 ` [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks Rob Clark
3 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-13 18:02 UTC (permalink / raw)
To: David Airlie, Rob Clark, dri-devel, freedreno, linux-arm-msm
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 13 Jul 2016 19:29:19 +0200
The drm_gem_object_unreference() function tests whether its argument
is NULL and then returns 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/gpu/drm/msm/msm_gem.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index 9a713fb..6cd4af4 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -830,9 +830,7 @@ struct drm_gem_object *msm_gem_new(struct drm_device *dev,
return obj;
fail:
- if (obj)
- drm_gem_object_unreference(obj);
-
+ drm_gem_object_unreference(obj);
return ERR_PTR(ret);
}
--
2.9.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks
2016-07-13 17:54 ` [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks SF Markus Elfring
` (2 preceding siblings ...)
2016-07-13 18:02 ` [PATCH 3/3] drm/msm: Delete an unnecessary check before drm_gem_object_unreference() SF Markus Elfring
@ 2016-07-15 2:08 ` Rob Clark
3 siblings, 0 replies; 123+ messages in thread
From: Rob Clark @ 2016-07-15 2:08 UTC (permalink / raw)
To: SF Markus Elfring
Cc: linux-arm-msm, kernel-janitors, LKML,
dri-devel@lists.freedesktop.org, Julia Lawall, freedreno
On Wed, Jul 13, 2016 at 1:54 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 13 Jul 2016 19:46:45 +0200
>
> A few update suggestions were taken into account
> from static source code analysis.
>
> Markus Elfring (3):
> HDMI: Delete an unnecessary check before the function call "kfree"
> Delete unnecessary checks before drm_gem_object_unreference_unlocked()
> Delete an unnecessary check before drm_gem_object_unreference()
thanks, I've pushed these to msm-next
BR,
-R
> drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c | 2 +-
> drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 3 +--
> drivers/gpu/drm/msm/msm_fb.c | 4 ++--
> drivers/gpu/drm/msm/msm_gem.c | 8 ++------
> 4 files changed, 6 insertions(+), 11 deletions(-)
>
> --
> 2.9.0
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH] drm/bochs: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (22 preceding siblings ...)
2016-07-13 17:54 ` [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks SF Markus Elfring
@ 2016-07-15 12:30 ` SF Markus Elfring
2016-07-15 13:35 ` [PATCH] drm/rockchip: " SF Markus Elfring
` (10 subsequent siblings)
34 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-15 12:30 UTC (permalink / raw)
To: David Airlie, Gerd Hoffmann, dri-devel
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 15 Jul 2016 14:23:15 +0200
The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns 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/gpu/drm/bochs/bochs_mm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
index 6cf912c..28a60a7 100644
--- a/drivers/gpu/drm/bochs/bochs_mm.c
+++ b/drivers/gpu/drm/bochs/bochs_mm.c
@@ -474,8 +474,8 @@ int bochs_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev,
static void bochs_user_framebuffer_destroy(struct drm_framebuffer *fb)
{
struct bochs_framebuffer *bochs_fb = to_bochs_framebuffer(fb);
- if (bochs_fb->obj)
- drm_gem_object_unreference_unlocked(bochs_fb->obj);
+
+ drm_gem_object_unreference_unlocked(bochs_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(fb);
}
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] drm/rockchip: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (23 preceding siblings ...)
2016-07-15 12:30 ` [PATCH] drm/bochs: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
@ 2016-07-15 13:35 ` SF Markus Elfring
2016-07-19 1:59 ` Mark yao
2016-07-15 20:00 ` [PATCH] drm/arcpgu: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
` (9 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-15 13:35 UTC (permalink / raw)
To: David Airlie, Heiko Stuebner, Mark Yao, dri-devel,
linux-arm-kernel, linux-rockchip
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 15 Jul 2016 15:23:22 +0200
The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns 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/gpu/drm/rockchip/rockchip_drm_fb.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
index 20f12bc..6f64e79 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
@@ -43,14 +43,10 @@ struct drm_gem_object *rockchip_fb_get_gem_obj(struct drm_framebuffer *fb,
static void rockchip_drm_fb_destroy(struct drm_framebuffer *fb)
{
struct rockchip_drm_fb *rockchip_fb = to_rockchip_fb(fb);
- struct drm_gem_object *obj;
int i;
- for (i = 0; i < ROCKCHIP_MAX_FB_BUFFER; i++) {
- obj = rockchip_fb->obj[i];
- if (obj)
- drm_gem_object_unreference_unlocked(obj);
- }
+ for (i = 0; i < ROCKCHIP_MAX_FB_BUFFER; i++)
+ drm_gem_object_unreference_unlocked(rockchip_fb->obj[i]);
drm_framebuffer_cleanup(fb);
kfree(rockchip_fb);
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] drm/ttm: Delete an unnecessary check before the function call "ttm_tt_destroy"
2015-11-16 14:45 ` [PATCH] GPU-DRM-TTM: Delete an unnecessary check before the function call "ttm_tt_destroy" SF Markus Elfring
@ 2016-07-15 18:28 ` SF Markus Elfring
2016-07-18 7:12 ` Daniel Vetter
0 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-15 18:28 UTC (permalink / raw)
To: David Airlie, dri-devel; +Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 15 Jul 2016 20:20:48 +0200
The ttm_tt_destroy() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/ttm/ttm_bo.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 39386f5..23809d0 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -146,9 +146,7 @@ static void ttm_bo_release_list(struct kref *list_kref)
BUG_ON(bo->mem.mm_node != NULL);
BUG_ON(!list_empty(&bo->lru));
BUG_ON(!list_empty(&bo->ddestroy));
-
- if (bo->ttm)
- ttm_tt_destroy(bo->ttm);
+ tm_tt_destroy(bo->ttm);
atomic_dec(&bo->glob->bo_count);
if (bo->resv == &bo->ttm_resv)
reservation_object_fini(&bo->ttm_resv);
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] drm/vc4: Delete unnecessary checks before two function calls
2015-11-06 15:08 ` [PATCH] GPU-DRM-vc4: Delete unnecessary checks before two function calls SF Markus Elfring
@ 2016-07-15 19:21 ` SF Markus Elfring
0 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-15 19:21 UTC (permalink / raw)
To: David Airlie, Eric Anholt, dri-devel; +Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 15 Jul 2016 21:15:37 +0200
The following functions test whether their argument is NULL
and then return immediately.
* drm_fbdev_cma_hotplug_event
* drm_fbdev_cma_restore_mode
Thus the tests around their calls are not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/vc4/vc4_drv.c | 3 +--
drivers/gpu/drm/vc4/vc4_kms.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index 54d0471..ce74d86 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -47,8 +47,7 @@ static void vc4_lastclose(struct drm_device *dev)
{
struct vc4_dev *vc4 = to_vc4_dev(dev);
- if (vc4->fbdev)
- drm_fbdev_cma_restore_mode(vc4->fbdev);
+ drm_fbdev_cma_restore_mode(vc4->fbdev);
}
static const struct file_operations vc4_drm_fops = {
diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
index 9a217fd..4ac894d 100644
--- a/drivers/gpu/drm/vc4/vc4_kms.c
+++ b/drivers/gpu/drm/vc4/vc4_kms.c
@@ -26,8 +26,7 @@ static void vc4_output_poll_changed(struct drm_device *dev)
{
struct vc4_dev *vc4 = to_vc4_dev(dev);
- if (vc4->fbdev)
- drm_fbdev_cma_hotplug_event(vc4->fbdev);
+ drm_fbdev_cma_hotplug_event(vc4->fbdev);
}
struct vc4_commit {
--
2.9.1
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] drm/arcpgu: Delete an unnecessary check before drm_fbdev_cma_hotplug_event()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (24 preceding siblings ...)
2016-07-15 13:35 ` [PATCH] drm/rockchip: " SF Markus Elfring
@ 2016-07-15 20:00 ` SF Markus Elfring
2016-07-19 18:04 ` Alexey Brodkin
2016-07-15 20:44 ` [PATCH] drm/virtgpu: Delete unnecessary checks before drm_gem_object_unreference_unlocked() SF Markus Elfring
` (8 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-15 20:00 UTC (permalink / raw)
To: Alexey Brodkin, David Airlie, dri-devel
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 15 Jul 2016 21:52:40 +0200
The drm_fbdev_cma_hotplug_event() function tests whether its argument
is NULL and then returns 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/gpu/drm/arc/arcpgu_drv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index ccbdadb..740d8ba 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -28,8 +28,7 @@ static void arcpgu_fb_output_poll_changed(struct drm_device *dev)
{
struct arcpgu_drm_private *arcpgu = dev->dev_private;
- if (arcpgu->fbdev)
- drm_fbdev_cma_hotplug_event(arcpgu->fbdev);
+ drm_fbdev_cma_hotplug_event(arcpgu->fbdev);
}
static struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = {
--
2.9.1
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] drm/virtgpu: Delete unnecessary checks before drm_gem_object_unreference_unlocked()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (25 preceding siblings ...)
2016-07-15 20:00 ` [PATCH] drm/arcpgu: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
@ 2016-07-15 20:44 ` SF Markus Elfring
2016-07-16 6:40 ` [PATCH] drm/cirrus: Delete an unnecessary check " SF Markus Elfring
` (7 subsequent siblings)
34 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-15 20:44 UTC (permalink / raw)
To: David Airlie, Gerd Hoffmann, dri-devel, virtualization
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 15 Jul 2016 22:38:42 +0200
The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns immediately.
Thus the test around the 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/virtio/virtgpu_display.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
index ac758cd..fdfc711 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -53,8 +53,7 @@ static void virtio_gpu_user_framebuffer_destroy(struct drm_framebuffer *fb)
struct virtio_gpu_framebuffer *virtio_gpu_fb
= to_virtio_gpu_framebuffer(fb);
- if (virtio_gpu_fb->obj)
- drm_gem_object_unreference_unlocked(virtio_gpu_fb->obj);
+ drm_gem_object_unreference_unlocked(virtio_gpu_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(virtio_gpu_fb);
}
@@ -326,8 +325,7 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev,
ret = virtio_gpu_framebuffer_init(dev, virtio_gpu_fb, mode_cmd, obj);
if (ret) {
kfree(virtio_gpu_fb);
- if (obj)
- drm_gem_object_unreference_unlocked(obj);
+ drm_gem_object_unreference_unlocked(obj);
return NULL;
}
--
2.9.1
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] drm/tegra: Delete an unnecessary check before the function call "vunmap"
2015-07-13 14:16 ` Alexandre Courbot
@ 2016-07-16 5:30 ` SF Markus Elfring
0 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 5:30 UTC (permalink / raw)
To: linux-tegra, dri-devel, Terje Bergström, Thierry Reding,
Stephen Warren, David Airlie, Alexandre Courbot
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 07:23:42 +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/tegra/fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c
index 1b12aa7..e6d71fa 100644
--- a/drivers/gpu/drm/tegra/fb.c
+++ b/drivers/gpu/drm/tegra/fb.c
@@ -68,7 +68,7 @@ static void tegra_fb_destroy(struct drm_framebuffer *framebuffer)
struct tegra_bo *bo = fb->planes[i];
if (bo) {
- if (bo->pages && bo->vaddr)
+ if (bo->pages)
vunmap(bo->vaddr);
drm_gem_object_unreference_unlocked(&bo->gem);
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] drm/cirrus: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (26 preceding siblings ...)
2016-07-15 20:44 ` [PATCH] drm/virtgpu: Delete unnecessary checks before drm_gem_object_unreference_unlocked() SF Markus Elfring
@ 2016-07-16 6:40 ` SF Markus Elfring
2016-07-16 7:20 ` [PATCH] drm/hdlcd: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
` (6 subsequent siblings)
34 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 6:40 UTC (permalink / raw)
To: dri-devel, David Airlie; +Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 08:28:13 +0200
The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns 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/gpu/drm/cirrus/cirrus_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c
index 32d32c5..80446e2 100644
--- a/drivers/gpu/drm/cirrus/cirrus_main.c
+++ b/drivers/gpu/drm/cirrus/cirrus_main.c
@@ -17,8 +17,8 @@
static void cirrus_user_framebuffer_destroy(struct drm_framebuffer *fb)
{
struct cirrus_framebuffer *cirrus_fb = to_cirrus_framebuffer(fb);
- if (cirrus_fb->obj)
- drm_gem_object_unreference_unlocked(cirrus_fb->obj);
+
+ drm_gem_object_unreference_unlocked(cirrus_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(fb);
}
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] drm/hdlcd: Delete an unnecessary check before drm_fbdev_cma_hotplug_event()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (27 preceding siblings ...)
2016-07-16 6:40 ` [PATCH] drm/cirrus: Delete an unnecessary check " SF Markus Elfring
@ 2016-07-16 7:20 ` SF Markus Elfring
2016-07-18 9:21 ` Liviu Dudau
2016-07-16 8:04 ` [PATCH] drm/ast: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
` (5 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 7:20 UTC (permalink / raw)
To: dri-devel, malidp, Liviu Dudau, David Airlie, Brian Starkey
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 09:10:40 +0200
The drm_fbdev_cma_hotplug_event() function tests whether its argument
is NULL and then returns 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/gpu/drm/arm/hdlcd_drv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 28b8cd1..9b1aefe 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -102,8 +102,7 @@ static void hdlcd_fb_output_poll_changed(struct drm_device *drm)
{
struct hdlcd_drm_private *hdlcd = drm->dev_private;
- if (hdlcd->fbdev)
- drm_fbdev_cma_hotplug_event(hdlcd->fbdev);
+ drm_fbdev_cma_hotplug_event(hdlcd->fbdev);
}
static const struct drm_mode_config_funcs hdlcd_mode_config_funcs = {
--
2.9.1
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] drm/ast: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (28 preceding siblings ...)
2016-07-16 7:20 ` [PATCH] drm/hdlcd: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
@ 2016-07-16 8:04 ` SF Markus Elfring
2016-07-18 6:53 ` Daniel Vetter
2016-07-20 16:40 ` [PATCH] GPU-DRM-sun4i: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
` (4 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 8:04 UTC (permalink / raw)
To: dri-devel, David Airlie; +Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 09:54:22 +0200
The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns 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/gpu/drm/ast/ast_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
index 7bc3aa6..904beaa 100644
--- a/drivers/gpu/drm/ast/ast_main.c
+++ b/drivers/gpu/drm/ast/ast_main.c
@@ -295,9 +295,8 @@ static int ast_get_dram_info(struct drm_device *dev)
static void ast_user_framebuffer_destroy(struct drm_framebuffer *fb)
{
struct ast_framebuffer *ast_fb = to_ast_framebuffer(fb);
- if (ast_fb->obj)
- drm_gem_object_unreference_unlocked(ast_fb->obj);
+ drm_gem_object_unreference_unlocked(ast_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(fb);
}
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations
2015-06-28 8:45 ` [PATCH] drm/amdgpu: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2015-06-29 15:30 ` Alex Deucher
@ 2016-07-16 14:33 ` SF Markus Elfring
2016-07-16 14:45 ` [PATCH 1/8] drm/amdgpu: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
` (8 more replies)
1 sibling, 9 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 14:33 UTC (permalink / raw)
To: dri-devel, David Airlie, Christian König, Alex Deucher
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 16:23:21 +0200
Further update suggestions were taken into account after patches
were applied from static source code analysis.
Markus Elfring (8):
Delete an unnecessary check before drm_gem_object_unreference_unlocked()
Delete unnecessary checks before the function call "kfree"
One function call less in amdgpu_cgs_acpi_eval_object() after error detection
Delete a variable in amdgpu_cgs_acpi_eval_object()
Delete an unnecessary variable initialisation in amdgpu_cgs_acpi_eval_object()
Change assignment for a variable in amdgpu_cgs_acpi_eval_object()
Change assignment for a buffer variable in phm_dispatch_table()
Delete an unnecessary variable initialisation in phm_dispatch_table()
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 28 ++++++++++------------
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 +---
.../gpu/drm/amd/powerplay/hwmgr/functiontables.c | 12 ++++------
3 files changed, 19 insertions(+), 25 deletions(-)
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH 1/8] drm/amdgpu: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
@ 2016-07-16 14:45 ` SF Markus Elfring
2016-07-16 14:48 ` [PATCH 2/8] drm/amdgpu/powerplay: Delete unnecessary checks before the function call "kfree" SF Markus Elfring
` (7 subsequent siblings)
8 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 14:45 UTC (permalink / raw)
To: dri-devel, David Airlie, Christian König, Alex Deucher
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 11:28:36 +0200
The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns 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/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index a6eecf6..2a07b15 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -516,9 +516,7 @@ static void amdgpu_user_framebuffer_destroy(struct drm_framebuffer *fb)
{
struct amdgpu_framebuffer *amdgpu_fb = to_amdgpu_framebuffer(fb);
- if (amdgpu_fb->obj) {
- drm_gem_object_unreference_unlocked(amdgpu_fb->obj);
- }
+ drm_gem_object_unreference_unlocked(amdgpu_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(amdgpu_fb);
}
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 2/8] drm/amdgpu/powerplay: Delete unnecessary checks before the function call "kfree"
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
2016-07-16 14:45 ` [PATCH 1/8] drm/amdgpu: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
@ 2016-07-16 14:48 ` SF Markus Elfring
2016-07-16 14:50 ` [PATCH 3/8] drm/amdgpu: One function call less in amdgpu_cgs_acpi_eval_object() after error detection SF Markus Elfring
` (6 subsequent siblings)
8 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 14:48 UTC (permalink / raw)
To: dri-devel, David Airlie, Christian König, Alex Deucher
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 12:38:12 +0200
The kfree() function tests whether its argument is NULL and then
returns immediately. Thus the test around the 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/amd/amdgpu/amdgpu_cgs.c | 3 +--
drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c | 5 +----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index cf6f49f..6f11bc1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -1053,8 +1053,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
}
error:
- if (obj != NULL)
- kfree(obj);
+ kfree(obj);
kfree((void *)input.pointer);
return result;
}
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
index 7a705ce..024e22e 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
@@ -76,10 +76,7 @@ int phm_dispatch_table(struct pp_hwmgr *hwmgr,
}
result = phm_run_table(hwmgr, rt_table, input, output, temp_storage);
-
- if (NULL != temp_storage)
- kfree(temp_storage);
-
+ kfree(temp_storage);
return result;
}
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 3/8] drm/amdgpu: One function call less in amdgpu_cgs_acpi_eval_object() after error detection
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
2016-07-16 14:45 ` [PATCH 1/8] drm/amdgpu: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-16 14:48 ` [PATCH 2/8] drm/amdgpu/powerplay: Delete unnecessary checks before the function call "kfree" SF Markus Elfring
@ 2016-07-16 14:50 ` SF Markus Elfring
2016-07-16 14:54 ` [PATCH 4/8] drm/amdgpu: Delete a variable in amdgpu_cgs_acpi_eval_object() SF Markus Elfring
` (5 subsequent siblings)
8 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 14:50 UTC (permalink / raw)
To: dri-devel, David Airlie, Christian König, Alex Deucher
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 13:43:44 +0200
The kfree() function was called in one case by the
amdgpu_cgs_acpi_eval_object() function during error handling
even if the passed variable "obj" contained a null pointer.
* Adjust jump targets according to the Linux coding style convention.
* Delete unnecessary initialisations for the variables "obj"
and "params" then.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index 6f11bc1..705bfa2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -903,8 +903,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
acpi_handle handle;
struct acpi_object_list input;
struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
- union acpi_object *params = NULL;
- union acpi_object *obj = NULL;
+ union acpi_object *params, *obj;
uint8_t name[5] = {'\0'};
struct cgs_acpi_method_argument *argument = NULL;
uint32_t i, count;
@@ -996,7 +995,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
if (ACPI_FAILURE(status)) {
result = -EIO;
- goto error;
+ goto free_input;
}
/* return the output info */
@@ -1006,7 +1005,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
if ((obj->type != ACPI_TYPE_PACKAGE) ||
(obj->package.count != count)) {
result = -EIO;
- goto error;
+ goto free_obj;
}
params = obj->package.elements;
} else
@@ -1014,13 +1013,13 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
if (params == NULL) {
result = -EIO;
- goto error;
+ goto free_obj;
}
for (i = 0; i < count; i++) {
if (argument->type != params->type) {
result = -EIO;
- goto error;
+ goto free_obj;
}
switch (params->type) {
case ACPI_TYPE_INTEGER:
@@ -1030,7 +1029,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
if ((params->string.length != argument->data_length) ||
(params->string.pointer == NULL)) {
result = -EIO;
- goto error;
+ goto free_obj;
}
strncpy(argument->pointer,
params->string.pointer,
@@ -1039,7 +1038,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
case ACPI_TYPE_BUFFER:
if (params->buffer.pointer == NULL) {
result = -EIO;
- goto error;
+ goto free_obj;
}
memcpy(argument->pointer,
params->buffer.pointer,
@@ -1052,8 +1051,9 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
params++;
}
-error:
+free_obj:
kfree(obj);
+free_input:
kfree((void *)input.pointer);
return result;
}
--
2.9.1
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 4/8] drm/amdgpu: Delete a variable in amdgpu_cgs_acpi_eval_object()
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
` (2 preceding siblings ...)
2016-07-16 14:50 ` [PATCH 3/8] drm/amdgpu: One function call less in amdgpu_cgs_acpi_eval_object() after error detection SF Markus Elfring
@ 2016-07-16 14:54 ` SF Markus Elfring
2016-07-16 14:56 ` [PATCH 5/8] drm/amdgpu: Delete an unnecessary variable initialisation " SF Markus Elfring
2016-07-16 15:00 ` SF Markus Elfring
` (4 subsequent siblings)
8 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 14:54 UTC (permalink / raw)
To: dri-devel, David Airlie, Christian König, Alex Deucher
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 14:00:28 +0200
The local variable "func_no" was assigned a value at two places.
But it was not read within this function. Thus delete it.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index 705bfa2..f5de510 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -909,7 +909,6 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
uint32_t i, count;
acpi_status status;
int result = 0;
- uint32_t func_no = 0xFFFFFFFF;
handle = ACPI_HANDLE(&adev->pdev->dev);
if (!handle)
@@ -926,7 +925,6 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
if (info->pinput_argument == NULL)
return -EINVAL;
argument = info->pinput_argument;
- func_no = argument->value;
for (i = 0; i < info->input_count; i++) {
if (((argument->type == ACPI_TYPE_STRING) ||
(argument->type == ACPI_TYPE_BUFFER)) &&
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 5/8] drm/amdgpu: Delete an unnecessary variable initialisation in amdgpu_cgs_acpi_eval_object()
2016-07-16 14:54 ` [PATCH 4/8] drm/amdgpu: Delete a variable in amdgpu_cgs_acpi_eval_object() SF Markus Elfring
@ 2016-07-16 14:56 ` SF Markus Elfring
0 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 14:56 UTC (permalink / raw)
To: dri-devel, David Airlie, Christian König, Alex Deucher
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 14:54:12 +0200
The variable "argument" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index f5de510..47f2a43 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -905,7 +905,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *params, *obj;
uint8_t name[5] = {'\0'};
- struct cgs_acpi_method_argument *argument = NULL;
+ struct cgs_acpi_method_argument *argument;
uint32_t i, count;
acpi_status status;
int result = 0;
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 5/8] drm/amdgpu: Delete an unnecessary variable initialisation in amdgpu_cgs_acpi_eval_object()
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
` (3 preceding siblings ...)
2016-07-16 14:54 ` [PATCH 4/8] drm/amdgpu: Delete a variable in amdgpu_cgs_acpi_eval_object() SF Markus Elfring
@ 2016-07-16 15:00 ` SF Markus Elfring
2016-07-16 15:05 ` [PATCH 6/8] drm/amdgpu: Change assignment for a variable " SF Markus Elfring
` (3 subsequent siblings)
8 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 15:00 UTC (permalink / raw)
To: dri-devel, David Airlie, Christian König, Alex Deucher
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 14:54:12 +0200
The variable "argument" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index f5de510..47f2a43 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -905,7 +905,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *params, *obj;
uint8_t name[5] = {'\0'};
- struct cgs_acpi_method_argument *argument = NULL;
+ struct cgs_acpi_method_argument *argument;
uint32_t i, count;
acpi_status status;
int result = 0;
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 6/8] drm/amdgpu: Change assignment for a variable in amdgpu_cgs_acpi_eval_object()
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
` (4 preceding siblings ...)
2016-07-16 15:00 ` SF Markus Elfring
@ 2016-07-16 15:05 ` SF Markus Elfring
2016-07-16 15:08 ` [PATCH 7/8] drm/amd/powerplay: Change assignment for a buffer variable in phm_dispatch_table() SF Markus Elfring
` (2 subsequent siblings)
8 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 15:05 UTC (permalink / raw)
To: dri-devel, David Airlie, Christian König, Alex Deucher
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 15:05:45 +0200
Indicate successful function execution only at the end.
Thus omit initialisation for the variable "result" at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index 47f2a43..57859bd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -908,7 +908,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
struct cgs_acpi_method_argument *argument;
uint32_t i, count;
acpi_status status;
- int result = 0;
+ int result;
handle = ACPI_HANDLE(&adev->pdev->dev);
if (!handle)
@@ -1049,6 +1049,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
params++;
}
+ result = 0;
free_obj:
kfree(obj);
free_input:
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 7/8] drm/amd/powerplay: Change assignment for a buffer variable in phm_dispatch_table()
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
` (5 preceding siblings ...)
2016-07-16 15:05 ` [PATCH 6/8] drm/amdgpu: Change assignment for a variable " SF Markus Elfring
@ 2016-07-16 15:08 ` SF Markus Elfring
2016-07-17 15:03 ` walter harms
2016-07-16 15:10 ` [PATCH 8/8] drm/amd/powerplay: Delete an unnecessary variable initialisation " SF Markus Elfring
2016-07-18 7:41 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations Christian König
8 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 15:08 UTC (permalink / raw)
To: dri-devel, David Airlie, Christian König, Alex Deucher
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 15:36:36 +0200
The variable "temp_storage" was eventually reassigned with a pointer.
Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
index 024e22e..735aeb0 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
@@ -60,7 +60,7 @@ int phm_dispatch_table(struct pp_hwmgr *hwmgr,
void *input, void *output)
{
int result = 0;
- void *temp_storage = NULL;
+ void *temp_storage;
if (hwmgr == NULL || rt_table == NULL) {
printk(KERN_ERR "[ powerplay ] Invalid Parameter!\n");
@@ -73,7 +73,8 @@ int phm_dispatch_table(struct pp_hwmgr *hwmgr,
printk(KERN_ERR "[ powerplay ] Could not allocate table temporary storage\n");
return -ENOMEM;
}
- }
+ } else
+ temp_storage = NULL;
result = phm_run_table(hwmgr, rt_table, input, output, temp_storage);
kfree(temp_storage);
--
2.9.1
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 8/8] drm/amd/powerplay: Delete an unnecessary variable initialisation in phm_dispatch_table()
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
` (6 preceding siblings ...)
2016-07-16 15:08 ` [PATCH 7/8] drm/amd/powerplay: Change assignment for a buffer variable in phm_dispatch_table() SF Markus Elfring
@ 2016-07-16 15:10 ` SF Markus Elfring
2016-07-18 7:41 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations Christian König
8 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-16 15:10 UTC (permalink / raw)
To: dri-devel, David Airlie, Christian König, Alex Deucher
Cc: Julia Lawall, kernel-janitors, LKML
From 0bf6f3c40786e12d3d42672f1d56296b30e17ac9 Mon Sep 17 00:00:00 2001
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 15:50:18 +0200
Subject: [PATCH 8/8] drm/amd/powerplay: Delete an unnecessary variable
initialisation in phm_dispatch_table()
The variable "result" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
index 735aeb0..fdfed63 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
@@ -59,7 +59,7 @@ int phm_dispatch_table(struct pp_hwmgr *hwmgr,
struct phm_runtime_table_header *rt_table,
void *input, void *output)
{
- int result = 0;
+ int result;
void *temp_storage;
if (hwmgr == NULL || rt_table == NULL) {
--
2.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH 7/8] drm/amd/powerplay: Change assignment for a buffer variable in phm_dispatch_table()
2016-07-16 15:08 ` [PATCH 7/8] drm/amd/powerplay: Change assignment for a buffer variable in phm_dispatch_table() SF Markus Elfring
@ 2016-07-17 15:03 ` walter harms
0 siblings, 0 replies; 123+ messages in thread
From: walter harms @ 2016-07-17 15:03 UTC (permalink / raw)
To: SF Markus Elfring
Cc: dri-devel, David Airlie, Christian König, Alex Deucher, LKML,
kernel-janitors, Julia Lawall
Am 16.07.2016 17:08, schrieb SF Markus Elfring:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 16 Jul 2016 15:36:36 +0200
>
> The variable "temp_storage" was eventually reassigned with a pointer.
> Thus omit the explicit initialisation at the beginning.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
> index 024e22e..735aeb0 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
> @@ -60,7 +60,7 @@ int phm_dispatch_table(struct pp_hwmgr *hwmgr,
> void *input, void *output)
> {
> int result = 0;
> - void *temp_storage = NULL;
> + void *temp_storage;
>
> if (hwmgr == NULL || rt_table == NULL) {
> printk(KERN_ERR "[ powerplay ] Invalid Parameter!\n");
> @@ -73,7 +73,8 @@ int phm_dispatch_table(struct pp_hwmgr *hwmgr,
> printk(KERN_ERR "[ powerplay ] Could not allocate table temporary storage\n");
> return -ENOMEM;
> }
> - }
> + } else
> + temp_storage = NULL;
>
> result = phm_run_table(hwmgr, rt_table, input, output, temp_storage);
> kfree(temp_storage);
the handling of rt_table->storage_size == 0 is so better visible.
IMHO in this case the function could return directly either with -EINVAL;
or with 0; -> more direct more obvious.
if (rt_table->storage_size == 0 )
return 0;
re,
wh
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH] drm/ast: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
2016-07-16 8:04 ` [PATCH] drm/ast: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
@ 2016-07-18 6:53 ` Daniel Vetter
0 siblings, 0 replies; 123+ messages in thread
From: Daniel Vetter @ 2016-07-18 6:53 UTC (permalink / raw)
To: SF Markus Elfring
Cc: dri-devel, David Airlie, Julia Lawall, kernel-janitors, LKML
On Sat, Jul 16, 2016 at 10:04:34AM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 16 Jul 2016 09:54:22 +0200
>
> The drm_gem_object_unreference_unlocked() function tests whether
> its argument is NULL and then returns 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>
Ok, I merged all the non-amd ones from your latest round to drm-misc. Two
small nitpicks:
- for cocci patches I prefer if you include the (simplified, if it's a
large one) semantic patch in the commit message. Cocci is really badly
documented, it's good to see new examples of how.
- threading seems funny in your series. Please generate mail threads using
git format-patch --cover-letter $sha1_range and send them out using git
send-email. That'll get all the details right. Also pls don't reply with
new patches to an old series, that hides the patches and confuses the
discussion. Just start a new thread (even when the patches are on the
same or similar topic).
Thanks, Daniel
> ---
> drivers/gpu/drm/ast/ast_main.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
> index 7bc3aa6..904beaa 100644
> --- a/drivers/gpu/drm/ast/ast_main.c
> +++ b/drivers/gpu/drm/ast/ast_main.c
> @@ -295,9 +295,8 @@ static int ast_get_dram_info(struct drm_device *dev)
> static void ast_user_framebuffer_destroy(struct drm_framebuffer *fb)
> {
> struct ast_framebuffer *ast_fb = to_ast_framebuffer(fb);
> - if (ast_fb->obj)
> - drm_gem_object_unreference_unlocked(ast_fb->obj);
>
> + drm_gem_object_unreference_unlocked(ast_fb->obj);
> drm_framebuffer_cleanup(fb);
> kfree(fb);
> }
> --
> 2.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH] drm/ttm: Delete an unnecessary check before the function call "ttm_tt_destroy"
2016-07-15 18:28 ` [PATCH] drm/ttm: " SF Markus Elfring
@ 2016-07-18 7:12 ` Daniel Vetter
2016-07-18 14:10 ` [PATCH v3] " SF Markus Elfring
0 siblings, 1 reply; 123+ messages in thread
From: Daniel Vetter @ 2016-07-18 7:12 UTC (permalink / raw)
To: SF Markus Elfring; +Cc: Julia Lawall, kernel-janitors, LKML, dri-devel
On Fri, Jul 15, 2016 at 08:28:18PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 15 Jul 2016 20:20:48 +0200
>
> The ttm_tt_destroy() function tests whether its argument is NULL
> and then returns immediately. Thus the test around the call is not needed.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/gpu/drm/ttm/ttm_bo.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 39386f5..23809d0 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -146,9 +146,7 @@ static void ttm_bo_release_list(struct kref *list_kref)
> BUG_ON(bo->mem.mm_node != NULL);
> BUG_ON(!list_empty(&bo->lru));
> BUG_ON(!list_empty(&bo->ddestroy));
> -
> - if (bo->ttm)
> - ttm_tt_destroy(bo->ttm);
> + tm_tt_destroy(bo->ttm);
This doesn't compile. Tsk, pls be more careful, and definitely
compile-test _all_ your changes before hitting send. I've dropped this one
from my queue, the others still look ok.
-Daniel
> atomic_dec(&bo->glob->bo_count);
> if (bo->resv == &bo->ttm_resv)
> reservation_object_fini(&bo->ttm_resv);
> --
> 2.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
` (7 preceding siblings ...)
2016-07-16 15:10 ` [PATCH 8/8] drm/amd/powerplay: Delete an unnecessary variable initialisation " SF Markus Elfring
@ 2016-07-18 7:41 ` Christian König
2016-07-28 16:10 ` Alex Deucher
8 siblings, 1 reply; 123+ messages in thread
From: Christian König @ 2016-07-18 7:41 UTC (permalink / raw)
To: SF Markus Elfring, dri-devel, David Airlie, Alex Deucher
Cc: LKML, kernel-janitors, Julia Lawall
Am 16.07.2016 um 16:33 schrieb SF Markus Elfring:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 16 Jul 2016 16:23:21 +0200
>
> Further update suggestions were taken into account after patches
> were applied from static source code analysis.
Small coding style nit pick on patch #7:
> - }
> + } else
> + temp_storage = NULL;
When an "if" has "{" and "}" the else should also use them even when it
is only one line.
With that fixed the whole series is Reviewed-by: Christian König
<christian.koenig@amd.com>, but as Walter Harms pointed out as well
there are a couple of other things we could make more as well.
Regards,
Christian.
>
> Markus Elfring (8):
> Delete an unnecessary check before drm_gem_object_unreference_unlocked()
> Delete unnecessary checks before the function call "kfree"
> One function call less in amdgpu_cgs_acpi_eval_object() after error detection
> Delete a variable in amdgpu_cgs_acpi_eval_object()
> Delete an unnecessary variable initialisation in amdgpu_cgs_acpi_eval_object()
> Change assignment for a variable in amdgpu_cgs_acpi_eval_object()
> Change assignment for a buffer variable in phm_dispatch_table()
> Delete an unnecessary variable initialisation in phm_dispatch_table()
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 28 ++++++++++------------
> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 +---
> .../gpu/drm/amd/powerplay/hwmgr/functiontables.c | 12 ++++------
> 3 files changed, 19 insertions(+), 25 deletions(-)
>
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH] drm/hdlcd: Delete an unnecessary check before drm_fbdev_cma_hotplug_event()
2016-07-16 7:20 ` [PATCH] drm/hdlcd: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
@ 2016-07-18 9:21 ` Liviu Dudau
0 siblings, 0 replies; 123+ messages in thread
From: Liviu Dudau @ 2016-07-18 9:21 UTC (permalink / raw)
To: SF Markus Elfring; +Cc: kernel-janitors, LKML, dri-devel, Julia Lawall, malidp
On Sat, Jul 16, 2016 at 09:20:02AM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 16 Jul 2016 09:10:40 +0200
>
> The drm_fbdev_cma_hotplug_event() function tests whether its argument
> is NULL and then returns 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>
Acked-by: Liviu Dudau <Liviu.Dudau@arm.com>
> ---
> drivers/gpu/drm/arm/hdlcd_drv.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index 28b8cd1..9b1aefe 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -102,8 +102,7 @@ static void hdlcd_fb_output_poll_changed(struct drm_device *drm)
> {
> struct hdlcd_drm_private *hdlcd = drm->dev_private;
>
> - if (hdlcd->fbdev)
> - drm_fbdev_cma_hotplug_event(hdlcd->fbdev);
> + drm_fbdev_cma_hotplug_event(hdlcd->fbdev);
> }
>
> static const struct drm_mode_config_funcs hdlcd_mode_config_funcs = {
> --
> 2.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH v3] drm/ttm: Delete an unnecessary check before the function call "ttm_tt_destroy"
2016-07-18 7:12 ` Daniel Vetter
@ 2016-07-18 14:10 ` SF Markus Elfring
2016-07-18 14:45 ` Daniel Vetter
0 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-18 14:10 UTC (permalink / raw)
To: dri-devel, Daniel Vetter, David Airlie
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 18 Jul 2016 16:06:18 +0200
The ttm_tt_destroy() function tests whether its argument is NULL
and then returns 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/gpu/drm/ttm/ttm_bo.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 39386f5..4e55863 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -146,9 +146,7 @@ static void ttm_bo_release_list(struct kref *list_kref)
BUG_ON(bo->mem.mm_node != NULL);
BUG_ON(!list_empty(&bo->lru));
BUG_ON(!list_empty(&bo->ddestroy));
-
- if (bo->ttm)
- ttm_tt_destroy(bo->ttm);
+ ttm_tt_destroy(bo->ttm);
atomic_dec(&bo->glob->bo_count);
if (bo->resv == &bo->ttm_resv)
reservation_object_fini(&bo->ttm_resv);
--
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] 123+ messages in thread
* Re: [PATCH v3] drm/ttm: Delete an unnecessary check before the function call "ttm_tt_destroy"
2016-07-18 14:10 ` [PATCH v3] " SF Markus Elfring
@ 2016-07-18 14:45 ` Daniel Vetter
2016-07-18 17:00 ` SF Markus Elfring
2016-07-19 8:14 ` [PATCH v3] " Geert Uytterhoeven
0 siblings, 2 replies; 123+ messages in thread
From: Daniel Vetter @ 2016-07-18 14:45 UTC (permalink / raw)
To: SF Markus Elfring; +Cc: kernel-janitors, LKML, dri-devel, Julia Lawall
On Mon, Jul 18, 2016 at 04:10:36PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 18 Jul 2016 16:06:18 +0200
>
> The ttm_tt_destroy() function tests whether its argument is NULL
> and then returns 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>
When resending pls describe what changed (and why). Also I'd still like
that smatch included in the commit message.
-Daniel
> ---
> drivers/gpu/drm/ttm/ttm_bo.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 39386f5..4e55863 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -146,9 +146,7 @@ static void ttm_bo_release_list(struct kref *list_kref)
> BUG_ON(bo->mem.mm_node != NULL);
> BUG_ON(!list_empty(&bo->lru));
> BUG_ON(!list_empty(&bo->ddestroy));
> -
> - if (bo->ttm)
> - ttm_tt_destroy(bo->ttm);
> + ttm_tt_destroy(bo->ttm);
> atomic_dec(&bo->glob->bo_count);
> if (bo->resv == &bo->ttm_resv)
> reservation_object_fini(&bo->ttm_resv);
> --
> 2.9.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: drm/ttm: Delete an unnecessary check before the function call "ttm_tt_destroy"
2016-07-18 14:45 ` Daniel Vetter
@ 2016-07-18 17:00 ` SF Markus Elfring
2016-07-19 8:14 ` [PATCH v3] " Geert Uytterhoeven
1 sibling, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-18 17:00 UTC (permalink / raw)
To: Daniel Vetter; +Cc: Julia Lawall, kernel-janitors, LKML, dri-devel
> When resending pls describe what changed (and why).
v3: A bit of reformatting with current software
v2: Broken patch where I managed to delete a "t" too much in a source code
line somehow.
v1: See also a similar update suggestion
https://lkml.org/lkml/2015/11/16/416
Would you like to pick such a software adjustment up?
Regards,
Markus
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH] drm/rockchip: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
2016-07-15 13:35 ` [PATCH] drm/rockchip: " SF Markus Elfring
@ 2016-07-19 1:59 ` Mark yao
0 siblings, 0 replies; 123+ messages in thread
From: Mark yao @ 2016-07-19 1:59 UTC (permalink / raw)
To: SF Markus Elfring, David Airlie, Heiko Stuebner, dri-devel,
linux-arm-kernel, linux-rockchip
Cc: Julia Lawall, kernel-janitors, LKML
On 2016年07月15日 21:35, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 15 Jul 2016 15:23:22 +0200
>
> The drm_gem_object_unreference_unlocked() function tests whether
> its argument is NULL and then returns 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/gpu/drm/rockchip/rockchip_drm_fb.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> index 20f12bc..6f64e79 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> @@ -43,14 +43,10 @@ struct drm_gem_object *rockchip_fb_get_gem_obj(struct drm_framebuffer *fb,
> static void rockchip_drm_fb_destroy(struct drm_framebuffer *fb)
> {
> struct rockchip_drm_fb *rockchip_fb = to_rockchip_fb(fb);
> - struct drm_gem_object *obj;
> int i;
>
> - for (i = 0; i < ROCKCHIP_MAX_FB_BUFFER; i++) {
> - obj = rockchip_fb->obj[i];
> - if (obj)
> - drm_gem_object_unreference_unlocked(obj);
> - }
> + for (i = 0; i < ROCKCHIP_MAX_FB_BUFFER; i++)
> + drm_gem_object_unreference_unlocked(rockchip_fb->obj[i]);
>
Good, Thanks for the fixes, Applied to my drm-fixes.
> drm_framebuffer_cleanup(fb);
> kfree(rockchip_fb);
--
Mark Yao
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH v3] drm/ttm: Delete an unnecessary check before the function call "ttm_tt_destroy"
2016-07-18 14:45 ` Daniel Vetter
2016-07-18 17:00 ` SF Markus Elfring
@ 2016-07-19 8:14 ` Geert Uytterhoeven
2016-07-19 8:21 ` Daniel Vetter
1 sibling, 1 reply; 123+ messages in thread
From: Geert Uytterhoeven @ 2016-07-19 8:14 UTC (permalink / raw)
To: Daniel Vetter
Cc: kernel-janitors@vger.kernel.org, LKML, DRI Development,
Julia Lawall, Alex Deucher, SF Markus Elfring
On Mon, Jul 18, 2016 at 4:45 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Mon, Jul 18, 2016 at 04:10:36PM +0200, SF Markus Elfring wrote:
>> From: Markus Elfring <elfring@users.sourceforge.net>
>> Date: Mon, 18 Jul 2016 16:06:18 +0200
>>
>> The ttm_tt_destroy() function tests whether its argument is NULL
>> and then returns 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>
>
> When resending pls describe what changed (and why). Also I'd still like
> that smatch included in the commit message.
A similar change was made in drm-next, causing a merge conflict
between the drm-next and drm-misc trees.
commit 4279cb1423d96e53b6b98ae9f2b41003b013a31f
Author: Christian König <christian.koenig@amd.com>
Date: Mon Jun 6 10:17:51 2016 +0200
drm/ttm: remove NULL checks when calling ttm_tt_destroy
The function is a no-op with a NULL pointer.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
--
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH v3] drm/ttm: Delete an unnecessary check before the function call "ttm_tt_destroy"
2016-07-19 8:14 ` [PATCH v3] " Geert Uytterhoeven
@ 2016-07-19 8:21 ` Daniel Vetter
0 siblings, 0 replies; 123+ messages in thread
From: Daniel Vetter @ 2016-07-19 8:21 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Daniel Vetter, Alex Deucher, SF Markus Elfring,
kernel-janitors@vger.kernel.org, DRI Development, David Airlie,
LKML, Julia Lawall
On Tue, Jul 19, 2016 at 10:14:07AM +0200, Geert Uytterhoeven wrote:
> On Mon, Jul 18, 2016 at 4:45 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Mon, Jul 18, 2016 at 04:10:36PM +0200, SF Markus Elfring wrote:
> >> From: Markus Elfring <elfring@users.sourceforge.net>
> >> Date: Mon, 18 Jul 2016 16:06:18 +0200
> >>
> >> The ttm_tt_destroy() function tests whether its argument is NULL
> >> and then returns 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>
> >
> > When resending pls describe what changed (and why). Also I'd still like
> > that smatch included in the commit message.
>
> A similar change was made in drm-next, causing a merge conflict
> between the drm-next and drm-misc trees.
>
> commit 4279cb1423d96e53b6b98ae9f2b41003b013a31f
> Author: Christian König <christian.koenig@amd.com>
> Date: Mon Jun 6 10:17:51 2016 +0200
>
> drm/ttm: remove NULL checks when calling ttm_tt_destroy
>
> The function is a no-op with a NULL pointer.
>
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yeah, realized that too but then drm-misc is a non-rebasing tree now, so
can't take this out.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH] drm/arcpgu: Delete an unnecessary check before drm_fbdev_cma_hotplug_event()
2016-07-15 20:00 ` [PATCH] drm/arcpgu: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
@ 2016-07-19 18:04 ` Alexey Brodkin
0 siblings, 0 replies; 123+ messages in thread
From: Alexey Brodkin @ 2016-07-19 18:04 UTC (permalink / raw)
To: elfring@users.sourceforge.net
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
julia.lawall@lip6.fr, kernel-janitors@vger.kernel.org,
airlied@linux.ie
Hi Markus,
On Fri, 2016-07-15 at 22:00 +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 15 Jul 2016 21:52:40 +0200
>
> The drm_fbdev_cma_hotplug_event() function tests whether its argument
> is NULL and then returns 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>
Good catch!
Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH] drm/atomic: Delete an unnecessary check before drm_property_unreference_blob()
2015-11-16 14:04 ` Daniel Vetter
@ 2016-07-20 16:02 ` SF Markus Elfring
2016-07-20 17:29 ` Sean Paul
0 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-20 16:02 UTC (permalink / raw)
To: dri-devel, Daniel Vetter, David Airlie, Maarten Lankhorst
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 20 Jul 2016 17:54:32 +0200
The drm_property_unreference_blob() function tests whether its argument
is NULL and then returns 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/gpu/drm/drm_atomic.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 3cee084..8d2f111 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -404,8 +404,7 @@ drm_atomic_replace_property_blob(struct drm_property_blob **blob,
if (old_blob == new_blob)
return;
- if (old_blob)
- drm_property_unreference_blob(old_blob);
+ drm_property_unreference_blob(old_blob);
if (new_blob)
drm_property_reference_blob(new_blob);
*blob = new_blob;
--
2.9.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM-sun4i: Delete an unnecessary check before drm_fbdev_cma_hotplug_event()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (29 preceding siblings ...)
2016-07-16 8:04 ` [PATCH] drm/ast: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
@ 2016-07-20 16:40 ` SF Markus Elfring
2016-07-20 17:47 ` Daniel Vetter
2016-07-22 9:32 ` [PATCH] drm/mgag200: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
` (3 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-20 16:40 UTC (permalink / raw)
To: dri-devel, linux-arm-kernel, Chen-Yu Tsai, Daniel Vetter,
David Airlie, Maxime Ripard
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 20 Jul 2016 18:32:34 +0200
The drm_fbdev_cma_hotplug_event() function tests whether its argument
is NULL and then returns 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/gpu/drm/sun4i/sun4i_framebuffer.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
index a0b30c2..70688fe 100644
--- a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
@@ -20,8 +20,7 @@ static void sun4i_de_output_poll_changed(struct drm_device *drm)
{
struct sun4i_drv *drv = drm->dev_private;
- if (drv->fbdev)
- drm_fbdev_cma_hotplug_event(drv->fbdev);
+ drm_fbdev_cma_hotplug_event(drv->fbdev);
}
static const struct drm_mode_config_funcs sun4i_de_mode_config_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] 123+ messages in thread
* Re: [PATCH] drm/atomic: Delete an unnecessary check before drm_property_unreference_blob()
2016-07-20 16:02 ` [PATCH] drm/atomic: Delete an unnecessary check " SF Markus Elfring
@ 2016-07-20 17:29 ` Sean Paul
0 siblings, 0 replies; 123+ messages in thread
From: Sean Paul @ 2016-07-20 17:29 UTC (permalink / raw)
To: SF Markus Elfring; +Cc: kernel-janitors, LKML, dri-devel, Julia Lawall
On Wed, Jul 20, 2016 at 12:02 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 20 Jul 2016 17:54:32 +0200
>
> The drm_property_unreference_blob() function tests whether its argument
> is NULL and then returns 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/gpu/drm/drm_atomic.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 3cee084..8d2f111 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -404,8 +404,7 @@ drm_atomic_replace_property_blob(struct drm_property_blob **blob,
> if (old_blob == new_blob)
> return;
>
> - if (old_blob)
> - drm_property_unreference_blob(old_blob);
> + drm_property_unreference_blob(old_blob);
> if (new_blob)
> drm_property_reference_blob(new_blob);
I wonder whether it'd be worthwhile to add the same check to
drm_property_reference_blob to make things symmetric.
Musings aside, I've applied this to drm-misc.
Sean
> *blob = new_blob;
> --
> 2.9.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH] GPU-DRM-sun4i: Delete an unnecessary check before drm_fbdev_cma_hotplug_event()
2016-07-20 16:40 ` [PATCH] GPU-DRM-sun4i: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
@ 2016-07-20 17:47 ` Daniel Vetter
0 siblings, 0 replies; 123+ messages in thread
From: Daniel Vetter @ 2016-07-20 17:47 UTC (permalink / raw)
To: SF Markus Elfring
Cc: kernel-janitors, LKML, dri-devel, Julia Lawall, Chen-Yu Tsai,
Maxime Ripard, linux-arm-kernel
On Wed, Jul 20, 2016 at 06:40:49PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 20 Jul 2016 18:32:34 +0200
>
> The drm_fbdev_cma_hotplug_event() function tests whether its argument
> is NULL and then returns 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>
Applied to drm-misc, thanks.
-Daniel
> ---
> drivers/gpu/drm/sun4i/sun4i_framebuffer.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
> index a0b30c2..70688fe 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
> @@ -20,8 +20,7 @@ static void sun4i_de_output_poll_changed(struct drm_device *drm)
> {
> struct sun4i_drv *drv = drm->dev_private;
>
> - if (drv->fbdev)
> - drm_fbdev_cma_hotplug_event(drv->fbdev);
> + drm_fbdev_cma_hotplug_event(drv->fbdev);
> }
>
> static const struct drm_mode_config_funcs sun4i_de_mode_config_funcs = {
> --
> 2.9.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM-nouveau: Delete an unnecessary check before the function call "pci_dev_put"
2015-07-05 18:22 ` [PATCH] GPU-DRM-nouveau: Delete " SF Markus Elfring
@ 2016-07-20 17:50 ` SF Markus Elfring
0 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-20 17:50 UTC (permalink / raw)
To: dri-devel, nouveau, Ben Skeggs, Daniel Vetter, David Airlie
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 20 Jul 2016 19:43:27 +0200
The pci_dev_put() function tests whether its argument is NULL and then
returns 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/gpu/drm/nouveau/nouveau_drm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 66c1280..7b09841 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -525,8 +525,7 @@ nouveau_drm_unload(struct drm_device *dev)
nouveau_vga_fini(drm);
nvif_device_fini(&drm->device);
- if (drm->hdmi_device)
- pci_dev_put(drm->hdmi_device);
+ pci_dev_put(drm->hdmi_device);
nouveau_cli_destroy(&drm->client);
return 0;
}
--
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] 123+ 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; 123+ 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] 123+ 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; 123+ 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] 123+ messages in thread
* [PATCH] GPU-DRM-OMAP: Delete unnecessary checks before two function calls
2015-02-04 21:25 ` [PATCH] GPU-DRM-OMAP: Delete unnecessary checks before two function calls SF Markus Elfring
@ 2016-07-22 6:45 ` SF Markus Elfring
0 siblings, 0 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-22 6:45 UTC (permalink / raw)
To: dri-devel, Daniel Vetter, David Airlie, Laurent Pinchart,
Tomi Valkeinen
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 08:28:31 +0200
The following functions test whether their argument is NULL and then
return immediately.
* backlight_device_unregister
* drm_gem_object_unreference_unlocked
Thus the test around the 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/omapdrm/displays/panel-dsi-cm.c | 3 +--
drivers/gpu/drm/omapdrm/omap_fb.c | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 1b0cf2d..0eae8af 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -1284,8 +1284,7 @@ static int dsicm_probe(struct platform_device *pdev)
return 0;
err_sysfs_create:
- if (bldev != NULL)
- backlight_device_unregister(bldev);
+ backlight_device_unregister(bldev);
err_bl:
destroy_workqueue(ddata->workqueue);
err_reg:
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index 983c8cf..31f5178 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -115,8 +115,8 @@ static void omap_framebuffer_destroy(struct drm_framebuffer *fb)
for (i = 0; i < n; i++) {
struct plane *plane = &omap_fb->planes[i];
- if (plane->bo)
- drm_gem_object_unreference_unlocked(plane->bo);
+
+ drm_gem_object_unreference_unlocked(plane->bo);
}
kfree(omap_fb);
--
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] 123+ messages in thread
* [PATCH] GPU-DRM-GMA500: Delete unnecessary checks before two function calls
2014-10-22 16:48 ` [PATCH 1/1] GPU-DRM-GMA500: Deletion of unnecessary checks before two function calls SF Markus Elfring
2014-10-23 11:26 ` One Thousand Gnomes
@ 2016-07-22 8:45 ` SF Markus Elfring
2016-07-22 9:32 ` Daniel Vetter
1 sibling, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-22 8:45 UTC (permalink / raw)
To: dri-devel, Daniel Vetter, David Airlie, Patrik Jakobsson
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 10:30:30 +0200
The functions pci_dev_put() and psb_intel_i2c_destroy() test whether
their argument is NULL and then return immediately.
Thus the tests around their calls are not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 3 +--
drivers/gpu/drm/gma500/cdv_intel_lvds.c | 9 +++------
drivers/gpu/drm/gma500/psb_drv.c | 6 ++----
drivers/gpu/drm/gma500/psb_intel_lvds.c | 9 +++------
4 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
index 28f9d90..563f193 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
@@ -246,8 +246,7 @@ static void cdv_hdmi_destroy(struct drm_connector *connector)
{
struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
- if (gma_encoder->i2c_bus)
- psb_intel_i2c_destroy(gma_encoder->i2c_bus);
+ psb_intel_i2c_destroy(gma_encoder->i2c_bus);
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
kfree(connector);
diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
index 813ef23..38dc890 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
@@ -444,8 +444,7 @@ static void cdv_intel_lvds_destroy(struct drm_connector *connector)
{
struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
- if (gma_encoder->i2c_bus)
- psb_intel_i2c_destroy(gma_encoder->i2c_bus);
+ psb_intel_i2c_destroy(gma_encoder->i2c_bus);
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
kfree(connector);
@@ -780,12 +779,10 @@ out:
failed_find:
mutex_unlock(&dev->mode_config.mutex);
printk(KERN_ERR "Failed find\n");
- if (gma_encoder->ddc_bus)
- psb_intel_i2c_destroy(gma_encoder->ddc_bus);
+ psb_intel_i2c_destroy(gma_encoder->ddc_bus);
failed_ddc:
printk(KERN_ERR "Failed DDC\n");
- if (gma_encoder->i2c_bus)
- psb_intel_i2c_destroy(gma_encoder->i2c_bus);
+ psb_intel_i2c_destroy(gma_encoder->i2c_bus);
failed_blc_i2c:
printk(KERN_ERR "Failed BLC\n");
drm_encoder_cleanup(encoder);
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 82b8ce4..50eb944f 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -210,10 +210,8 @@ static int psb_driver_unload(struct drm_device *dev)
iounmap(dev_priv->aux_reg);
dev_priv->aux_reg = NULL;
}
- if (dev_priv->aux_pdev)
- pci_dev_put(dev_priv->aux_pdev);
- if (dev_priv->lpc_pdev)
- pci_dev_put(dev_priv->lpc_pdev);
+ pci_dev_put(dev_priv->aux_pdev);
+ pci_dev_put(dev_priv->lpc_pdev);
/* Destroy VBT data */
psb_intel_destroy_bios(dev);
diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
index b1b9331..e55733c 100644
--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
@@ -561,8 +561,7 @@ void psb_intel_lvds_destroy(struct drm_connector *connector)
struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
struct psb_intel_lvds_priv *lvds_priv = gma_encoder->dev_priv;
- if (lvds_priv->ddc_bus)
- psb_intel_i2c_destroy(lvds_priv->ddc_bus);
+ psb_intel_i2c_destroy(lvds_priv->ddc_bus);
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
kfree(connector);
@@ -835,11 +834,9 @@ out:
failed_find:
mutex_unlock(&dev->mode_config.mutex);
- if (lvds_priv->ddc_bus)
- psb_intel_i2c_destroy(lvds_priv->ddc_bus);
+ psb_intel_i2c_destroy(lvds_priv->ddc_bus);
failed_ddc:
- if (lvds_priv->i2c_bus)
- psb_intel_i2c_destroy(lvds_priv->i2c_bus);
+ psb_intel_i2c_destroy(lvds_priv->i2c_bus);
failed_blc_i2c:
drm_encoder_cleanup(encoder);
drm_connector_cleanup(connector);
--
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] 123+ messages in thread
* Re: [PATCH] GPU-DRM-GMA500: Delete unnecessary checks before two function calls
2016-07-22 8:45 ` [PATCH] GPU-DRM-GMA500: Delete " SF Markus Elfring
@ 2016-07-22 9:32 ` Daniel Vetter
0 siblings, 0 replies; 123+ messages in thread
From: Daniel Vetter @ 2016-07-22 9:32 UTC (permalink / raw)
To: SF Markus Elfring
Cc: dri-devel, Daniel Vetter, David Airlie, Patrik Jakobsson, LKML,
kernel-janitors, Julia Lawall
On Fri, Jul 22, 2016 at 10:45:30AM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Jul 2016 10:30:30 +0200
>
> The functions pci_dev_put() and psb_intel_i2c_destroy() test whether
> their argument is NULL and then return immediately.
> Thus the tests around their calls are not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Two more applied. And your threading still looks funny, all the patches
are in-reply to one I don't even have.
-Daniel
> ---
> drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 3 +--
> drivers/gpu/drm/gma500/cdv_intel_lvds.c | 9 +++------
> drivers/gpu/drm/gma500/psb_drv.c | 6 ++----
> drivers/gpu/drm/gma500/psb_intel_lvds.c | 9 +++------
> 4 files changed, 9 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> index 28f9d90..563f193 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> @@ -246,8 +246,7 @@ static void cdv_hdmi_destroy(struct drm_connector *connector)
> {
> struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
>
> - if (gma_encoder->i2c_bus)
> - psb_intel_i2c_destroy(gma_encoder->i2c_bus);
> + psb_intel_i2c_destroy(gma_encoder->i2c_bus);
> drm_connector_unregister(connector);
> drm_connector_cleanup(connector);
> kfree(connector);
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> index 813ef23..38dc890 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> @@ -444,8 +444,7 @@ static void cdv_intel_lvds_destroy(struct drm_connector *connector)
> {
> struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
>
> - if (gma_encoder->i2c_bus)
> - psb_intel_i2c_destroy(gma_encoder->i2c_bus);
> + psb_intel_i2c_destroy(gma_encoder->i2c_bus);
> drm_connector_unregister(connector);
> drm_connector_cleanup(connector);
> kfree(connector);
> @@ -780,12 +779,10 @@ out:
> failed_find:
> mutex_unlock(&dev->mode_config.mutex);
> printk(KERN_ERR "Failed find\n");
> - if (gma_encoder->ddc_bus)
> - psb_intel_i2c_destroy(gma_encoder->ddc_bus);
> + psb_intel_i2c_destroy(gma_encoder->ddc_bus);
> failed_ddc:
> printk(KERN_ERR "Failed DDC\n");
> - if (gma_encoder->i2c_bus)
> - psb_intel_i2c_destroy(gma_encoder->i2c_bus);
> + psb_intel_i2c_destroy(gma_encoder->i2c_bus);
> failed_blc_i2c:
> printk(KERN_ERR "Failed BLC\n");
> drm_encoder_cleanup(encoder);
> diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
> index 82b8ce4..50eb944f 100644
> --- a/drivers/gpu/drm/gma500/psb_drv.c
> +++ b/drivers/gpu/drm/gma500/psb_drv.c
> @@ -210,10 +210,8 @@ static int psb_driver_unload(struct drm_device *dev)
> iounmap(dev_priv->aux_reg);
> dev_priv->aux_reg = NULL;
> }
> - if (dev_priv->aux_pdev)
> - pci_dev_put(dev_priv->aux_pdev);
> - if (dev_priv->lpc_pdev)
> - pci_dev_put(dev_priv->lpc_pdev);
> + pci_dev_put(dev_priv->aux_pdev);
> + pci_dev_put(dev_priv->lpc_pdev);
>
> /* Destroy VBT data */
> psb_intel_destroy_bios(dev);
> diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> index b1b9331..e55733c 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> @@ -561,8 +561,7 @@ void psb_intel_lvds_destroy(struct drm_connector *connector)
> struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
> struct psb_intel_lvds_priv *lvds_priv = gma_encoder->dev_priv;
>
> - if (lvds_priv->ddc_bus)
> - psb_intel_i2c_destroy(lvds_priv->ddc_bus);
> + psb_intel_i2c_destroy(lvds_priv->ddc_bus);
> drm_connector_unregister(connector);
> drm_connector_cleanup(connector);
> kfree(connector);
> @@ -835,11 +834,9 @@ out:
>
> failed_find:
> mutex_unlock(&dev->mode_config.mutex);
> - if (lvds_priv->ddc_bus)
> - psb_intel_i2c_destroy(lvds_priv->ddc_bus);
> + psb_intel_i2c_destroy(lvds_priv->ddc_bus);
> failed_ddc:
> - if (lvds_priv->i2c_bus)
> - psb_intel_i2c_destroy(lvds_priv->i2c_bus);
> + psb_intel_i2c_destroy(lvds_priv->i2c_bus);
> failed_blc_i2c:
> drm_encoder_cleanup(encoder);
> drm_connector_cleanup(connector);
> --
> 2.9.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH] drm/mgag200: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (30 preceding siblings ...)
2016-07-20 16:40 ` [PATCH] GPU-DRM-sun4i: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
@ 2016-07-22 9:32 ` SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
2016-07-22 10:56 ` [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob() SF Markus Elfring
` (2 subsequent siblings)
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-22 9:32 UTC (permalink / raw)
To: dri-devel, Daniel Vetter, David Airlie
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 11:20:27 +0200
The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns 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/gpu/drm/mgag200/mgag200_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c
index 615cbb0..13798b3 100644
--- a/drivers/gpu/drm/mgag200/mgag200_main.c
+++ b/drivers/gpu/drm/mgag200/mgag200_main.c
@@ -17,8 +17,8 @@
static void mga_user_framebuffer_destroy(struct drm_framebuffer *fb)
{
struct mga_framebuffer *mga_fb = to_mga_framebuffer(fb);
- if (mga_fb->obj)
- drm_gem_object_unreference_unlocked(mga_fb->obj);
+
+ drm_gem_object_unreference_unlocked(mga_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(fb);
}
--
2.9.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (31 preceding siblings ...)
2016-07-22 9:32 ` [PATCH] drm/mgag200: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
@ 2016-07-22 10:56 ` SF Markus Elfring
2016-07-25 8:43 ` Matthias Brugger
2016-07-22 12:22 ` [PATCH] drm/qxl: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-22 15:42 ` [PATCH 0/4] GPU-DRM-Etnaviv: Fine-tuning for a few functions SF Markus Elfring
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-22 10:56 UTC (permalink / raw)
To: dri-devel, linux-arm-kernel, linux-mediatek, CK Hu, Daniel Vetter,
David Airlie, Matthias Brugger
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 12:48:12 +0200
The drm_property_unreference_blob() function tests whether its argument
is NULL and then returns 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/gpu/drm/mediatek/mtk_drm_crtc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index 24aa3ba..07541d0 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -112,9 +112,7 @@ static void mtk_drm_crtc_reset(struct drm_crtc *crtc)
struct mtk_crtc_state *state;
if (crtc->state) {
- if (crtc->state->mode_blob)
- drm_property_unreference_blob(crtc->state->mode_blob);
-
+ drm_property_unreference_blob(crtc->state->mode_blob);
state = to_mtk_crtc_state(crtc->state);
memset(state, 0, sizeof(*state));
} else {
--
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] 123+ messages in thread
* [PATCH] drm/vmwgfx: Delete an unnecessary check before the function call "vfree"
2015-07-06 8:01 ` SF Markus Elfring
2015-07-08 5:49 ` John Hunter
@ 2016-07-22 11:45 ` SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
2016-07-22 15:33 ` Sinclair Yeh
1 sibling, 2 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-22 11:45 UTC (permalink / raw)
To: linux-graphics-maintainer, dri-devel, David Airlie, Junwang Zhao,
Thomas Hellstrom, Sinclair Yeh
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 13:31:00 +0200
The vfree() 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/vmwgfx/vmwgfx_execbuf.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
index 1a1a87c..dc5beff 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
@@ -3625,9 +3625,7 @@ static int vmw_resize_cmd_bounce(struct vmw_sw_context *sw_context,
(sw_context->cmd_bounce_size >> 1));
}
- if (sw_context->cmd_bounce != NULL)
- vfree(sw_context->cmd_bounce);
-
+ vfree(sw_context->cmd_bounce);
sw_context->cmd_bounce = vmalloc(sw_context->cmd_bounce_size);
if (sw_context->cmd_bounce == NULL) {
--
2.9.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] drm/qxl: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
[not found] ` <5317A59D.4@users.sourceforge.net>
` (32 preceding siblings ...)
2016-07-22 10:56 ` [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob() SF Markus Elfring
@ 2016-07-22 12:22 ` SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
2016-07-22 15:42 ` [PATCH 0/4] GPU-DRM-Etnaviv: Fine-tuning for a few functions SF Markus Elfring
34 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-22 12:22 UTC (permalink / raw)
To: dri-devel@lists.freedesktop.org, Daniel Vetter, David Airlie
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 14:14:54 +0200
The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns 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/gpu/drm/qxl/qxl_display.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index ad42968..3aef127 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -468,8 +468,7 @@ void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb)
{
struct qxl_framebuffer *qxl_fb = to_qxl_framebuffer(fb);
- if (qxl_fb->obj)
- drm_gem_object_unreference_unlocked(qxl_fb->obj);
+ drm_gem_object_unreference_unlocked(qxl_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(qxl_fb);
}
--
2.9.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH] drm/bridge: ps8622: Delete an unnecessary check before backlight_device_unregister()
2015-06-27 18:51 ` [PATCH] drm/bridge: ps8622: Delete a check before backlight_device_unregister() SF Markus Elfring
@ 2016-07-22 12:54 ` SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
0 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-22 12:54 UTC (permalink / raw)
To: dri-devel, Boris Brezillon, Daniel Vetter, David Airlie,
Thierry Reding
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 14:45:51 +0200
The backlight_device_unregister() function tests whether its argument
is NULL and then returns 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/gpu/drm/bridge/parade-ps8622.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c
index 5cd8dd7..583b8ce 100644
--- a/drivers/gpu/drm/bridge/parade-ps8622.c
+++ b/drivers/gpu/drm/bridge/parade-ps8622.c
@@ -636,9 +636,7 @@ static int ps8622_remove(struct i2c_client *client)
{
struct ps8622_bridge *ps8622 = i2c_get_clientdata(client);
- if (ps8622->bl)
- backlight_device_unregister(ps8622->bl);
-
+ backlight_device_unregister(ps8622->bl);
drm_bridge_remove(&ps8622->bridge);
return 0;
--
2.9.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH] drm/mgag200: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
2016-07-22 9:32 ` [PATCH] drm/mgag200: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
@ 2016-07-22 15:25 ` Sean Paul
0 siblings, 0 replies; 123+ messages in thread
From: Sean Paul @ 2016-07-22 15:25 UTC (permalink / raw)
To: SF Markus Elfring
Cc: dri-devel, Daniel Vetter, David Airlie, Julia Lawall,
kernel-janitors, LKML
On Fri, Jul 22, 2016 at 5:32 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Jul 2016 11:20:27 +0200
>
> The drm_gem_object_unreference_unlocked() function tests whether
> its argument is NULL and then returns 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>
Applied to drm-misc
> ---
> drivers/gpu/drm/mgag200/mgag200_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c
> index 615cbb0..13798b3 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_main.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_main.c
> @@ -17,8 +17,8 @@
> static void mga_user_framebuffer_destroy(struct drm_framebuffer *fb)
> {
> struct mga_framebuffer *mga_fb = to_mga_framebuffer(fb);
> - if (mga_fb->obj)
> - drm_gem_object_unreference_unlocked(mga_fb->obj);
> +
> + drm_gem_object_unreference_unlocked(mga_fb->obj);
> drm_framebuffer_cleanup(fb);
> kfree(fb);
> }
> --
> 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] 123+ messages in thread
* Re: [PATCH] drm/vmwgfx: Delete an unnecessary check before the function call "vfree"
2016-07-22 11:45 ` [PATCH] drm/vmwgfx: Delete " SF Markus Elfring
@ 2016-07-22 15:25 ` Sean Paul
2016-07-22 15:33 ` Sinclair Yeh
1 sibling, 0 replies; 123+ messages in thread
From: Sean Paul @ 2016-07-22 15:25 UTC (permalink / raw)
To: SF Markus Elfring
Cc: linux-graphics-maintainer, dri-devel, David Airlie, Junwang Zhao,
Thomas Hellstrom, Sinclair Yeh, Julia Lawall, kernel-janitors,
LKML
On Fri, Jul 22, 2016 at 7:45 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Jul 2016 13:31:00 +0200
>
> The vfree() 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/vmwgfx/vmwgfx_execbuf.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> index 1a1a87c..dc5beff 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> @@ -3625,9 +3625,7 @@ static int vmw_resize_cmd_bounce(struct vmw_sw_context *sw_context,
> (sw_context->cmd_bounce_size >> 1));
> }
>
> - if (sw_context->cmd_bounce != NULL)
> - vfree(sw_context->cmd_bounce);
> -
> + vfree(sw_context->cmd_bounce);
> sw_context->cmd_bounce = vmalloc(sw_context->cmd_bounce_size);
>
> if (sw_context->cmd_bounce == NULL) {
> --
> 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] 123+ messages in thread
* Re: [PATCH] drm/qxl: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
2016-07-22 12:22 ` [PATCH] drm/qxl: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
@ 2016-07-22 15:25 ` Sean Paul
0 siblings, 0 replies; 123+ messages in thread
From: Sean Paul @ 2016-07-22 15:25 UTC (permalink / raw)
To: SF Markus Elfring
Cc: dri-devel@lists.freedesktop.org, Daniel Vetter, David Airlie,
Julia Lawall, kernel-janitors, LKML
On Fri, Jul 22, 2016 at 8:22 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Jul 2016 14:14:54 +0200
>
> The drm_gem_object_unreference_unlocked() function tests whether
> its argument is NULL and then returns 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>
Applied to drm-misc
> ---
> drivers/gpu/drm/qxl/qxl_display.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> index ad42968..3aef127 100644
> --- a/drivers/gpu/drm/qxl/qxl_display.c
> +++ b/drivers/gpu/drm/qxl/qxl_display.c
> @@ -468,8 +468,7 @@ void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb)
> {
> struct qxl_framebuffer *qxl_fb = to_qxl_framebuffer(fb);
>
> - if (qxl_fb->obj)
> - drm_gem_object_unreference_unlocked(qxl_fb->obj);
> + drm_gem_object_unreference_unlocked(qxl_fb->obj);
> drm_framebuffer_cleanup(fb);
> kfree(qxl_fb);
> }
> --
> 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] 123+ messages in thread
* Re: [PATCH] drm/bridge: ps8622: Delete an unnecessary check before backlight_device_unregister()
2016-07-22 12:54 ` [PATCH] drm/bridge: ps8622: Delete an unnecessary " SF Markus Elfring
@ 2016-07-22 15:25 ` Sean Paul
0 siblings, 0 replies; 123+ messages in thread
From: Sean Paul @ 2016-07-22 15:25 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Daniel Vetter, kernel-janitors, LKML, dri-devel, Julia Lawall,
Thierry Reding
On Fri, Jul 22, 2016 at 8:54 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Jul 2016 14:45:51 +0200
>
> The backlight_device_unregister() function tests whether its argument
> is NULL and then returns 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>
Applied to drm-misc
> ---
> drivers/gpu/drm/bridge/parade-ps8622.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c
> index 5cd8dd7..583b8ce 100644
> --- a/drivers/gpu/drm/bridge/parade-ps8622.c
> +++ b/drivers/gpu/drm/bridge/parade-ps8622.c
> @@ -636,9 +636,7 @@ static int ps8622_remove(struct i2c_client *client)
> {
> struct ps8622_bridge *ps8622 = i2c_get_clientdata(client);
>
> - if (ps8622->bl)
> - backlight_device_unregister(ps8622->bl);
> -
> + backlight_device_unregister(ps8622->bl);
> drm_bridge_remove(&ps8622->bridge);
>
> return 0;
> --
> 2.9.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH] drm/vmwgfx: Delete an unnecessary check before the function call "vfree"
2016-07-22 11:45 ` [PATCH] drm/vmwgfx: Delete " SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
@ 2016-07-22 15:33 ` Sinclair Yeh
1 sibling, 0 replies; 123+ messages in thread
From: Sinclair Yeh @ 2016-07-22 15:33 UTC (permalink / raw)
To: SF Markus Elfring
Cc: linux-graphics-maintainer, dri-devel, David Airlie, Junwang Zhao,
Thomas Hellstrom, LKML, kernel-janitors, Julia Lawall
Looks good. Thanks!
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
On Fri, Jul 22, 2016 at 01:45:40PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Jul 2016 13:31:00 +0200
>
> The vfree() 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/vmwgfx/vmwgfx_execbuf.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> index 1a1a87c..dc5beff 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> @@ -3625,9 +3625,7 @@ static int vmw_resize_cmd_bounce(struct vmw_sw_context *sw_context,
> (sw_context->cmd_bounce_size >> 1));
> }
>
> - if (sw_context->cmd_bounce != NULL)
> - vfree(sw_context->cmd_bounce);
> -
> + vfree(sw_context->cmd_bounce);
> sw_context->cmd_bounce = vmalloc(sw_context->cmd_bounce_size);
>
> if (sw_context->cmd_bounce == NULL) {
> --
> 2.9.2
>
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH 0/4] GPU-DRM-Etnaviv: Fine-tuning for a few functions
[not found] ` <5317A59D.4@users.sourceforge.net>
` (33 preceding siblings ...)
2016-07-22 12:22 ` [PATCH] drm/qxl: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
@ 2016-07-22 15:42 ` SF Markus Elfring
2016-07-22 15:47 ` [PATCH 1/4] GPU-DRM-Etnaviv: Delete unnecessary checks before two function calls SF Markus Elfring
` (3 more replies)
34 siblings, 4 replies; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-22 15:42 UTC (permalink / raw)
To: dri-devel, Christian Gmeiner, David Airlie, Lucas Stach,
Russell King
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 17:34:32 +0200
Further update suggestions were taken into account
after a patch was applied from static source code analysis.
Markus Elfring (4):
Delete unnecessary checks before two function calls
Delete unnecessary if statement in __etnaviv_gem_new()
Rename jump labels
Optimize error handling in etnaviv_gem_new_userptr()
drivers/gpu/drm/etnaviv/etnaviv_gem.c | 36 +++++++++++++----------------------
1 file changed, 13 insertions(+), 23 deletions(-)
--
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] 123+ messages in thread
* [PATCH 1/4] GPU-DRM-Etnaviv: Delete unnecessary checks before two function calls
2016-07-22 15:42 ` [PATCH 0/4] GPU-DRM-Etnaviv: Fine-tuning for a few functions SF Markus Elfring
@ 2016-07-22 15:47 ` SF Markus Elfring
2016-07-22 17:53 ` Sean Paul
2016-07-22 15:48 ` [PATCH 2/4] GPU-DRM-Etnaviv: Delete unnecessary if statement in __etnaviv_gem_new() SF Markus Elfring
` (2 subsequent siblings)
3 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-22 15:47 UTC (permalink / raw)
To: dri-devel, Christian Gmeiner, David Airlie, Lucas Stach,
Russell King
Cc: Julia Lawall, kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 15:56:15 +0200
The functions drm_gem_object_unreference_unlocked() and vunmap() perform
also input parameter validation.
Thus the tests around their calls are not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/etnaviv/etnaviv_gem.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index 8c6f750..8eee742 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -535,8 +535,7 @@ void etnaviv_gem_describe_objects(struct etnaviv_drm_private *priv,
static void etnaviv_gem_shmem_release(struct etnaviv_gem_object *etnaviv_obj)
{
- if (etnaviv_obj->vaddr)
- vunmap(etnaviv_obj->vaddr);
+ vunmap(etnaviv_obj->vaddr);
put_pages(etnaviv_obj);
}
@@ -670,9 +669,7 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
return obj;
fail:
- if (obj)
- drm_gem_object_unreference_unlocked(obj);
-
+ drm_gem_object_unreference_unlocked(obj);
return ERR_PTR(ret);
}
--
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] 123+ messages in thread
* [PATCH 2/4] GPU-DRM-Etnaviv: Delete unnecessary if statement in __etnaviv_gem_new()
2016-07-22 15:42 ` [PATCH 0/4] GPU-DRM-Etnaviv: Fine-tuning for a few functions SF Markus Elfring
2016-07-22 15:47 ` [PATCH 1/4] GPU-DRM-Etnaviv: Delete unnecessary checks before two function calls SF Markus Elfring
@ 2016-07-22 15:48 ` SF Markus Elfring
2016-07-22 16:41 ` walter harms
2016-07-22 15:50 ` [PATCH 3/4] GPU-DRM-Etnaviv: Rename jump labels SF Markus Elfring
2016-07-22 15:51 ` [PATCH 4/4] GPU-DRM-Etnaviv: Optimize error handling in etnaviv_gem_new_userptr() SF Markus Elfring
3 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-22 15:48 UTC (permalink / raw)
To: dri-devel, Christian Gmeiner, David Airlie, Lucas Stach,
Russell King
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 16:45:22 +0200
Move a return statement into a block for successful function execution.
Omit a duplicate check for the local variable "ret" then at the end.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/etnaviv/etnaviv_gem.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index 8eee742..851a8ba 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -661,13 +661,9 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
*/
mapping = obj->filp->f_mapping;
mapping_set_gfp_mask(mapping, GFP_HIGHUSER);
+ return obj;
}
- if (ret)
- goto fail;
-
- return obj;
-
fail:
drm_gem_object_unreference_unlocked(obj);
return ERR_PTR(ret);
--
2.9.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 3/4] GPU-DRM-Etnaviv: Rename jump labels
2016-07-22 15:42 ` [PATCH 0/4] GPU-DRM-Etnaviv: Fine-tuning for a few functions SF Markus Elfring
2016-07-22 15:47 ` [PATCH 1/4] GPU-DRM-Etnaviv: Delete unnecessary checks before two function calls SF Markus Elfring
2016-07-22 15:48 ` [PATCH 2/4] GPU-DRM-Etnaviv: Delete unnecessary if statement in __etnaviv_gem_new() SF Markus Elfring
@ 2016-07-22 15:50 ` SF Markus Elfring
2016-07-22 17:45 ` Sean Paul
2016-07-22 15:51 ` [PATCH 4/4] GPU-DRM-Etnaviv: Optimize error handling in etnaviv_gem_new_userptr() SF Markus Elfring
3 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-22 15:50 UTC (permalink / raw)
To: dri-devel, Christian Gmeiner, David Airlie, Lucas Stach,
Russell King
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 16:51:00 +0200
Adjust jump targets according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/etnaviv/etnaviv_gem.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index 851a8ba..0a5c00c 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -308,17 +308,17 @@ struct etnaviv_vram_mapping *etnaviv_gem_mapping_get(
mapping = NULL;
mutex_unlock(&gpu->mmu->lock);
if (mapping)
- goto out;
+ goto unlock;
} else {
mapping->use += 1;
- goto out;
+ goto unlock;
}
}
pages = etnaviv_gem_get_pages(etnaviv_obj);
if (IS_ERR(pages)) {
ret = PTR_ERR(pages);
- goto out;
+ goto unlock;
}
/*
@@ -330,7 +330,7 @@ struct etnaviv_vram_mapping *etnaviv_gem_mapping_get(
mapping = kzalloc(sizeof(*mapping), GFP_KERNEL);
if (!mapping) {
ret = -ENOMEM;
- goto out;
+ goto unlock;
}
INIT_LIST_HEAD(&mapping->scan_node);
@@ -349,7 +349,7 @@ struct etnaviv_vram_mapping *etnaviv_gem_mapping_get(
else
list_add_tail(&mapping->obj_node, &etnaviv_obj->vram_list);
-out:
+unlock:
mutex_unlock(&etnaviv_obj->lock);
if (ret)
@@ -646,7 +646,7 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
ret = etnaviv_gem_new_impl(dev, size, flags, NULL,
&etnaviv_gem_shmem_ops, &obj);
if (ret)
- goto fail;
+ goto unreference;
ret = drm_gem_object_init(dev, obj, size);
if (ret == 0) {
@@ -664,7 +664,7 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
return obj;
}
-fail:
+unreference:
drm_gem_object_unreference_unlocked(obj);
return ERR_PTR(ret);
}
--
2.9.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [PATCH 4/4] GPU-DRM-Etnaviv: Optimize error handling in etnaviv_gem_new_userptr()
2016-07-22 15:42 ` [PATCH 0/4] GPU-DRM-Etnaviv: Fine-tuning for a few functions SF Markus Elfring
` (2 preceding siblings ...)
2016-07-22 15:50 ` [PATCH 3/4] GPU-DRM-Etnaviv: Rename jump labels SF Markus Elfring
@ 2016-07-22 15:51 ` SF Markus Elfring
2016-07-22 17:54 ` Sean Paul
3 siblings, 1 reply; 123+ messages in thread
From: SF Markus Elfring @ 2016-07-22 15:51 UTC (permalink / raw)
To: dri-devel, Christian Gmeiner, David Airlie, Lucas Stach,
Russell King
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 17:17:48 +0200
Refactor this function implementation so that the
drm_gem_object_unreference_unlocked() function will only be called once
in case of a failure according to the Linux coding style recommendation
for centralized exiting of functions.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/etnaviv/etnaviv_gem.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index 0a5c00c..007577c 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -909,15 +909,12 @@ int etnaviv_gem_new_userptr(struct drm_device *dev, struct drm_file *file,
get_task_struct(current);
ret = etnaviv_gem_obj_add(dev, &etnaviv_obj->base);
- if (ret) {
- drm_gem_object_unreference_unlocked(&etnaviv_obj->base);
- return ret;
- }
+ if (ret)
+ goto unreference;
ret = drm_gem_handle_create(file, &etnaviv_obj->base, handle);
-
+unreference:
/* drop reference from allocate - handle holds it now */
drm_gem_object_unreference_unlocked(&etnaviv_obj->base);
-
return ret;
}
--
2.9.2
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH 2/4] GPU-DRM-Etnaviv: Delete unnecessary if statement in __etnaviv_gem_new()
2016-07-22 15:48 ` [PATCH 2/4] GPU-DRM-Etnaviv: Delete unnecessary if statement in __etnaviv_gem_new() SF Markus Elfring
@ 2016-07-22 16:41 ` walter harms
2016-07-22 17:44 ` [PATCH] drm/etnaviv: Improve readability in __etnaviv_gem_new Sean Paul
0 siblings, 1 reply; 123+ messages in thread
From: walter harms @ 2016-07-22 16:41 UTC (permalink / raw)
To: SF Markus Elfring
Cc: dri-devel, Christian Gmeiner, David Airlie, Lucas Stach,
Russell King, LKML, kernel-janitors, Julia Lawall
Am 22.07.2016 17:48, schrieb SF Markus Elfring:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Jul 2016 16:45:22 +0200
>
> Move a return statement into a block for successful function execution.
> Omit a duplicate check for the local variable "ret" then at the end.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/gpu/drm/etnaviv/etnaviv_gem.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> index 8eee742..851a8ba 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> @@ -661,13 +661,9 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
> */
> mapping = obj->filp->f_mapping;
> mapping_set_gfp_mask(mapping, GFP_HIGHUSER);
> + return obj;
> }
>
> - if (ret)
> - goto fail;
> -
> - return obj;
> -
> fail:
> drm_gem_object_unreference_unlocked(obj);
> return ERR_PTR(ret);
>From the program flow an readability it would be more nice the branch on error
ret = drm_gem_object_init(dev, obj, size);
if (ret)
goto fail;
just m 2 cents
re,
wh
^ permalink raw reply [flat|nested] 123+ messages in thread
* [PATCH] drm/etnaviv: Improve readability in __etnaviv_gem_new
2016-07-22 16:41 ` walter harms
@ 2016-07-22 17:44 ` Sean Paul
0 siblings, 0 replies; 123+ messages in thread
From: Sean Paul @ 2016-07-22 17:44 UTC (permalink / raw)
To: elfring, wharms
Cc: dri-devel, kernel-janitors, linux-kernel, julia.lawall, linux,
Sean Paul
Move things around a little in __etnaviv_gem_new() to make it
more readable.
Reported-by: Markus Elfring <elfring@users.sourceforge.net>
Reported-by: walter harms <wharms@bfs.de>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
drivers/gpu/drm/etnaviv/etnaviv_gem.c | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index df9bcba..7d13628 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -640,6 +640,7 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
u32 size, u32 flags)
{
struct drm_gem_object *obj = NULL;
+ struct address_space *mapping;
int ret;
size = PAGE_ALIGN(size);
@@ -650,23 +651,19 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
goto fail;
ret = drm_gem_object_init(dev, obj, size);
- if (ret == 0) {
- struct address_space *mapping;
-
- /*
- * Our buffers are kept pinned, so allocating them
- * from the MOVABLE zone is a really bad idea, and
- * conflicts with CMA. See coments above new_inode()
- * why this is required _and_ expected if you're
- * going to pin these pages.
- */
- mapping = file_inode(obj->filp)->i_mapping;
- mapping_set_gfp_mask(mapping, GFP_HIGHUSER);
- }
-
if (ret)
goto fail;
+ /*
+ * Our buffers are kept pinned, so allocating them
+ * from the MOVABLE zone is a really bad idea, and
+ * conflicts with CMA. See coments above new_inode()
+ * why this is required _and_ expected if you're
+ * going to pin these pages.
+ */
+ mapping = file_inode(obj->filp)->i_mapping;
+ mapping_set_gfp_mask(mapping, GFP_HIGHUSER);
+
return obj;
fail:
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related [flat|nested] 123+ messages in thread
* Re: [PATCH 3/4] GPU-DRM-Etnaviv: Rename jump labels
2016-07-22 15:50 ` [PATCH 3/4] GPU-DRM-Etnaviv: Rename jump labels SF Markus Elfring
@ 2016-07-22 17:45 ` Sean Paul
0 siblings, 0 replies; 123+ messages in thread
From: Sean Paul @ 2016-07-22 17:45 UTC (permalink / raw)
To: SF Markus Elfring
Cc: kernel-janitors, LKML, dri-devel, Julia Lawall, Russell King
On Fri, Jul 22, 2016 at 11:50 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Jul 2016 16:51:00 +0200
>
> Adjust jump targets according to the Linux coding style convention.
>
I'm not convinced the old labels are really that bad, tbh.
Sean
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/gpu/drm/etnaviv/etnaviv_gem.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> index 851a8ba..0a5c00c 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> @@ -308,17 +308,17 @@ struct etnaviv_vram_mapping *etnaviv_gem_mapping_get(
> mapping = NULL;
> mutex_unlock(&gpu->mmu->lock);
> if (mapping)
> - goto out;
> + goto unlock;
> } else {
> mapping->use += 1;
> - goto out;
> + goto unlock;
> }
> }
>
> pages = etnaviv_gem_get_pages(etnaviv_obj);
> if (IS_ERR(pages)) {
> ret = PTR_ERR(pages);
> - goto out;
> + goto unlock;
> }
>
> /*
> @@ -330,7 +330,7 @@ struct etnaviv_vram_mapping *etnaviv_gem_mapping_get(
> mapping = kzalloc(sizeof(*mapping), GFP_KERNEL);
> if (!mapping) {
> ret = -ENOMEM;
> - goto out;
> + goto unlock;
> }
>
> INIT_LIST_HEAD(&mapping->scan_node);
> @@ -349,7 +349,7 @@ struct etnaviv_vram_mapping *etnaviv_gem_mapping_get(
> else
> list_add_tail(&mapping->obj_node, &etnaviv_obj->vram_list);
>
> -out:
> +unlock:
> mutex_unlock(&etnaviv_obj->lock);
>
> if (ret)
> @@ -646,7 +646,7 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
> ret = etnaviv_gem_new_impl(dev, size, flags, NULL,
> &etnaviv_gem_shmem_ops, &obj);
> if (ret)
> - goto fail;
> + goto unreference;
>
> ret = drm_gem_object_init(dev, obj, size);
> if (ret == 0) {
> @@ -664,7 +664,7 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
> return obj;
> }
>
> -fail:
> +unreference:
> drm_gem_object_unreference_unlocked(obj);
> return ERR_PTR(ret);
> }
> --
> 2.9.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH 1/4] GPU-DRM-Etnaviv: Delete unnecessary checks before two function calls
2016-07-22 15:47 ` [PATCH 1/4] GPU-DRM-Etnaviv: Delete unnecessary checks before two function calls SF Markus Elfring
@ 2016-07-22 17:53 ` Sean Paul
0 siblings, 0 replies; 123+ messages in thread
From: Sean Paul @ 2016-07-22 17:53 UTC (permalink / raw)
To: SF Markus Elfring
Cc: dri-devel, Christian Gmeiner, David Airlie, Lucas Stach,
Russell King, Julia Lawall, kernel-janitors, LKML
On Fri, Jul 22, 2016 at 11:47 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Jul 2016 15:56:15 +0200
>
> The functions drm_gem_object_unreference_unlocked() and vunmap() perform
> also input parameter validation.
> Thus the tests around their calls are not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Applied to drm-misc. In the future, could you please format your
subjects starting with "drm/<driver>"? I've fixed this one and the
next, but it'd be nice not to have to do that going forward.
> ---
> drivers/gpu/drm/etnaviv/etnaviv_gem.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> index 8c6f750..8eee742 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> @@ -535,8 +535,7 @@ void etnaviv_gem_describe_objects(struct etnaviv_drm_private *priv,
>
> static void etnaviv_gem_shmem_release(struct etnaviv_gem_object *etnaviv_obj)
> {
> - if (etnaviv_obj->vaddr)
> - vunmap(etnaviv_obj->vaddr);
> + vunmap(etnaviv_obj->vaddr);
> put_pages(etnaviv_obj);
> }
>
> @@ -670,9 +669,7 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
> return obj;
>
> fail:
> - if (obj)
> - drm_gem_object_unreference_unlocked(obj);
> -
> + drm_gem_object_unreference_unlocked(obj);
> return ERR_PTR(ret);
> }
>
> --
> 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] 123+ messages in thread
* Re: [PATCH 4/4] GPU-DRM-Etnaviv: Optimize error handling in etnaviv_gem_new_userptr()
2016-07-22 15:51 ` [PATCH 4/4] GPU-DRM-Etnaviv: Optimize error handling in etnaviv_gem_new_userptr() SF Markus Elfring
@ 2016-07-22 17:54 ` Sean Paul
0 siblings, 0 replies; 123+ messages in thread
From: Sean Paul @ 2016-07-22 17:54 UTC (permalink / raw)
To: SF Markus Elfring
Cc: kernel-janitors, LKML, dri-devel, Julia Lawall, Russell King
On Fri, Jul 22, 2016 at 11:51 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Jul 2016 17:17:48 +0200
>
> Refactor this function implementation so that the
> drm_gem_object_unreference_unlocked() function will only be called once
> in case of a failure according to the Linux coding style recommendation
> for centralized exiting of functions.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Applied to drm-misc. In the future, could you please format your
subjects starting with "drm/<driver>"? I've fixed this one and the
first, but it'd be nice not to have to do that going forward.
Sean
> ---
> drivers/gpu/drm/etnaviv/etnaviv_gem.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> index 0a5c00c..007577c 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> @@ -909,15 +909,12 @@ int etnaviv_gem_new_userptr(struct drm_device *dev, struct drm_file *file,
> get_task_struct(current);
>
> ret = etnaviv_gem_obj_add(dev, &etnaviv_obj->base);
> - if (ret) {
> - drm_gem_object_unreference_unlocked(&etnaviv_obj->base);
> - return ret;
> - }
> + if (ret)
> + goto unreference;
>
> ret = drm_gem_handle_create(file, &etnaviv_obj->base, handle);
> -
> +unreference:
> /* drop reference from allocate - handle holds it now */
> drm_gem_object_unreference_unlocked(&etnaviv_obj->base);
> -
> return ret;
> }
> --
> 2.9.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()
2016-07-22 10:56 ` [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob() SF Markus Elfring
@ 2016-07-25 8:43 ` Matthias Brugger
0 siblings, 0 replies; 123+ messages in thread
From: Matthias Brugger @ 2016-07-25 8:43 UTC (permalink / raw)
To: SF Markus Elfring, dri-devel, linux-arm-kernel, linux-mediatek,
CK Hu, Daniel Vetter, David Airlie
Cc: LKML, kernel-janitors, Julia Lawall
On 22/07/16 12:56, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Jul 2016 12:48:12 +0200
>
> The drm_property_unreference_blob() function tests whether its argument
> is NULL and then returns 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/gpu/drm/mediatek/mtk_drm_crtc.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index 24aa3ba..07541d0 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -112,9 +112,7 @@ static void mtk_drm_crtc_reset(struct drm_crtc *crtc)
> struct mtk_crtc_state *state;
>
> if (crtc->state) {
> - if (crtc->state->mode_blob)
> - drm_property_unreference_blob(crtc->state->mode_blob);
> -
> + drm_property_unreference_blob(crtc->state->mode_blob);
> state = to_mtk_crtc_state(crtc->state);
> memset(state, 0, sizeof(*state));
> } else {
>
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH] GPU-DRM-Radeon: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
2016-07-12 20:22 ` [PATCH] GPU-DRM-Radeon: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
@ 2016-07-28 15:58 ` Alex Deucher
0 siblings, 0 replies; 123+ messages in thread
From: Alex Deucher @ 2016-07-28 15:58 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Alex Deucher, Christian König, David Airlie,
Maling list - DRI developers, Julia Lawall, kernel-janitors, LKML
On Tue, Jul 12, 2016 at 4:22 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 12 Jul 2016 22:00:55 +0200
>
> The drm_gem_object_unreference_unlocked() function tests whether
> its argument is NULL and then returns 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>
Applied. thanks!
Alex
> ---
> drivers/gpu/drm/radeon/radeon_display.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
> index 5f1cd69..1efab5f 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -1324,9 +1324,7 @@ static void radeon_user_framebuffer_destroy(struct drm_framebuffer *fb)
> {
> struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb);
>
> - if (radeon_fb->obj) {
> - drm_gem_object_unreference_unlocked(radeon_fb->obj);
> - }
> + drm_gem_object_unreference_unlocked(radeon_fb->obj);
> drm_framebuffer_cleanup(fb);
> kfree(radeon_fb);
> }
> --
> 2.9.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 123+ messages in thread
* Re: [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations
2016-07-18 7:41 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations Christian König
@ 2016-07-28 16:10 ` Alex Deucher
0 siblings, 0 replies; 123+ messages in thread
From: Alex Deucher @ 2016-07-28 16:10 UTC (permalink / raw)
To: Christian König
Cc: SF Markus Elfring, Maling list - DRI developers, David Airlie,
Alex Deucher, Julia Lawall, kernel-janitors, LKML
On Mon, Jul 18, 2016 at 3:41 AM, Christian König
<christian.koenig@amd.com> wrote:
> Am 16.07.2016 um 16:33 schrieb SF Markus Elfring:
>>
>> From: Markus Elfring <elfring@users.sourceforge.net>
>> Date: Sat, 16 Jul 2016 16:23:21 +0200
>>
>> Further update suggestions were taken into account after patches
>> were applied from static source code analysis.
>
>
> Small coding style nit pick on patch #7:
>>
>> - }
>> + } else
>> + temp_storage = NULL;
>
> When an "if" has "{" and "}" the else should also use them even when it is
> only one line.
>
> With that fixed the whole series is Reviewed-by: Christian König
> <christian.koenig@amd.com>, but as Walter Harms pointed out as well there
> are a couple of other things we could make more as well.
Applied the series except patch 2 was which already fixed by an earlier patch.
Thanks!
Alex
>
> Regards,
> Christian.
>
>>
>> Markus Elfring (8):
>> Delete an unnecessary check before
>> drm_gem_object_unreference_unlocked()
>> Delete unnecessary checks before the function call "kfree"
>> One function call less in amdgpu_cgs_acpi_eval_object() after error
>> detection
>> Delete a variable in amdgpu_cgs_acpi_eval_object()
>> Delete an unnecessary variable initialisation in
>> amdgpu_cgs_acpi_eval_object()
>> Change assignment for a variable in amdgpu_cgs_acpi_eval_object()
>> Change assignment for a buffer variable in phm_dispatch_table()
>> Delete an unnecessary variable initialisation in phm_dispatch_table()
>>
>> drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 28
>> ++++++++++------------
>> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 +---
>> .../gpu/drm/amd/powerplay/hwmgr/functiontables.c | 12 ++++------
>> 3 files changed, 19 insertions(+), 25 deletions(-)
>>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 123+ messages in thread
end of thread, other threads:[~2016-07-28 16:10 UTC | newest]
Thread overview: 123+ 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-10-22 14:30 ` [PATCH 1/1] GPU-DRM-nouveau: Deletion of unnecessary checks before two function calls SF Markus Elfring
2015-07-05 18:22 ` [PATCH] GPU-DRM-nouveau: Delete " SF Markus Elfring
2016-07-20 17:50 ` [PATCH] GPU-DRM-nouveau: Delete an unnecessary check before the function call "pci_dev_put" SF Markus Elfring
2014-10-22 16:48 ` [PATCH 1/1] GPU-DRM-GMA500: Deletion of unnecessary checks before two function calls SF Markus Elfring
2014-10-23 11:26 ` One Thousand Gnomes
2014-10-26 12:10 ` SF Markus Elfring
2014-10-26 14:56 ` Arthur Borsboom
2016-07-22 8:45 ` [PATCH] GPU-DRM-GMA500: Delete " SF Markus Elfring
2016-07-22 9:32 ` Daniel Vetter
2014-11-19 15:40 ` [PATCH 1/1] DRM-EDID: Deletion of an unnecessary check before the function call "release_firmware" SF Markus Elfring
2014-11-20 4:03 ` Thierry Reding
2014-11-19 16:14 ` [PATCH 1/1] DRM-tilcdc: Deletion of an unnecessary check before the function call "drm_fbdev_cma_hotplug_event" SF Markus Elfring
2014-11-20 4:11 ` Thierry Reding
2014-11-19 16:37 ` [PATCH 1/1] DRM-UDL: Deletion of an unnecessary check before the function call "vunmap" SF Markus Elfring
2014-11-20 4:17 ` Thierry Reding
2014-11-19 16:55 ` [PATCH 1/1] DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree" SF Markus Elfring
2014-11-20 4:22 ` Thierry Reding
2015-07-06 8:01 ` SF Markus Elfring
2015-07-08 5:49 ` John Hunter
2015-07-08 16:55 ` SF Markus Elfring
2015-07-09 0:08 ` John Hunter
2016-07-22 11:45 ` [PATCH] drm/vmwgfx: Delete " SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
2016-07-22 15:33 ` Sinclair Yeh
2014-11-25 12:50 ` [PATCH 1/1] GPU-DRM-MSM-Adreno: Deletion of unnecessary checks before the function call "release_firmware" SF Markus Elfring
2014-12-01 16:01 ` Thierry Reding
2014-11-25 13:33 ` [PATCH 1/1] GPU-DRM-MSM: Deletion of unnecessary checks before two function calls SF Markus Elfring
2014-12-01 16:04 ` Thierry Reding
2014-12-01 16:09 ` Rob Clark
2014-12-01 16:14 ` Rob Clark
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
2015-02-04 21:25 ` [PATCH] GPU-DRM-OMAP: Delete unnecessary checks before two function calls SF Markus Elfring
2016-07-22 6:45 ` SF Markus Elfring
2015-02-05 9:20 ` [PATCH] GPU-DRM-Tegra: Delete an unnecessary check before the function call "vunmap" SF Markus Elfring
2015-07-08 18:40 ` SF Markus Elfring
2015-07-13 14:16 ` Alexandre Courbot
2016-07-16 5:30 ` [PATCH] drm/tegra: " SF Markus Elfring
2015-06-27 18:51 ` [PATCH] drm/bridge: ps8622: Delete a check before backlight_device_unregister() SF Markus Elfring
2016-07-22 12:54 ` [PATCH] drm/bridge: ps8622: Delete an unnecessary " SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
2015-06-27 21:16 ` [PATCH 0/2] drm/msm/dsi: Deletion of an unnecessary check SF Markus Elfring
2015-06-27 21:20 ` [PATCH 1/2] drm/msm/dsi: Delete an unnecessary check before the function call "dsi_destroy" SF Markus Elfring
2015-06-27 21:23 ` [PATCH 2/2] drm/msm/dsi: One function call less in dsi_init() after error detection SF Markus Elfring
2015-06-28 8:45 ` [PATCH] drm/amdgpu: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2015-06-29 15:30 ` Alex Deucher
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
2016-07-16 14:45 ` [PATCH 1/8] drm/amdgpu: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-16 14:48 ` [PATCH 2/8] drm/amdgpu/powerplay: Delete unnecessary checks before the function call "kfree" SF Markus Elfring
2016-07-16 14:50 ` [PATCH 3/8] drm/amdgpu: One function call less in amdgpu_cgs_acpi_eval_object() after error detection SF Markus Elfring
2016-07-16 14:54 ` [PATCH 4/8] drm/amdgpu: Delete a variable in amdgpu_cgs_acpi_eval_object() SF Markus Elfring
2016-07-16 14:56 ` [PATCH 5/8] drm/amdgpu: Delete an unnecessary variable initialisation " SF Markus Elfring
2016-07-16 15:00 ` SF Markus Elfring
2016-07-16 15:05 ` [PATCH 6/8] drm/amdgpu: Change assignment for a variable " SF Markus Elfring
2016-07-16 15:08 ` [PATCH 7/8] drm/amd/powerplay: Change assignment for a buffer variable in phm_dispatch_table() SF Markus Elfring
2016-07-17 15:03 ` walter harms
2016-07-16 15:10 ` [PATCH 8/8] drm/amd/powerplay: Delete an unnecessary variable initialisation " SF Markus Elfring
2016-07-18 7:41 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations Christian König
2016-07-28 16:10 ` Alex Deucher
2015-07-05 20:00 ` [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob() SF Markus Elfring
2015-07-06 2:01 ` John Hunter
2015-07-06 6:53 ` Daniel Vetter
2015-11-06 11:13 ` [PATCH] GPU-DRM: Delete unnecessary checks " SF Markus Elfring
2015-11-16 14:04 ` Daniel Vetter
2016-07-20 16:02 ` [PATCH] drm/atomic: Delete an unnecessary check " SF Markus Elfring
2016-07-20 17:29 ` Sean Paul
2015-07-05 20:50 ` [PATCH] GPU-DRM-IMX: Delete an unnecessary check before drm_fbdev_cma_restore_mode() SF Markus Elfring
2015-11-20 12:53 ` Philipp Zabel
2015-11-06 12:43 ` [PATCH] GPU-DRM-i915: Delete an unnecessary check before the function call "pwm_put" SF Markus Elfring
2015-11-06 12:52 ` Jani Nikula
2015-11-06 12:55 ` SF Markus Elfring
2015-11-06 13:17 ` Jani Nikula
2015-11-06 13:45 ` [PATCH] GPU-DRM-ps8622: Delete an unnecessary check before backlight_device_unregister() SF Markus Elfring
2015-11-06 14:05 ` [PATCH] HDMI-HDCP: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2015-11-06 15:08 ` [PATCH] GPU-DRM-vc4: Delete unnecessary checks before two function calls SF Markus Elfring
2016-07-15 19:21 ` [PATCH] drm/vc4: " SF Markus Elfring
2015-11-16 14:45 ` [PATCH] GPU-DRM-TTM: Delete an unnecessary check before the function call "ttm_tt_destroy" SF Markus Elfring
2016-07-15 18:28 ` [PATCH] drm/ttm: " SF Markus Elfring
2016-07-18 7:12 ` Daniel Vetter
2016-07-18 14:10 ` [PATCH v3] " SF Markus Elfring
2016-07-18 14:45 ` Daniel Vetter
2016-07-18 17:00 ` SF Markus Elfring
2016-07-19 8:14 ` [PATCH v3] " Geert Uytterhoeven
2016-07-19 8:21 ` Daniel Vetter
2016-07-12 20:22 ` [PATCH] GPU-DRM-Radeon: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-28 15:58 ` Alex Deucher
2016-07-13 17:54 ` [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks SF Markus Elfring
2016-07-13 18:00 ` [PATCH 1/3] drm/msm/hdmi: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2016-07-13 18:01 ` [PATCH 2/3] drm/msm: Delete unnecessary checks before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-13 18:02 ` [PATCH 3/3] drm/msm: Delete an unnecessary check before drm_gem_object_unreference() SF Markus Elfring
2016-07-15 2:08 ` [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks Rob Clark
2016-07-15 12:30 ` [PATCH] drm/bochs: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-15 13:35 ` [PATCH] drm/rockchip: " SF Markus Elfring
2016-07-19 1:59 ` Mark yao
2016-07-15 20:00 ` [PATCH] drm/arcpgu: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
2016-07-19 18:04 ` Alexey Brodkin
2016-07-15 20:44 ` [PATCH] drm/virtgpu: Delete unnecessary checks before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-16 6:40 ` [PATCH] drm/cirrus: Delete an unnecessary check " SF Markus Elfring
2016-07-16 7:20 ` [PATCH] drm/hdlcd: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
2016-07-18 9:21 ` Liviu Dudau
2016-07-16 8:04 ` [PATCH] drm/ast: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-18 6:53 ` Daniel Vetter
2016-07-20 16:40 ` [PATCH] GPU-DRM-sun4i: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
2016-07-20 17:47 ` Daniel Vetter
2016-07-22 9:32 ` [PATCH] drm/mgag200: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
2016-07-22 10:56 ` [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob() SF Markus Elfring
2016-07-25 8:43 ` Matthias Brugger
2016-07-22 12:22 ` [PATCH] drm/qxl: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
2016-07-22 15:42 ` [PATCH 0/4] GPU-DRM-Etnaviv: Fine-tuning for a few functions SF Markus Elfring
2016-07-22 15:47 ` [PATCH 1/4] GPU-DRM-Etnaviv: Delete unnecessary checks before two function calls SF Markus Elfring
2016-07-22 17:53 ` Sean Paul
2016-07-22 15:48 ` [PATCH 2/4] GPU-DRM-Etnaviv: Delete unnecessary if statement in __etnaviv_gem_new() SF Markus Elfring
2016-07-22 16:41 ` walter harms
2016-07-22 17:44 ` [PATCH] drm/etnaviv: Improve readability in __etnaviv_gem_new Sean Paul
2016-07-22 15:50 ` [PATCH 3/4] GPU-DRM-Etnaviv: Rename jump labels SF Markus Elfring
2016-07-22 17:45 ` Sean Paul
2016-07-22 15:51 ` [PATCH 4/4] GPU-DRM-Etnaviv: Optimize error handling in etnaviv_gem_new_userptr() SF Markus Elfring
2016-07-22 17:54 ` Sean Paul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox