<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Some commit messages would be nice.<br>
      <br>
      You could make the subject line shorter (something like "fix some
      warning in xyz.c") and actually use the current subject line as
      commit message.<br>
      <br>
      With that fixed the patches are Reviewed-by: Christian König
      <a class="moz-txt-link-rfc2396E" href="mailto:christian.koenig@amd.com"><christian.koenig@amd.com></a>.<br>
      <br>
      Regards,<br>
      Christian.<br>
      <br>
      Am 11.10.2016 um 13:17 schrieb Zhu, Rex:<br>
    </div>
    <blockquote
cite="mid:MWHPR12MB1694154A90E77C09F66C9B8DFBDA0@MWHPR12MB1694.namprd12.prod.outlook.com"
      type="cite">
      <pre wrap="">Thanks. 
Please review the attached patches.


Best Regards
Rex

-----Original Message-----
From: Dan Carpenter [<a class="moz-txt-link-freetext" href="mailto:dan.carpenter@oracle.com">mailto:dan.carpenter@oracle.com</a>] 
Sent: Tuesday, October 11, 2016 3:11 PM
To: Zhu, Rex
Cc: <a class="moz-txt-link-abbreviated" href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a>
Subject: re: drm/amd/powerplay: implement smu7 hwmgr to manager asics with smu ip version 7.

Hello Rex Zhu,

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

The patch 599a7e9fe1b6: "drm/amd/powerplay: implement smu7 hwmgr to manager asics with smu ip version 7." from Sep 9, 2016, leads to the following Smatch complaint:

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:3809 smu7_check_states_equal()
         warn: variable dereferenced before check 'pstate1' (see line 3805)

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c
  3804  {
  3805          const struct smu7_power_state *psa = cast_const_phw_smu7_power_state(pstate1);
                                                                                     ^^^^^^^
  3806          const struct smu7_power_state *psb = cast_const_phw_smu7_power_state(pstate2);
                                                                                     ^^^^^^^ New dereferences.

  3807          int i;
  3808  
  3809          if (pstate1 == NULL || pstate2 == NULL || equal == NULL)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Checked too late.

Just as an aside.  People really don't review code in initializers.
I've commented on this before, and other people have noted it as well but other people are like "In that case, those people shouldn't be kernel devs!" which is so ignorant.  Everyone consistently makes the same mistakes.  I've spent so many hours looking at basically this same bug over and over and everyone does it.

That's nothing to do with your code, in particular, I just wanted to update you on how my morning has been going.  (Pretty well, thanks, although I'm due for a second cup of coffee).

  3810                  return -EINVAL;
  3811  

regards,
dan carpenter
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
dri-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/dri-devel">https://lists.freedesktop.org/mailman/listinfo/dri-devel</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>