Whamcloud - gitweb
LU-8424 osd-zfs: ZFS macro DN_MAX_BONUSLEN is deprecated
[fs/lustre-release.git] / contrib / scripts / checkpatch.pl
index b91310a..893fa89 100755 (executable)
@@ -357,6 +357,7 @@ my %dep_includes = (
 );
 
 my %dep_functions = (
+       'alloca',                       'malloc',
        'CFS_ATOMIC_INIT',              'ATOMIC_INIT',
        'cfs_atomic_add',               'atomic_add',
        'cfs_atomic_add_return',        'atomic_add_return',
@@ -389,13 +390,6 @@ my %dep_functions = (
        'cfs_hlist_empty',              'hlist_empty',
        'cfs_hlist_entry',              'hlist_entry',
        'cfs_hlist_for_each',           'hlist_for_each',
-       'cfs_hlist_for_each_entry',     'hlist_for_each_entry',
-       'cfs_hlist_for_each_entry_continue',
-                                       'hlist_for_each_entry_continue',
-       'cfs_hlist_for_each_entry_from',
-                                       'hlist_for_each_entry_from',
-       'cfs_hlist_for_each_entry_safe',
-                                       'hlist_for_each_entry_safe',
        'cfs_hlist_for_each_safe',      'hlist_for_each_safe',
        'cfs_hlist_head_t',             'struct hlist_head',
        'cfs_hlist_node_t',             'struct hlist_node',
@@ -438,19 +432,77 @@ my %dep_functions = (
        'cfs_list_splice_tail',         'list_splice_tail',
        'cfs_list_t',                   'struct list_head',
 
-       'CFS_PAGE_MASK',                'PAGE_CACHE_MASK or PAGE_MASK',
-       'CFS_PAGE_SIZE',                'PAGE_CACHE_SIZE or PAGE_SIZE',
+       'CFS_PAGE_MASK',                'PAGE_MASK',
+       'CFS_PAGE_SIZE',                'PAGE_SIZE',
+       'PAGE_CACHE_MASK',              'PAGE_MASK',
+       'PAGE_CACHE_SIZE',              'PAGE_SIZE',
+       'PAGE_CACHE_SHIFT',             'PAGE_SHIFT',
+
+       'page_cache_release',           'put_page',
+       'page_cache_get',               'get_page',
 
        'cfs_proc_dir_entry_t',         'struct proc_dir_entry',
 
        'cfs_rcu_head_t',               'struct rcu_head',
 
-       'alloca',                       'malloc',
+       'cfs_hash_lock_t',              'union cfs_hash_lock',
+       'cfs_hash_bucket_t',            'struct cfs_hash_bucket',
+       'cfs_hash_bd_t',                'struct cfs_hash_bd',
+       'cfs_hash_t',                   'struct cfs_hash',
+       'cfs_hash_lock_ops_t',          'struct cfs_hash_lock_ops',
+       'cfs_hash_hlist_ops_t',         'struct cfs_hash_hlist_ops',
+       'cfs_hash_ops_t',               'struct cfs_hash_ops',
+       'cfs_hash_head_t',              'struct cfs_hash_head',
+       'cfs_hash_head_dep_t',          'struct cfs_hash_head_dep',
+       'cfs_hash_dhead_t',             'struct cfs_hash_dhead',
+       'cfs_hash_dhead_dep_t',         'struct cfs_hash_dhead_dep',
+       'cfs_hash_lookup_intent_t',     'enum cfs_hash_lookup_intent',
+       'cfs_hash_cond_arg_t',          'struct cfs_hash_cond_arg',
+
+       'lnet_ni_status_t',             'struct lnet_ni_status',
+       'lnet_ping_info_t',             'struct lnet_ping_info',
+       'lnet_process_id_packed_t',     'struct lnet_process_id_packed',
+       'lnet_handle_wire_t',           'struct lnet_handle_wire',
+       'lnet_hdr_t',                   'struct lnet_hdr',
+       'lnet_magicversion_t',          'struct lnet_magicversion',
+       'lnet_acceptor_connreq_t',      'struct lnet_acceptor_connreq',
+       'lnet_counters_t',              'struct lnet_counters',
+
+       'ldlm_appetite_t',              'enum ldlm_appetite',
+       'ldlm_cancel_flags_t',          'enum ldlm_cancel_flags',
+       'ldlm_error_t',                 'enum ldlm_error',
+       'ldlm_ns_hash_def_t',           'struct ldlm_ns_hash_def',
+       'ldlm_mode_t',                  'enum ldlm_mode',
+       'ldlm_ns_type_t',               'enum ldlm_ns_type',
+       'ldlm_policy_data_t',           'enum ldlm_policy_data',
+       'ldlm_policy_res_t',            'enum ldlm_policy_res',
+       'ldlm_side_t',                  'enum ldlm_side',
+       'ldlm_type_t',                  'enum ldlm_type',
+       'ldlm_wire_policy_data_t',      'union ldlm_wire_policy_data',
+
+       'LPU64',                        '%llu',
+       'LPD64',                        '%lld',
+       'LPX64',                        '%#llx',
+       'LPX64i',                       '%llx',
+       'LPO64',                        '%#llo',
+
+       'LPLU',                         '%lu',
+       'LPLD',                         '%ld',
+       'LPLX',                         '%#lx',
+       'LPPID',                        '%d',
+
+       'LPROCFS',                      'CONFIG_PROC_FS',
        'mktemp',                       'mkstemp',
        'sprintf',                      'snprintf',
        'strcpy',                       'strncpy',
        'strcat',                       'strncat',
        'tempnam',                      'mkstemp',
+       'f_dentry',                     'f_path.dentry',
+       '= seq_printf',                 'seq_printf',
+       'return seq_printf',            'seq_printf',
+
+       'DN_MAX_BONUSLEN',              'DN_BONUS_SIZE(dnodesize)',
+       'DN_OLD_MAX_BONUSLEN',          'DN_BONUS_SIZE(DNODE_MIN_SIZE)',
 );
 
 my @rawlines = ();
@@ -1848,8 +1900,9 @@ sub process {
                        }
                }
 
-# check we are in a valid source file C or perl if not then ignore this hunk
-               next if ($realfile !~ /\.(h|c|pl)$/);
+# check we are in a valid source file C, perl or bash script
+# if not then ignore this hunk
+               next if ($realfile !~ /\.(h|c|pl|sh)$/);
 
 # at the beginning of a line any tabs must come first and anything
 # more than 8 must use tabs.
@@ -3456,6 +3509,11 @@ sub process {
                        WARN("EXPORTED_WORLD_WRITABLE",
                             "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
                }
+
+               if ($rawline =~ /version 3/) {
+                       WARN("GPLV3",
+                            "using GPLv3 is usually wrong\n" . $herecurr);
+               }
        }
 
        # If we have no input at all, then there is nothing to report on