Skip to content

Commit 5c58585

Browse files
ColinIanKingbebarino
authored andcommitted
clk: socfpga: remove redundant assignment after a mask operation
The assignment operation after a & mask operation is redundant, the variables being assigned are not used afterwards. Replace the &= operator with just & operator. Cleans up two clang-scan warnings: drivers/clk/socfpga/clk-gate.c:37:10: warning: Although the value stored to 'l4_src' is used in the enclosing expression, the value is never actually read from 'l4_src' [deadcode.DeadStores] return l4_src &= 0x1; ^ ~~~ drivers/clk/socfpga/clk-gate.c:46:10: warning: Although the value stored to 'perpll_src' is used in the enclosing expression, the value is never actually read from 'perpll_src' [deadcode.DeadStores] return perpll_src &= 0x3; Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20211230150321.167576-1-colin.i.king@gmail.com Acked-by: Dinh Nguyen <dinguyen@kernel.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 08d92c7 commit 5c58585

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/clk/socfpga/clk-gate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static u8 socfpga_clk_get_parent(struct clk_hw *hwclk)
3434

3535
if (streq(name, SOCFPGA_L4_MP_CLK)) {
3636
l4_src = readl(clk_mgr_base_addr + CLKMGR_L4SRC);
37-
return l4_src &= 0x1;
37+
return l4_src & 0x1;
3838
}
3939
if (streq(name, SOCFPGA_L4_SP_CLK)) {
4040
l4_src = readl(clk_mgr_base_addr + CLKMGR_L4SRC);
@@ -43,7 +43,7 @@ static u8 socfpga_clk_get_parent(struct clk_hw *hwclk)
4343

4444
perpll_src = readl(clk_mgr_base_addr + CLKMGR_PERPLL_SRC);
4545
if (streq(name, SOCFPGA_MMC_CLK))
46-
return perpll_src &= 0x3;
46+
return perpll_src & 0x3;
4747
if (streq(name, SOCFPGA_NAND_CLK) ||
4848
streq(name, SOCFPGA_NAND_X_CLK))
4949
return (perpll_src >> 2) & 3;

0 commit comments

Comments
 (0)