Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1740963 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-09-27 21:40 +0200 |
| Last post | 2017-09-27 21:50 +0200 |
| Articles | 3 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/2] versatile clock: Adjustments for icst_clk_setup() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-27 21:40 +0200
[PATCH 1/2] clk/versatile: Delete two error messages for a failed memory allocation in icst_clk_setup() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-27 21:40 +0200
[PATCH 2/2] clk/versatile: Improve a size determination in icst_clk_setup() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-27 21:50 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-09-27 21:40 +0200 |
| Subject | [PATCH 0/2] versatile clock: Adjustments for icst_clk_setup() |
| Message-ID | <uuqlA-7fu-9@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Wed, 27 Sep 2017 21:34:43 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete two error messages for a failed memory allocation Improve a size determination drivers/clk/versatile/clk-icst.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.14.2
[toc] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-09-27 21:40 +0200 |
| Subject | [PATCH 1/2] clk/versatile: Delete two error messages for a failed memory allocation in icst_clk_setup() |
| Message-ID | <uuqlA-7fu-21@gated-at.bofh.it> |
| In reply to | #1740963 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 27 Sep 2017 21:21:23 +0200
Omit extra messages 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/clk/versatile/clk-icst.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c
index 09fbe66f1f11..20ab4ceffb28 100644
--- a/drivers/clk/versatile/clk-icst.c
+++ b/drivers/clk/versatile/clk-icst.c
@@ -360,15 +360,12 @@ static struct clk *icst_clk_setup(struct device *dev,
struct icst_params *pclone;
icst = kzalloc(sizeof(struct clk_icst), GFP_KERNEL);
- if (!icst) {
- pr_err("could not allocate ICST clock!\n");
+ if (!icst)
return ERR_PTR(-ENOMEM);
- }
pclone = kmemdup(desc->params, sizeof(*pclone), GFP_KERNEL);
if (!pclone) {
kfree(icst);
- pr_err("could not clone ICST params\n");
return ERR_PTR(-ENOMEM);
}
--
2.14.2
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-09-27 21:50 +0200 |
| Subject | [PATCH 2/2] clk/versatile: Improve a size determination in icst_clk_setup() |
| Message-ID | <uuqvf-7kB-3@gated-at.bofh.it> |
| In reply to | #1740963 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Wed, 27 Sep 2017 21:24:43 +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/clk/versatile/clk-icst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c index 20ab4ceffb28..dafe7a45875d 100644 --- a/drivers/clk/versatile/clk-icst.c +++ b/drivers/clk/versatile/clk-icst.c @@ -359,7 +359,7 @@ static struct clk *icst_clk_setup(struct device *dev, struct clk_init_data init; struct icst_params *pclone; - icst = kzalloc(sizeof(struct clk_icst), GFP_KERNEL); + icst = kzalloc(sizeof(*icst), GFP_KERNEL); if (!icst) return ERR_PTR(-ENOMEM); -- 2.14.2
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web