* [PATCH 0/2] clk-mux: Adjustments for clk_hw_register_mux_table()
@ 2017-09-26 16:20 SF Markus Elfring
2017-09-26 16:21 ` [PATCH 1/2] clk-mux: Delete an error message for a failed memory allocation in clk_hw_register_mux_table() SF Markus Elfring
2017-09-26 16:22 ` [PATCH 2/2] clk-mux: Improve a size determination " SF Markus Elfring
0 siblings, 2 replies; 5+ messages in thread
From: SF Markus Elfring @ 2017-09-26 16:20 UTC (permalink / raw)
To: linux-clk, Michael Turquette, Stephen Boyd; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 26 Sep 2017 18:16:12 +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
drivers/clk/clk-mux.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--
2.14.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] clk-mux: Delete an error message for a failed memory allocation in clk_hw_register_mux_table()
2017-09-26 16:20 [PATCH 0/2] clk-mux: Adjustments for clk_hw_register_mux_table() SF Markus Elfring
@ 2017-09-26 16:21 ` SF Markus Elfring
2017-11-14 1:57 ` Stephen Boyd
2017-09-26 16:22 ` [PATCH 2/2] clk-mux: Improve a size determination " SF Markus Elfring
1 sibling, 1 reply; 5+ messages in thread
From: SF Markus Elfring @ 2017-09-26 16:21 UTC (permalink / raw)
To: linux-clk, Michael Turquette, Stephen Boyd; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 26 Sep 2017 17:23: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/clk/clk-mux.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index 16a3d5717f4e..1746dbf2f7ea 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -135,10 +135,8 @@ struct clk_hw *clk_hw_register_mux_table(struct device *dev, const char *name,
/* allocate the mux */
mux = kzalloc(sizeof(struct clk_mux), GFP_KERNEL);
- if (!mux) {
- pr_err("%s: could not allocate mux clk\n", __func__);
+ if (!mux)
return ERR_PTR(-ENOMEM);
- }
init.name = name;
if (clk_mux_flags & CLK_MUX_READ_ONLY)
--
2.14.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] clk-mux: Improve a size determination in clk_hw_register_mux_table()
2017-09-26 16:20 [PATCH 0/2] clk-mux: Adjustments for clk_hw_register_mux_table() SF Markus Elfring
2017-09-26 16:21 ` [PATCH 1/2] clk-mux: Delete an error message for a failed memory allocation in clk_hw_register_mux_table() SF Markus Elfring
@ 2017-09-26 16:22 ` SF Markus Elfring
2017-11-14 1:57 ` Stephen Boyd
1 sibling, 1 reply; 5+ messages in thread
From: SF Markus Elfring @ 2017-09-26 16:22 UTC (permalink / raw)
To: linux-clk, Michael Turquette, Stephen Boyd; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 26 Sep 2017 17:30:06 +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/clk-mux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index 1746dbf2f7ea..39cabe157163 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -134,7 +134,7 @@ struct clk_hw *clk_hw_register_mux_table(struct device *dev, const char *name,
}
/* allocate the mux */
- mux = kzalloc(sizeof(struct clk_mux), GFP_KERNEL);
+ mux = kzalloc(sizeof(*mux), GFP_KERNEL);
if (!mux)
return ERR_PTR(-ENOMEM);
--
2.14.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] clk-mux: Improve a size determination in clk_hw_register_mux_table()
2017-09-26 16:22 ` [PATCH 2/2] clk-mux: Improve a size determination " SF Markus Elfring
@ 2017-11-14 1:57 ` Stephen Boyd
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2017-11-14 1:57 UTC (permalink / raw)
To: SF Markus Elfring; +Cc: linux-clk, Michael Turquette, LKML, kernel-janitors
On 09/26, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 26 Sep 2017 17:30:06 +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>
> ---
Applied to clk-next
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-11-14 1:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-26 16:20 [PATCH 0/2] clk-mux: Adjustments for clk_hw_register_mux_table() SF Markus Elfring
2017-09-26 16:21 ` [PATCH 1/2] clk-mux: Delete an error message for a failed memory allocation in clk_hw_register_mux_table() SF Markus Elfring
2017-11-14 1:57 ` Stephen Boyd
2017-09-26 16:22 ` [PATCH 2/2] clk-mux: Improve a size determination " SF Markus Elfring
2017-11-14 1:57 ` Stephen Boyd
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).