blob: a03aaa1873f6b282c8e12bd632f090cc6e5e4a0d [file] [log] [blame]
Inaky Perez-Gonzalez8ddf82c2015-04-10 16:44:37 -07001#!/bin/sh
2
Yonattan Louisecfd84172015-04-15 14:04:16 -05003#
4# Copyright (c) 2015 Intel Corporation.
5#
David B. Kinderac74d8b2017-01-18 17:01:01 -08006# SPDX-License-Identifier: Apache-2.0
Yonattan Louisecfd84172015-04-15 14:04:16 -05007#
8
Inaky Perez-Gonzalez8ddf82c2015-04-10 16:44:37 -07009[ -f $1 ] && rm $1
10[ -f $1_error.types ] && rm $1_error.types
11[ -f $1_warning.types ] && rm $1_warning.types
12
13dirs_to_check="arch drivers include kernel lib"
14files=$(for d in ${dirs_to_check}; do find $d/ -type f -name '*.[ch]'; done)
15for i in $files; do
Anas Nashifb8823772015-06-05 22:46:00 -040016 ${ZEPHYR_BASE}/scripts/checkpatch.pl --mailback --no-tree -f --emacs --summary-file --show-types --ignore BRACES,PRINTK_WITHOUT_KERN_LEVEL,SPLIT_STRING --max-line-length=100 $i >> $1
Inaky Perez-Gonzalez8ddf82c2015-04-10 16:44:37 -070017done
18grep ERROR: $1 |cut -d : -f 3,4 |sort -u > $1_error.types
19grep WARNING: $1 |cut -d : -f 3,4 |sort -u > $1_warning.types
20for i in `cat $1_error.types`; do
21 echo -n $i ' '; grep $i $1 | wc -l
22done
23for i in `cat $1_warning.types`; do
24 echo -n $i ' '; grep $i $1 | wc -l
25done