SUPERH platform development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-sh@vger.kernel.org
Subject: re: sh: add clk_round_parent() to optimize parent clock rate
Date: Wed, 06 Nov 2013 16:14:40 +0000	[thread overview]
Message-ID: <20131106161440.GF15603@elgon.mountain> (raw)

Hello Guennadi Liakhovetski,

This is a semi-automatic email about new static checker warnings.

The patch 6af26c6c99f0: "sh: add clk_round_parent() to optimize 
parent clock rate" from Nov 2, 2010, leads to the following Smatch 
complaint:

drivers/sh/clk/core.c:641 clk_round_parent()
	 error: we previously assumed 'best_freq' could be null (see line 630)

drivers/sh/clk/core.c
   629				best = freq;
   630				if (best_freq)
   631					*best_freq = freq_high;
   632			}
   633	
   634			if (target - freq_low < error) {
   635				error = target - freq_low;
   636				best = freq;
   637				if (best_freq)
                                    ^^^^^^^^^
Check.

   638					*best_freq = freq_low;
   639			}
   640	
   641			pr_debug("%u / %lu = %lu, / %lu = %lu, best %lu, parent %u\n",
   642				 freq->frequency, div, freq_high, div + 1, freq_low,
   643				 *best_freq, best->frequency);
                                 ^^^^^^^^^^
Unchecked dereference.

regards,
dan carpenter

                 reply	other threads:[~2013-11-06 16:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131106161440.GF15603@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox