Skip to contentSkip to conversation

clk: move some parent related functions upwards

DISCUSSION James Hogan 1 participant 1 message Aug 29, 2013 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi Dan,

Quoted 23 lines · Dan Carpenter

Hello James Hogan,

This is a semi-automatic email about new static checker warnings.

The patch 4935b22c46ea: "clk: move some parent related functions upwards" from Jul 29, 2013, leads to the following Smatch complaint:

drivers/clk/clk.c:1160 __clk_set_parent()
warn: variable dereferenced before check 'parent' (see line 1156)

drivers/clk/clk.c
1155 flags = clk_enable_lock();

  1156		clk_reparent(clk, parent);
                                  ^^^^^^

Patch addes dereference.

1157 clk_enable_unlock(flags);
1158
1159 /* change clock input source */
1160 if (parent && clk->ops->set_parent)

                    ^^^^^^

Patch adds a check.

Quoted 8 lines
  1161			ret = clk->ops->set_parent(clk->hw, p_index);
  1162	

Also the caller has similar issues. Could you CC me if you send a fix?

regards,
dan carpenter

This one is the same problem as the "clk: add support for clock reparent on set_rate" one that you reported yesterday (for which I am about to send a fix - I'll Cc you). This particular patch merely moves some related code without changing anything.

Cheers
James