* [PATCH 0/2] [media] Si2157: Adjustments for two function implementations @ 2017-09-17 6:55 SF Markus Elfring 2017-09-17 6:57 ` [PATCH 1/2] [media] si2157: Delete an error message for a failed memory allocation in si2157_probe() SF Markus Elfring 2017-09-17 6:58 ` [PATCH 2/2] [media] si2157: Improve a size determination in two functions SF Markus Elfring 0 siblings, 2 replies; 3+ messages in thread From: SF Markus Elfring @ 2017-09-17 6:55 UTC (permalink / raw) To: linux-media, Antti Palosaari, Mauro Carvalho Chehab; +Cc: LKML, kernel-janitors From: Markus Elfring <elfring@users.sourceforge.net> Date: Sun, 17 Sep 2017 08:48:24 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an error message for a failed memory allocation Improve a size determination in two functions drivers/media/tuners/si2157.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.14.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] [media] si2157: Delete an error message for a failed memory allocation in si2157_probe() 2017-09-17 6:55 [PATCH 0/2] [media] Si2157: Adjustments for two function implementations SF Markus Elfring @ 2017-09-17 6:57 ` SF Markus Elfring 2017-09-17 6:58 ` [PATCH 2/2] [media] si2157: Improve a size determination in two functions SF Markus Elfring 1 sibling, 0 replies; 3+ messages in thread From: SF Markus Elfring @ 2017-09-17 6:57 UTC (permalink / raw) To: linux-media, Antti Palosaari, Mauro Carvalho Chehab; +Cc: LKML, kernel-janitors From: Markus Elfring <elfring@users.sourceforge.net> Date: Sun, 17 Sep 2017 08:20:04 +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/tuners/si2157.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index e35b1faf0ddc..aefa85718496 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -439,6 +439,5 @@ static int si2157_probe(struct i2c_client *client, if (!dev) { ret = -ENOMEM; - dev_err(&client->dev, "kzalloc() failed\n"); goto err; } -- 2.14.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] [media] si2157: Improve a size determination in two functions 2017-09-17 6:55 [PATCH 0/2] [media] Si2157: Adjustments for two function implementations SF Markus Elfring 2017-09-17 6:57 ` [PATCH 1/2] [media] si2157: Delete an error message for a failed memory allocation in si2157_probe() SF Markus Elfring @ 2017-09-17 6:58 ` SF Markus Elfring 1 sibling, 0 replies; 3+ messages in thread From: SF Markus Elfring @ 2017-09-17 6:58 UTC (permalink / raw) To: linux-media, Antti Palosaari, Mauro Carvalho Chehab; +Cc: LKML, kernel-janitors From: Markus Elfring <elfring@users.sourceforge.net> Date: Sun, 17 Sep 2017 08:32:17 +0200 Replace the specification of data structures by variable references as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/media/tuners/si2157.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index aefa85718496..e3e2027a5027 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -457,7 +457,7 @@ static int si2157_probe(struct i2c_client *client, if (ret) goto err_kfree; - memcpy(&fe->ops.tuner_ops, &si2157_ops, sizeof(struct dvb_tuner_ops)); + memcpy(&fe->ops.tuner_ops, &si2157_ops, sizeof(si2157_ops)); fe->tuner_priv = client; #ifdef CONFIG_MEDIA_CONTROLLER @@ -514,7 +514,7 @@ static int si2157_remove(struct i2c_client *client) media_device_unregister_entity(&dev->ent); #endif - memset(&fe->ops.tuner_ops, 0, sizeof(struct dvb_tuner_ops)); + memset(&fe->ops.tuner_ops, 0, sizeof(fe->ops.tuner_ops)); fe->tuner_priv = NULL; kfree(dev); -- 2.14.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-17 6:59 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-09-17 6:55 [PATCH 0/2] [media] Si2157: Adjustments for two function implementations SF Markus Elfring 2017-09-17 6:57 ` [PATCH 1/2] [media] si2157: Delete an error message for a failed memory allocation in si2157_probe() SF Markus Elfring 2017-09-17 6:58 ` [PATCH 2/2] [media] si2157: Improve a size determination in two functions 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
Powered by JetHome