<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    On 08/15/2012 09:08 AM, Gedare Bloom wrote:
    <blockquote
cite="mid:CAC82fA3uwz_uruz2UTfUbUFQpN-OqYrR0vpOAL_Mf_o___rUtw@mail.gmail.com"
      type="cite">Hi,<br>
      <br>
      Why remove the comment about rounding up the size?<br>
      <br>
    </blockquote>
    The comment was poorly written. A better comment is desirable.<br>
    <blockquote
cite="mid:CAC82fA3uwz_uruz2UTfUbUFQpN-OqYrR0vpOAL_Mf_o___rUtw@mail.gmail.com"
      type="cite">Also, this code appears to have a latent bug that
      assumes the size/alignment should be 32-bits.<br>
      <br>
      I think we should actually have<br>
      <pre>+  allocated_message_size += sizeof(uintptr_t);
+  allocated_message_size &= ~(sizeof(uintptr_t) - 1);
</pre>
      <br>
    </blockquote>
    That's better.<br>
    <blockquote
cite="mid:CAC82fA3uwz_uruz2UTfUbUFQpN-OqYrR0vpOAL_Mf_o___rUtw@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">On Wed, Aug 15, 2012 at 5:16 AM, <span
          dir="ltr"><<a moz-do-not-send="true"
            href="mailto:bugzilla-daemon@rtems.org" target="_blank">bugzilla-daemon@rtems.org</a>></span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex"><a
            moz-do-not-send="true"
            href="https://www.rtems.org/bugzilla/show_bug.cgi?id=2073"
            target="_blank">https://www.rtems.org/bugzilla/show_bug.cgi?id=2073</a><br>
          <br>
                       Bug #: 2073<br>
                     Summary: Unnecessary check for alignment and
          unreachable code<br>
                              in cpukit/score/src/coremsg.c<br>
              Classification: Unclassified<br>
                     Product: RTEMS<br>
                     Version: 4.10<br>
                    Platform: PC<br>
                  OS/Version: Linux<br>
                      Status: NEW<br>
                    Severity: enhancement<br>
                    Priority: P3<br>
                   Component: cpukit<br>
                  AssignedTo: <a moz-do-not-send="true"
            href="mailto:joel.sherrill@oarcorp.com">joel.sherrill@oarcorp.com</a><br>
                  ReportedBy: <a moz-do-not-send="true"
            href="mailto:krzysztof.miesowicz@gmail.com">krzysztof.miesowicz@gmail.com</a><br>
          <br>
          <br>
          Created attachment 1484<br>
            --> <a moz-do-not-send="true"
            href="https://www.rtems.org/bugzilla/attachment.cgi?id=1484"
            target="_blank">https://www.rtems.org/bugzilla/attachment.cgi?id=1484</a><br>
          Patch to remove unreachable code in coremsg.c<br>
          <br>
          When analyzing coverage report<br>
          <a moz-do-not-send="true"
href="http://www.rtems.org/ftp/pub/rtems/people/joel/coverage/erc32/erc32-Ospd-20120714-1625/annotated.html#range2"
            target="_blank">http://www.rtems.org/ftp/pub/rtems/people/joel/coverage/erc32/erc32-Ospd-20120714-1625/annotated.html#range2</a><br>
          I discovered that there is unreachable and unnecessary
          if-statement. It gives 2<br>
          uncovered instructions. Checking if allocated_message_size is
          less than<br>
          maximum_message_size is unnecessary as above code guarantee
          that<br>
          allocated_message_size will be equal or greater than
          maximum_message_size.<br>
          <br>
          I am sending patch as attachment.<br>
          <span class="HOEnZb"><font color="#888888"><br>
              --<br>
              Configure bugmail: <a moz-do-not-send="true"
                href="https://www.rtems.org/bugzilla/userprefs.cgi?tab=email"
                target="_blank">https://www.rtems.org/bugzilla/userprefs.cgi?tab=email</a><br>
              ------- You are receiving this mail because: -------<br>
              You are watching all bug changes.<br>
              _______________________________________________<br>
              rtems-bugs mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:rtems-bugs@rtems.org">rtems-bugs@rtems.org</a><br>
              <a moz-do-not-send="true"
                href="http://rtems.org/mailman/listinfo/rtems-bugs"
                target="_blank">http://rtems.org/mailman/listinfo/rtems-bugs</a><br>
            </font></span></blockquote>
      </div>
      <br>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Joel Sherrill, Ph.D.             Director of Research&  Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a>        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985

</pre>
  </body>
</html>