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>
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);