summaryrefslogtreecommitdiffstats
path: root/drivers/clk/mmp/clk-mix.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-09-27 09:00:21 +0200
committerStephen Boyd <sboyd@codeaurora.org>2017-11-13 17:41:17 -0800
commit7a3aad90d331de9b78ea8d292bb4fd4f9ecdfd75 (patch)
treef0b2755a898f3aa4ed36d828a332c0ef2f467fd1 /drivers/clk/mmp/clk-mix.c
parente9baa279949fff9f78f3ad0e1606f7b148746765 (diff)
clk: mmp: Adjust checks for NULL pointers
The script “checkpatch.pl” pointed information out like the following: Comparison to NULL could be written !... Thus fix the affected source code places. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/mmp/clk-mix.c')
-rw-r--r--drivers/clk/mmp/clk-mix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/mmp/clk-mix.c b/drivers/clk/mmp/clk-mix.c
index b2471fb369f1..90814b2613c0 100644
--- a/drivers/clk/mmp/clk-mix.c
+++ b/drivers/clk/mmp/clk-mix.c
@@ -229,7 +229,7 @@ static int mmp_clk_mix_determine_rate(struct clk_hw *hw,
parent_rate = clk_hw_get_rate(parent);
mix_rate = parent_rate / item->divisor;
gap = abs(mix_rate - req->rate);
- if (parent_best == NULL || gap < gap_best) {
+ if (!parent_best || gap < gap_best) {
parent_best = parent;
parent_rate_best = parent_rate;
mix_rate_best = mix_rate;
@@ -247,7 +247,7 @@ static int mmp_clk_mix_determine_rate(struct clk_hw *hw,
div = _get_div(mix, j);
mix_rate = parent_rate / div;
gap = abs(mix_rate - req->rate);
- if (parent_best == NULL || gap < gap_best) {
+ if (!parent_best || gap < gap_best) {
parent_best = parent;
parent_rate_best = parent_rate;
mix_rate_best = mix_rate;