Skip to content

Commit 2e37e09

Browse files
committed
tests: patch: deprecated_api: flag __free() under drivers/net
We discourage the use of __free() in networking drivers. Flag it. Add a new netdev_warnings list which is only checked against changes under drivers/net. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent e33449f commit 2e37e09

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

tests/patch/deprecated_api/deprecated_api.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55

66
errors=( module_param )
77
warnings=( "\Wdev_hold(" "\Wdev_put(" "\Wput_net(" "\Wget_net(" "\Winit_dummy_netdev(" )
8+
netdev_warnings=( "\W__free(" )
89

910
res=0
1011
msg=""
1112

1213
check_item() {
13-
total=$(git show | grep -i '^+.*'"$item")
14+
total=$(git show $show_path | grep -i '^+.*'"$item")
1415

1516
if [ -n "$total" ]; then
16-
new=$(git show | grep -ic '^+.*'"$item")
17-
old=$(git show | grep -ic '^-.*'"$item")
17+
new=$(git show $show_path | grep -ic '^+.*'"$item")
18+
old=$(git show $show_path | grep -ic '^-.*'"$item")
1819

1920
if [ $((new + old)) -eq 0 ]; then
2021
return
@@ -36,10 +37,17 @@ check_item() {
3637
fi
3738
}
3839

40+
show_path=""
3941
for item in "${warnings[@]}"; do
4042
check_item 250
4143
done
4244

45+
show_path="-- drivers/net"
46+
for item in "${netdev_warnings[@]}"; do
47+
check_item 250
48+
done
49+
50+
show_path=""
4351
for item in "${errors[@]}"; do
4452
check_item 1
4553
done

0 commit comments

Comments
 (0)