Skip to content

Commit

Permalink
clk: hisilicon: fix warning from smatch
Browse files Browse the repository at this point in the history
drivers/clk/hisilicon/clk-hi3620.c:338
mmc_clk_delay() warn: always true condition '(para >= 0) => (0-u32max >= 0)'

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Zhangfei Gao <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
  • Loading branch information
zhangfeigao authored and Mike Turquette committed Mar 21, 2014
1 parent a665962 commit c115b13
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions drivers/clk/hisilicon/clk-hi3620.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,14 @@ static u32 mmc_clk_delay(u32 val, u32 para, u32 off, u32 len)
{
u32 i;

if (para >= 0) {
for (i = 0; i < len; i++) {
if (para % 2)
val |= 1 << (off + i);
else
val &= ~(1 << (off + i));
para = para >> 1;
}
for (i = 0; i < len; i++) {
if (para % 2)
val |= 1 << (off + i);
else
val &= ~(1 << (off + i));
para = para >> 1;
}

return val;
}

Expand Down

0 comments on commit c115b13

Please sign in to comment.