* [PATCH 0/7] [media] OmniVision: Adjustments for four function implementations
@ 2017-09-02 15:47 SF Markus Elfring
2017-09-02 15:48 ` [PATCH 1/7] [media] ov2640: Delete an error message for a failed memory allocation in ov2640_probe() SF Markus Elfring
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-09-02 15:47 UTC (permalink / raw)
To: linux-media, Bhumika Goyal, Frank Schäfer,
Guennadi Liakhovetski, Hans Verkuil, Janusz Krzysztofik,
Mauro Carvalho Chehab, Sakari Ailus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
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(-)
--
2.14.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/7] [media] ov2640: Delete an error message for a failed memory allocation in ov2640_probe()
2017-09-02 15:47 [PATCH 0/7] [media] OmniVision: Adjustments for four function implementations SF Markus Elfring
@ 2017-09-02 15:48 ` SF Markus Elfring
2017-09-02 15:49 ` [PATCH 2/7] [media] ov2640: Improve a size determination " SF Markus Elfring
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-09-02 15:48 UTC (permalink / raw)
To: linux-media, Bhumika Goyal, Frank Schäfer,
Guennadi Liakhovetski, Hans Verkuil, Janusz Krzysztofik,
Mauro Carvalho Chehab, Sakari Ailus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/i2c/ov2640.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c
index e6d0c1f64f0b..e4ae53410097 100644
--- a/drivers/media/i2c/ov2640.c
+++ b/drivers/media/i2c/ov2640.c
@@ -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");
--
2.14.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/7] [media] ov2640: Improve a size determination in ov2640_probe()
2017-09-02 15:47 [PATCH 0/7] [media] OmniVision: Adjustments for four function implementations SF Markus Elfring
2017-09-02 15:48 ` [PATCH 1/7] [media] ov2640: Delete an error message for a failed memory allocation in ov2640_probe() SF Markus Elfring
@ 2017-09-02 15:49 ` SF Markus Elfring
2017-09-02 15:50 ` [PATCH 3/7] [media] ov6650: Delete an error message for a failed memory allocation in ov6650_probe() SF Markus Elfring
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-09-02 15:49 UTC (permalink / raw)
To: linux-media, Bhumika Goyal, Frank Schäfer,
Guennadi Liakhovetski, Hans Verkuil, Janusz Krzysztofik,
Mauro Carvalho Chehab, Sakari Ailus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/i2c/ov2640.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c
index e4ae53410097..456aa977bce8 100644
--- a/drivers/media/i2c/ov2640.c
+++ b/drivers/media/i2c/ov2640.c
@@ -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)
--
2.14.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/7] [media] ov6650: Delete an error message for a failed memory allocation in ov6650_probe()
2017-09-02 15:47 [PATCH 0/7] [media] OmniVision: Adjustments for four function implementations SF Markus Elfring
2017-09-02 15:48 ` [PATCH 1/7] [media] ov2640: Delete an error message for a failed memory allocation in ov2640_probe() SF Markus Elfring
2017-09-02 15:49 ` [PATCH 2/7] [media] ov2640: Improve a size determination " SF Markus Elfring
@ 2017-09-02 15:50 ` SF Markus Elfring
2017-09-02 15:51 ` [PATCH 4/7] [media] ov9640: Delete an error message for a failed memory allocation in ov9640_probe() SF Markus Elfring
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-09-02 15:50 UTC (permalink / raw)
To: linux-media, Bhumika Goyal, Frank Schäfer,
Guennadi Liakhovetski, Hans Verkuil, Janusz Krzysztofik,
Mauro Carvalho Chehab, Sakari Ailus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/i2c/ov6650.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/media/i2c/ov6650.c b/drivers/media/i2c/ov6650.c
index 768f2950ea36..8975d16b2b24 100644
--- a/drivers/media/i2c/ov6650.c
+++ b/drivers/media/i2c/ov6650.c
@@ -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);
--
2.14.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/7] [media] ov9640: Delete an error message for a failed memory allocation in ov9640_probe()
2017-09-02 15:47 [PATCH 0/7] [media] OmniVision: Adjustments for four function implementations SF Markus Elfring
` (2 preceding siblings ...)
2017-09-02 15:50 ` [PATCH 3/7] [media] ov6650: Delete an error message for a failed memory allocation in ov6650_probe() SF Markus Elfring
@ 2017-09-02 15:51 ` SF Markus Elfring
2017-09-02 15:52 ` [PATCH 5/7] [media] ov9640: Improve a size determination " SF Markus Elfring
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-09-02 15:51 UTC (permalink / raw)
To: linux-media, Bhumika Goyal, Frank Schäfer,
Guennadi Liakhovetski, Hans Verkuil, Janusz Krzysztofik,
Mauro Carvalho Chehab, Sakari Ailus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/i2c/soc_camera/ov9640.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/media/i2c/soc_camera/ov9640.c b/drivers/media/i2c/soc_camera/ov9640.c
index 0146d1f7aacb..0f02f022f3e9 100644
--- a/drivers/media/i2c/soc_camera/ov9640.c
+++ b/drivers/media/i2c/soc_camera/ov9640.c
@@ -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);
--
2.14.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/7] [media] ov9640: Improve a size determination in ov9640_probe()
2017-09-02 15:47 [PATCH 0/7] [media] OmniVision: Adjustments for four function implementations SF Markus Elfring
` (3 preceding siblings ...)
2017-09-02 15:51 ` [PATCH 4/7] [media] ov9640: Delete an error message for a failed memory allocation in ov9640_probe() SF Markus Elfring
@ 2017-09-02 15:52 ` SF Markus Elfring
2017-09-02 15:53 ` [PATCH 6/7] [media] ov9740: Delete an error message for a failed memory allocation in ov9740_probe() SF Markus Elfring
2017-09-02 15:54 ` [PATCH 7/7] [media] ov9740: Improve a size determination " SF Markus Elfring
6 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-09-02 15:52 UTC (permalink / raw)
To: linux-media, Bhumika Goyal, Frank Schäfer,
Guennadi Liakhovetski, Hans Verkuil, Janusz Krzysztofik,
Mauro Carvalho Chehab, Sakari Ailus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/i2c/soc_camera/ov9640.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/soc_camera/ov9640.c b/drivers/media/i2c/soc_camera/ov9640.c
index 0f02f022f3e9..67578f194928 100644
--- a/drivers/media/i2c/soc_camera/ov9640.c
+++ b/drivers/media/i2c/soc_camera/ov9640.c
@@ -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)
--
2.14.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 6/7] [media] ov9740: Delete an error message for a failed memory allocation in ov9740_probe()
2017-09-02 15:47 [PATCH 0/7] [media] OmniVision: Adjustments for four function implementations SF Markus Elfring
` (4 preceding siblings ...)
2017-09-02 15:52 ` [PATCH 5/7] [media] ov9640: Improve a size determination " SF Markus Elfring
@ 2017-09-02 15:53 ` SF Markus Elfring
2017-09-02 15:54 ` [PATCH 7/7] [media] ov9740: Improve a size determination " SF Markus Elfring
6 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-09-02 15:53 UTC (permalink / raw)
To: linux-media, Bhumika Goyal, Frank Schäfer,
Guennadi Liakhovetski, Hans Verkuil, Janusz Krzysztofik,
Mauro Carvalho Chehab, Sakari Ailus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/i2c/soc_camera/ov9740.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/media/i2c/soc_camera/ov9740.c b/drivers/media/i2c/soc_camera/ov9740.c
index cc07b7ae5407..f44f5da795f9 100644
--- a/drivers/media/i2c/soc_camera/ov9740.c
+++ b/drivers/media/i2c/soc_camera/ov9740.c
@@ -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);
--
2.14.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 7/7] [media] ov9740: Improve a size determination in ov9740_probe()
2017-09-02 15:47 [PATCH 0/7] [media] OmniVision: Adjustments for four function implementations SF Markus Elfring
` (5 preceding siblings ...)
2017-09-02 15:53 ` [PATCH 6/7] [media] ov9740: Delete an error message for a failed memory allocation in ov9740_probe() SF Markus Elfring
@ 2017-09-02 15:54 ` SF Markus Elfring
6 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-09-02 15:54 UTC (permalink / raw)
To: linux-media, Bhumika Goyal, Frank Schäfer,
Guennadi Liakhovetski, Hans Verkuil, Janusz Krzysztofik,
Mauro Carvalho Chehab, Sakari Ailus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/i2c/soc_camera/ov9740.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/soc_camera/ov9740.c b/drivers/media/i2c/soc_camera/ov9740.c
index f44f5da795f9..755de2289c39 100644
--- a/drivers/media/i2c/soc_camera/ov9740.c
+++ b/drivers/media/i2c/soc_camera/ov9740.c
@@ -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)
--
2.14.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-09-02 15:54 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-02 15:47 [PATCH 0/7] [media] OmniVision: Adjustments for four function implementations SF Markus Elfring
2017-09-02 15:48 ` [PATCH 1/7] [media] ov2640: Delete an error message for a failed memory allocation in ov2640_probe() SF Markus Elfring
2017-09-02 15:49 ` [PATCH 2/7] [media] ov2640: Improve a size determination " SF Markus Elfring
2017-09-02 15:50 ` [PATCH 3/7] [media] ov6650: Delete an error message for a failed memory allocation in ov6650_probe() SF Markus Elfring
2017-09-02 15:51 ` [PATCH 4/7] [media] ov9640: Delete an error message for a failed memory allocation in ov9640_probe() SF Markus Elfring
2017-09-02 15:52 ` [PATCH 5/7] [media] ov9640: Improve a size determination " SF Markus Elfring
2017-09-02 15:53 ` [PATCH 6/7] [media] ov9740: Delete an error message for a failed memory allocation in ov9740_probe() SF Markus Elfring
2017-09-02 15:54 ` [PATCH 7/7] [media] ov9740: Improve a size determination " SF Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).