* [PATCH 0/2] [media] C8SECTPFE: Adjustments for c8sectpfe_frontend_attach()
@ 2017-09-15 16:00 SF Markus Elfring
2017-09-15 16:01 ` [PATCH 1/2] [media] c8sectpfe: Delete an error message for a failed memory allocation in c8sectpfe_frontend_attach() SF Markus Elfring
2017-09-15 16:02 ` [PATCH 2/2] [media] c8sectpfe: Improve two size determinations " SF Markus Elfring
0 siblings, 2 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-09-15 16:00 UTC (permalink / raw)
To: linux-arm-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 15 Sep 2017 17:55:43 +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 two size determinations
drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
--
2.14.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] [media] c8sectpfe: Delete an error message for a failed memory allocation in c8sectpfe_frontend_attach()
2017-09-15 16:00 [PATCH 0/2] [media] C8SECTPFE: Adjustments for c8sectpfe_frontend_attach() SF Markus Elfring
@ 2017-09-15 16:01 ` SF Markus Elfring
2017-09-15 16:02 ` [PATCH 2/2] [media] c8sectpfe: Improve two size determinations " SF Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-09-15 16:01 UTC (permalink / raw)
To: linux-arm-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 15 Sep 2017 17:20:48 +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/platform/sti/c8sectpfe/c8sectpfe-dvb.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c
index 2c0015b1264d..1b23b188cd65 100644
--- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c
+++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c
@@ -166,7 +166,4 @@ int c8sectpfe_frontend_attach(struct dvb_frontend **fe,
GFP_KERNEL);
- if (!tda18212) {
- dev_err(c8sectpfe->device,
- "%s: devm_kzalloc failed\n", __func__);
+ if (!tda18212)
return -ENOMEM;
- }
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] [media] c8sectpfe: Improve two size determinations in c8sectpfe_frontend_attach()
2017-09-15 16:00 [PATCH 0/2] [media] C8SECTPFE: Adjustments for c8sectpfe_frontend_attach() SF Markus Elfring
2017-09-15 16:01 ` [PATCH 1/2] [media] c8sectpfe: Delete an error message for a failed memory allocation in c8sectpfe_frontend_attach() SF Markus Elfring
@ 2017-09-15 16:02 ` SF Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-09-15 16:02 UTC (permalink / raw)
To: linux-arm-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 15 Sep 2017 17:30:38 +0200
Replace the specification of data structures by pointer dereferences
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/platform/sti/c8sectpfe/c8sectpfe-dvb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c
index 1b23b188cd65..c3b09a9e30ec 100644
--- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c
+++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c
@@ -164,12 +164,10 @@ int c8sectpfe_frontend_attach(struct dvb_frontend **fe,
tda18212 = devm_kzalloc(c8sectpfe->device,
- sizeof(struct tda18212_config),
+ sizeof(*tda18212),
GFP_KERNEL);
if (!tda18212)
return -ENOMEM;
- memcpy(tda18212, &tda18212_conf,
- sizeof(struct tda18212_config));
-
+ memcpy(tda18212, &tda18212_conf, sizeof(*tda18212));
tda18212->fe = (*fe);
tda18212_info.platform_data = tda18212;
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-15 16:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-15 16:00 [PATCH 0/2] [media] C8SECTPFE: Adjustments for c8sectpfe_frontend_attach() SF Markus Elfring
2017-09-15 16:01 ` [PATCH 1/2] [media] c8sectpfe: Delete an error message for a failed memory allocation in c8sectpfe_frontend_attach() SF Markus Elfring
2017-09-15 16:02 ` [PATCH 2/2] [media] c8sectpfe: Improve two size determinations " 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).