<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 2, 2023 at 6:45 AM Christian MAUDERER <<a href="mailto:christian.mauderer@embedded-brains.de">christian.mauderer@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Joel,<br>
<br>
thanks. Is the ID processed somewhere automatically so that I should use <br>
a special format? Otherwise I can just just add the error message from <br>
covertity:<br>
<br>
** CID 1539495: Integer handling issues (CONSTANT_EXPRESSION_RESULT)<br>
/bsps/shared/dev/rtc/mcp7940m.c: 317 in mcp7940m_set_time()<br></blockquote><div><br></div><div>It is not processed special. The CID is just nice to have in the future and, if needed,</div><div>track back to what Coverity saw.</div><div><br></div><div>Especially given the history with some of these static analysis triggered fixes where</div><div>they are hard to get right.</div><div><br></div><div>--joel </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Best regards<br>
<br>
Christian<br>
<br>
On 2023-08-02 13:43, Joel Sherrill wrote:<br>
> Ok but out the Coverity Id number in the commit long message<br>
> <br>
> On Wed, Aug 2, 2023, 1:17 AM Christian Mauderer <br>
> <<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a> <br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>>> wrote:<br>
> <br>
> Coverity warns that (buf[...] & 0x7) can't be bigger than 7. This patch<br>
> removes the unnecessary comparison.<br>
> ---<br>
> bsps/shared/dev/rtc/mcp7940m.c | 5 ++---<br>
> 1 file changed, 2 insertions(+), 3 deletions(-)<br>
> <br>
> diff --git a/bsps/shared/dev/rtc/mcp7940m.c<br>
> b/bsps/shared/dev/rtc/mcp7940m.c<br>
> index 78a4f21b58..1abc5faaad 100644<br>
> --- a/bsps/shared/dev/rtc/mcp7940m.c<br>
> +++ b/bsps/shared/dev/rtc/mcp7940m.c<br>
> @@ -312,9 +312,8 @@ static int mcp7940m_set_time(int minor, const<br>
> rtems_time_of_day *time)<br>
> }<br>
> <br>
> if (rv == 0) {<br>
> - /* Make sure weekday is in range. Otherwise it's not relevant. */<br>
> - if (RTCWKDAY_WKDAY_GET(buf[REG_RTCWKDAY]) < 1 ||<br>
> - RTCWKDAY_WKDAY_GET(buf[REG_RTCWKDAY]) > 7) {<br>
> + /* Make sure weekday is not 0 (out of range). Otherwise it's<br>
> not used. */<br>
> + if (RTCWKDAY_WKDAY_GET(buf[REG_RTCWKDAY]) < 1) {<br>
> buf[REG_RTCWKDAY] &= ~RTCWKDAY_WKDAY_MASK;<br>
> buf[REG_RTCWKDAY] |= RTCWKDAY_WKDAY(1);<br>
> }<br>
> -- <br>
> 2.35.3<br>
> <br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a> <mailto:<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a>><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
> <<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a>><br>
> <br>
<br>
-- <br>
--------------------------------------------<br>
embedded brains GmbH & Co. KG<br>
Herr Christian MAUDERER<br>
Dornierstr. 4<br>
82178 Puchheim<br>
Germany<br>
email: <a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
phone: +49-89-18 94 741 - 18<br>
mobile: +49-176-152 206 08<br>
<br>
Registergericht: Amtsgericht München<br>
Registernummer: HRA 117265<br>
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler<br>
Unsere Datenschutzerklärung finden Sie hier:<br>
<a href="https://embedded-brains.de/datenschutzerklaerung/" rel="noreferrer" target="_blank">https://embedded-brains.de/datenschutzerklaerung/</a><br>
</blockquote></div></div>