diff options
| author | Geert Uytterhoeven <geert+renesas@glider.be> | 2026-03-05 13:12:33 +0300 |
|---|---|---|
| committer | Stephen Boyd <sboyd@kernel.org> | 2026-03-24 03:19:12 +0300 |
| commit | b2369725b7eb43f70047418ac42e0e993412a4fd (patch) | |
| tree | 1b2fc4d6c56e5de1ede20d5cea91fedd3b93d105 | |
| parent | 5d6c477687aeb158df9ec95580270146778f6af1 (diff) | |
| download | linux-b2369725b7eb43f70047418ac42e0e993412a4fd.tar.xz | |
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>
| -rw-r--r-- | drivers/clk/clk.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 47093cda9df3..1a73e9c4e752 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -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); |
