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>
This commit is contained in:

committed by
Stephen Boyd

parent
e9baa27994
commit
7a3aad90d3
@@ -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;
|
||||
|
Reference in New Issue
Block a user