clk-mux: Adjustments for clk_hw_register_mux_table()
Subsystems (2)
cover clk-mux: Adjustments for clk_hw_register_mux_table()
From: Markus Elfring <[email protected]>
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(-)
Signature · 1 line
2.14.1
PATCH 1/2 clk-mux: Delete an error message for a failed memory allocation in clk_hw_register_mux_table()
From: Markus Elfring <[email protected]>
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.
--- drivers/clk/clk-mux.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/clk/clk-mux.c +1 -3
@@ -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 )
Signature · 1 line
2.14.1
PATCH 2/2 clk-mux: Improve a size determination in clk_hw_register_mux_table()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
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.
--- drivers/clk/clk-mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-mux.c +1 -1
@@ -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 );
Signature · 1 line
2.14.1
Stephen Boyd
AppliedRe: [PATCH 1/2] clk-mux: Delete an error message for a failed memory allocation in clk_hw_register_mux_table()
In reply to SF Markus ElfringQuoted 9 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Tue, 26 Sep 2017 17:23:04 +0200Omit 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 <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Stephen Boyd
AppliedRe: [PATCH 2/2] clk-mux: Improve a size determination in clk_hw_register_mux_table()
In reply to SF Markus ElfringQuoted 11 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Tue, 26 Sep 2017 17:30:06 +0200Replace 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 <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project