Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable misra-c2012-10.6 #1811

Merged
merged 16 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions board/drivers/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ int current_int0_alt_setting = 0;

void *USB_ReadPacket(void *dest, uint16_t len) {
uint32_t *dest_copy = (uint32_t *)dest;
uint32_t count32b = (len + 3U) / 4U;
uint32_t count32b = ((uint32_t)len + 3U) / 4U;

for (uint32_t i = 0; i < count32b; i++) {
*dest_copy = USBx_DFIFO(0);
Expand All @@ -379,9 +379,9 @@ void USB_WritePacket(const void *src, uint16_t len, uint32_t ep) {
hexdump(src, len);
#endif

uint32_t numpacket = (len + (USBPACKET_MAX_SIZE - 1U)) / USBPACKET_MAX_SIZE;
uint32_t numpacket = ((uint32_t)len + (USBPACKET_MAX_SIZE - 1U)) / USBPACKET_MAX_SIZE;
uint32_t count32b = 0;
count32b = (len + 3U) / 4U;
count32b = ((uint32_t)len + 3U) / 4U;

// TODO: revisit this
USBx_INEP(ep)->DIEPTSIZ = ((numpacket << 19) & USB_OTG_DIEPTSIZ_PKTCNT) |
Expand Down
2 changes: 1 addition & 1 deletion tests/misra/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cd $CPPCHECK_DIR
VERS="2.13.0"
git fetch --all --tags
git checkout $VERS
git cherry-pick -n f6b538e855f0bacea33c4074664628024ef39dc6
git cherry-pick -n f6b538e855f0bacea33c4074664628024ef39dc6 b11b42087ff29569bc3740f5aa07eb6616ea4f63

#make clean
make MATCHCOMPILTER=yes CXXFLAGS="-O2" -j8
1 change: 0 additions & 1 deletion tests/misra/suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ misra-c2012-1.2 # this is from the extensions (e.g. __typeof__) used in the MIN
misra-c2012-2.5
misra-c2012-8.7
misra-c2012-8.4
misra-c2012-10.6
misra-c2012-21.15
Loading