All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Dan Carpenter <error27@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [bug report] drm/i915/dmc: add i915_to_dmc() and dmc->i915 and use them
Date: Fri, 10 Mar 2023 18:36:04 +0200	[thread overview]
Message-ID: <871qlw8sy3.fsf@intel.com> (raw)
In-Reply-To: <42a4c5e8-4234-4f4d-9810-2d84bfce1156@kili.mountain>

On Fri, 10 Mar 2023, Dan Carpenter <error27@gmail.com> wrote:
> On Thu, Mar 09, 2023 at 04:51:10PM +0200, Jani Nikula wrote:
>> On Thu, 09 Mar 2023, Dan Carpenter <error27@gmail.com> wrote:
>> > Hello Jani Nikula,
>> >
>> > This is a semi-automatic email about new static checker warnings.
>> >
>> > The patch 1b28c1c789d0: "drm/i915/dmc: add i915_to_dmc() and 
>> > dmc->i915 and use them" from Mar 1, 2023, leads to the following 
>> > Smatch complaint:
>> >
>> >     drivers/gpu/drm/i915/display/intel_dmc.c:1162 intel_dmc_debugfs_status_show()
>> >     error: we previously assumed 'dmc' could be null (see line 1148)
>> >
>> > drivers/gpu/drm/i915/display/intel_dmc.c
>> >   1142  
>> >   1143          wakeref = intel_runtime_pm_get(&i915->runtime_pm);
>> >   1144  
>> >   1145          seq_printf(m, "DMC initialized: %s\n", str_yes_no(dmc));'
>> >                                                        ^^^^^^^^^^^^^^^
>> > This is a check for NULL too.
>> >
>> >   1146          seq_printf(m, "fw loaded: %s\n",
>> >   1147			   str_yes_no(intel_dmc_has_payload(i915)));
>> >   1148		seq_printf(m, "path: %s\n", dmc ? dmc->fw_path : "N/A");
>> >                                             ^^^
>> > The patch adds a check for NULL.
>> >
>> >   1149		seq_printf(m, "Pipe A fw needed: %s\n",
>> >   1150			   str_yes_no(GRAPHICS_VER(i915) >= 12));
>> >   1151		seq_printf(m, "Pipe A fw loaded: %s\n",
>> >   1152			   str_yes_no(has_dmc_id_fw(i915, DMC_FW_PIPEA)));
>> >   1153		seq_printf(m, "Pipe B fw needed: %s\n",
>> >   1154			   str_yes_no(IS_ALDERLAKE_P(i915) ||
>> >   1155				      DISPLAY_VER(i915) >= 14));
>> >   1156		seq_printf(m, "Pipe B fw loaded: %s\n",
>> >   1157			   str_yes_no(has_dmc_id_fw(i915, DMC_FW_PIPEB)));
>> >   1158	
>> >   1159		if (!intel_dmc_has_payload(i915))
>> 
>> intel_dmc_has_payload() should always return false for dmc == NULL.
>
> Ah, right.  Sorry for the noise.  I'm going to try figure out how to
> make Smatch parse this correctly.

No worries. I did wonder while writing the patch whether it would throw
off people, didn't even consider static analysis. :)

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

      reply	other threads:[~2023-03-10 16:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 14:46 [Intel-gfx] [bug report] drm/i915/dmc: add i915_to_dmc() and dmc->i915 and use them Dan Carpenter
2023-03-09 14:51 ` Jani Nikula
2023-03-10 15:19   ` Dan Carpenter
2023-03-10 16:36     ` Jani Nikula [this message]

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=871qlw8sy3.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=error27@gmail.com \
    --cc=intel-gfx@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.