OmniVision: Adjustments for four function implementations
Subsystems (3)
cover OmniVision: Adjustments for four function implementations
From: Markus Elfring <[email protected]>
Date: Sat, 2 Sep 2017 17:01:23 +0200
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (7):
Delete an error message for a failed memory allocation in ov2640_probe() Improve a size determination in ov2640_probe()
Delete an error message for a failed memory allocation in ov6650_probe() Delete an error message for a failed memory allocation in ov9640_probe() Improve a size determination in ov9640_probe()
Delete an error message for a failed memory allocation in ov9740_probe() Improve a size determination in ov9740_probe()
drivers/media/i2c/ov2640.c | 7 ++----- drivers/media/i2c/ov6650.c | 5 +---- drivers/media/i2c/soc_camera/ov9640.c | 7 ++----- drivers/media/i2c/soc_camera/ov9740.c | 6 ++---- 4 files changed, 7 insertions(+), 18 deletions(-)
Signature · 1 line
2.14.1
PATCH 1/7 ov2640: Delete an error message for a failed memory allocation in ov2640_probe()
From: Markus Elfring <[email protected]>
Date: Sat, 2 Sep 2017 16:07:31 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
--- drivers/media/i2c/ov2640.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/media/i2c/ov2640.c +1 -4
@@ -1101,8 +1101,5 @@ static int ov2640_probe(struct i2c_client *client, -if (!priv) { -dev_err (&adapter->dev, -"Failed to allocate memory for private data!\n" ); +if (!priv)return -ENOMEM ; - }if (client->dev.of_node) { priv->clk =devm_clk_get (&client->dev,"xvclk" );
Signature · 1 line
2.14.1
PATCH 2/7 ov2640: Improve a size determination in ov2640_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Sat, 2 Sep 2017 16:09:35 +0200
Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention.
This issue was detected by using the Coccinelle software.
--- drivers/media/i2c/ov2640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov2640.c +1 -1
@@ -1097,5 +1097,5 @@ static int ov2640_probe(struct i2c_client *client,return -EIO ; } - priv =devm_kzalloc (&client->dev,sizeof (struct ov2640_priv ),GFP_KERNEL ); + priv =devm_kzalloc (&client->dev,sizeof (*priv),GFP_KERNEL );if (!priv)
Signature · 1 line
2.14.1
PATCH 3/7 ov6650: Delete an error message for a failed memory allocation in ov6650_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Sat, 2 Sep 2017 16:16:39 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
--- drivers/media/i2c/ov6650.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/media/i2c/ov6650.c +1 -4
@@ -954,8 +954,5 @@ static int ov6650_probe(struct i2c_client *client, -if (!priv) { -dev_err (&client->dev, -"Failed to allocate memory for private data!\n" ); +if (!priv)return -ENOMEM ; - }v4l2_i2c_subdev_init (&priv->subdev, client, &ov6650_subdev_ops);v4l2_ctrl_handler_init (&priv->hdl,13 );
Signature · 1 line
2.14.1
PATCH 4/7 ov9640: Delete an error message for a failed memory allocation in ov9640_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Sat, 2 Sep 2017 16:34:27 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
--- drivers/media/i2c/soc_camera/ov9640.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/media/i2c/soc_camera/ov9640.c +1 -4
@@ -679,8 +679,5 @@ static int ov9640_probe(struct i2c_client *client, -if (!priv) { -dev_err (&client->dev, -"Failed to allocate memory for private data!\n" ); +if (!priv)return -ENOMEM ; - }v4l2_i2c_subdev_init (&priv->subdev, client, &ov9640_subdev_ops);
Signature · 1 line
2.14.1
PATCH 5/7 ov9640: Improve a size determination in ov9640_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Sat, 2 Sep 2017 16:37:03 +0200
Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention.
This issue was detected by using the Coccinelle software.
--- drivers/media/i2c/soc_camera/ov9640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/soc_camera/ov9640.c +1 -1
@@ -675,5 +675,5 @@ static int ov9640_probe(struct i2c_client *client,return -EINVAL ; } - priv =devm_kzalloc (&client->dev,sizeof (struct ov9640_priv ),GFP_KERNEL ); + priv =devm_kzalloc (&client->dev,sizeof (*priv),GFP_KERNEL );if (!priv)
Signature · 1 line
2.14.1
PATCH 6/7 ov9740: Delete an error message for a failed memory allocation in ov9740_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Sat, 2 Sep 2017 16:44:36 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
--- drivers/media/i2c/soc_camera/ov9740.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/media/i2c/soc_camera/ov9740.c +1 -3
@@ -939,7 +939,5 @@ static int ov9740_probe(struct i2c_client *client, -if (!priv) { -dev_err (&client->dev,"Failed to allocate private data!\n" ); +if (!priv)return -ENOMEM ; - }v4l2_i2c_subdev_init (&priv->subdev, client, &ov9740_subdev_ops);v4l2_ctrl_handler_init (&priv->hdl,13 );
Signature · 1 line
2.14.1
PATCH 7/7 ov9740: Improve a size determination in ov9740_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Sat, 2 Sep 2017 16:46:03 +0200
Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention.
This issue was detected by using the Coccinelle software.
--- drivers/media/i2c/soc_camera/ov9740.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/soc_camera/ov9740.c +1 -1
@@ -935,5 +935,5 @@ static int ov9740_probe(struct i2c_client *client,return -EINVAL ; } - priv =devm_kzalloc (&client->dev,sizeof (struct ov9740_priv ),GFP_KERNEL ); + priv =devm_kzalloc (&client->dev,sizeof (*priv),GFP_KERNEL );if (!priv)
Signature · 1 line
2.14.1