mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 04:21:09 -04:00
clk: Simplify clk_is_match()
Linux style is to handle early-on failure. Inverting the first condition lets us simplify the second, and improves readability. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Brian Masney <bmasney@redhat.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
committed by
Stephen Boyd
parent
5d6c477687
commit
b2369725b7
@@ -3259,11 +3259,10 @@ bool clk_is_match(const struct clk *p, const struct clk *q)
|
||||
return true;
|
||||
|
||||
/* true if clk->core pointers match. Avoid dereferencing garbage */
|
||||
if (!IS_ERR_OR_NULL(p) && !IS_ERR_OR_NULL(q))
|
||||
if (p->core == q->core)
|
||||
return true;
|
||||
if (IS_ERR_OR_NULL(p) || IS_ERR_OR_NULL(q))
|
||||
return false;
|
||||
|
||||
return false;
|
||||
return p->core == q->core;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clk_is_match);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user