Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Geert Uytterhoeven and committed by
Stephen Boyd
b2369725 5d6c4776

+3 -4
+3 -4
drivers/clk/clk.c
··· 3259 3259 return true; 3260 3260 3261 3261 /* true if clk->core pointers match. Avoid dereferencing garbage */ 3262 - if (!IS_ERR_OR_NULL(p) && !IS_ERR_OR_NULL(q)) 3263 - if (p->core == q->core) 3264 - return true; 3262 + if (IS_ERR_OR_NULL(p) || IS_ERR_OR_NULL(q)) 3263 + return false; 3265 3264 3266 - return false; 3265 + return p->core == q->core; 3267 3266 } 3268 3267 EXPORT_SYMBOL_GPL(clk_is_match); 3269 3268