RTEMS | GRCANFD: Fix Coverity issues (!390)

Gedare Bloom (@gedare) gitlab at rtems.org
Wed Feb 5 16:19:34 UTC 2025




Gedare Bloom started a new discussion on bsps/shared/grlib/can/grcanfd.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/390#note_119131

 >  				return GRCAN_RET_INVARG;
 >  			break;
 >  		}
 > -		dest->head[1] = (dlc << 28) |
 > +		dest->head[1] = ((dlc & 0xf) << 28) |

I would suggest keeping `uint8_t dlc` and use `if (dlc > 15)` instead of `if (dlc < 0)`.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/390#note_119131
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250205/e9513c3f/attachment-0001.htm>


More information about the bugs mailing list