Skip to content

Commit ab05128

Browse files
author
Jamie Smith
committed
Add scancode ignore rules
1 parent f6075d4 commit ab05128

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

targets/TARGET_STM/TARGET_STM32H5/STM32Cube_FW/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ target_sources(mbed-stm32h5cube-fw
118118
# HAL driver for i3c is enabled due to a circular include issue.
119119
)
120120

121-
# Silence warning
122-
set_property(SOURCE STM32H5xx_HAL_Driver/stm32h5xx_hal_hcd.c PROPERTY COMPILE_OPTIONS -Wno-old-style-declaration)
123-
124121
target_include_directories(mbed-stm32h5cube-fw
125122
INTERFACE
126123
.

targets/TARGET_STM/TARGET_STM32H5/STM32Cube_FW/STM32H5xx_HAL_Driver/stm32h5xx_hal_hcd.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ static void HCD_HC_OUT_BulkDb(HCD_HandleTypeDef *hhcd, uint8_t ch_num, uint8_t p
8888

8989
static uint16_t HAL_HCD_GetFreePMA(HCD_HandleTypeDef *hhcd, uint16_t mps);
9090
static HAL_StatusTypeDef HAL_HCD_PMAFree(HCD_HandleTypeDef *hhcd, uint32_t pma_base, uint16_t mps);
91-
static void inline HCD_HC_IN_ISO(HCD_HandleTypeDef *hhcd, uint8_t ch_num, uint8_t phy_chnum, uint32_t regvalue);
91+
// Mbed: moved inline ahead of void
92+
static inline void HCD_HC_IN_ISO(HCD_HandleTypeDef *hhcd, uint8_t ch_num, uint8_t phy_chnum, uint32_t regvalue);
9293
/**
9394
* @}
9495
*/
@@ -1797,7 +1798,8 @@ static void HCD_HC_IN_BulkDb(HCD_HandleTypeDef *hhcd,
17971798
* @param regvalue contain Snapshot of the EPCHn register when ISR is detected
17981799
* @retval none
17991800
*/
1800-
static void inline HCD_HC_IN_ISO(HCD_HandleTypeDef *hhcd, uint8_t ch_num,
1801+
// Mbed: moved inline ahead of void
1802+
static inline void HCD_HC_IN_ISO(HCD_HandleTypeDef *hhcd, uint8_t ch_num,
18011803
uint8_t phy_chnum, uint32_t regvalue)
18021804
{
18031805
/* Check if Double buffer isochronous */

tools/python/scancode_evaluate/scancode_evaluate.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@
2828
MISSING_PERMISSIVE_LICENSE_TEXT = "Non-permissive license"
2929
MISSING_SPDX_TEXT = "Missing SPDX license identifier"
3030

31+
# If a path contains text matching one of these regexes, it will be ignored for license checking.
32+
IGNORE_PATH_REGEXES = [
33+
# As of 2024, STMicro stopped putting license declaraions or SPDX identifiers
34+
# in its HAL drivers. Instead they reference a license file in the repo root.
35+
# We don't want to have to modify all their code to add SPDX license IDs every time
36+
# it gets updated, so we ignore everything under STM32Cube_FW
37+
re.compile(r"TARGET_STM/.*STM32Cube_FW")
38+
]
39+
3140
userlog = logging.getLogger("scancode_evaluate")
3241

3342
# find the mbed-os root dir by going up three levels from this script
@@ -144,6 +153,15 @@ def license_check(scancode_output_path):
144153
if scancode_output_data_file['type'] != 'file':
145154
continue
146155

156+
is_ignored = False
157+
for regex in IGNORE_PATH_REGEXES:
158+
if re.search(regex, scancode_output_data_file['path']) is not None:
159+
userlog.info("Ignoring %s due to ignore rule." % (scancode_output_data_file['path'],))
160+
is_ignored = True
161+
break
162+
if is_ignored:
163+
continue
164+
147165
if not scancode_output_data_file['licenses']:
148166
scancode_output_data_file['fail_reason'] = MISSING_LICENSE_TEXT
149167
license_offenders.append(scancode_output_data_file)

0 commit comments

Comments
 (0)