From: Andreas Dilger Date: Tue, 24 Jul 2018 06:06:53 +0000 (-0600) Subject: LU-10447 build: fix checkpatch.pl to not mangle case X-Git-Tag: 2.11.55~2 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=deb5aba28c1614ce646964da7b00a8b8b7355733 LU-10447 build: fix checkpatch.pl to not mangle case Fix the checkpatch.pl script to not mangle the case of the lines in the spelling.txt file, so that the replacement text can be found, and is shown as intended. Add checks for "GETSTRIPE" and "SETSTRIPE" to spelling.txt. Sort the spelling.txt file so that it is easier to see what lines are present in the file. Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: Id3a3319bc62898fbdc94573512cd6a665b13cd11 Reviewed-on: https://review.whamcloud.com/32865 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- diff --git a/contrib/scripts/checkpatch.pl b/contrib/scripts/checkpatch.pl index f077470..1e9bf50 100755 --- a/contrib/scripts/checkpatch.pl +++ b/contrib/scripts/checkpatch.pl @@ -2714,11 +2714,9 @@ sub process { # Check for various typo / spelling mistakes if (defined($misspellings) && ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) { - while ($rawline =~ /(?:^|[^a-z@])($misspellings)(?:\b|$|[^a-z@])/gi) { + while ($rawline =~ /(?:^|[^a-z@])($misspellings)(?:\b|$|[^a-z@])/g) { my $typo = $1; - my $typo_fix = $spelling_fix{lc($typo)}; - $typo_fix = ucfirst($typo_fix) if ($typo =~ /^[A-Z]/); - $typo_fix = uc($typo_fix) if ($typo =~ /^[A-Z]+$/); + my $typo_fix = $spelling_fix{$typo}; my $msg_type = \&WARN; $msg_type = \&CHK if ($file); if (&{$msg_type}("TYPO_SPELLING", diff --git a/contrib/scripts/spelling.txt b/contrib/scripts/spelling.txt index 4dfc385..062df9e 100644 --- a/contrib/scripts/spelling.txt +++ b/contrib/scripts/spelling.txt @@ -2,7 +2,6 @@ # mistake||correction # alloca||malloc -CFS_ATOMIC_INIT||ATOMIC_INIT cfs_atomic_add||atomic_add cfs_atomic_add_return||atomic_add_return cfs_atomic_add_unless||atomic_add_unless @@ -15,16 +14,26 @@ cfs_atomic_inc||atomic_inc cfs_atomic_inc_and_test||atomic_inc_and_test cfs_atomic_inc_not_zero||atomic_inc_not_zero cfs_atomic_inc_return||atomic_inc_return +CFS_ATOMIC_INIT||ATOMIC_INIT cfs_atomic_read||atomic_read cfs_atomic_set||atomic_set cfs_atomic_sub||atomic_sub cfs_atomic_sub_and_test||atomic_sub_and_test cfs_atomic_sub_return||atomic_sub_return cfs_atomic_t||atomic_t -CFS_HLIST_HEAD||HLIST_HEAD -CFS_HLIST_HEAD_INIT||HLIST_HEAD_INIT -CFS_INIT_HLIST_HEAD||INIT_HLIST_HEAD -CFS_INIT_HLIST_NODE||INIT_HLIST_NODE +cfs_hash_bd_t||struct cfs_hash_bd +cfs_hash_bucket_t||struct cfs_hash_bucket +cfs_hash_cond_arg_t||struct cfs_hash_cond_arg +cfs_hash_dhead_dep_t||struct cfs_hash_dhead_dep +cfs_hash_dhead_t||struct cfs_hash_dhead +cfs_hash_head_dep_t||struct cfs_hash_head_dep +cfs_hash_head_t||struct cfs_hash_head +cfs_hash_hlist_ops_t||struct cfs_hash_hlist_ops +cfs_hash_lock_ops_t||struct cfs_hash_lock_ops +cfs_hash_lock_t||union cfs_hash_lock +cfs_hash_lookup_intent_t||enum cfs_hash_lookup_intent +cfs_hash_ops_t||struct cfs_hash_ops +cfs_hash_t||struct cfs_hash cfs_hlist_add_after||hlist_add_after cfs_hlist_add_before||hlist_add_before cfs_hlist_add_head||hlist_add_head @@ -34,13 +43,15 @@ cfs_hlist_empty||hlist_empty cfs_hlist_entry||hlist_entry cfs_hlist_for_each||hlist_for_each cfs_hlist_for_each_safe||hlist_for_each_safe +CFS_HLIST_HEAD||HLIST_HEAD +CFS_HLIST_HEAD_INIT||HLIST_HEAD_INIT cfs_hlist_head_t||struct hlist_head cfs_hlist_node_t||struct hlist_node cfs_hlist_unhashed||hlist_unhashed -cfs_inode_t||struct inode +CFS_INIT_HLIST_HEAD||INIT_HLIST_HEAD +CFS_INIT_HLIST_NODE||INIT_HLIST_NODE CFS_INIT_LIST_HEAD||INIT_LIST_HEAD -CFS_LIST_HEAD||struct list_head foo = LIST_HEAD_INIT(foo); -CFS_LIST_HEAD_INIT||LIST_HEAD_INIT +cfs_inode_t||struct inode cfs_list_add||list_add cfs_list_add_tail||list_add_tail cfs_list_del||list_del @@ -52,100 +63,91 @@ cfs_list_for_each||list_for_each cfs_list_for_each_entry||list_for_each_entry cfs_list_for_each_entry_continue||list_for_each_entry_continue cfs_list_for_each_entry_reverse||list_for_each_entry_reverse -cfs_list_for_each_entry_safe||list_for_each_entry_safe cfs_list_for_each_entry_safe_from||list_for_each_entry_safe_from cfs_list_for_each_entry_safe_reverse||list_for_each_entry_safe_reverse cfs_list_for_each_entry_safe_typed||list_for_each_entry_safe_typed +cfs_list_for_each_entry_safe||list_for_each_entry_safe cfs_list_for_each_entry_typed||list_for_each_entry_typed cfs_list_for_each_prev||list_for_each_prev cfs_list_for_each_safe||list_for_each_safe +CFS_LIST_HEAD||struct list_head foo = LIST_HEAD_INIT(foo); +CFS_LIST_HEAD_INIT||LIST_HEAD_INIT cfs_list_move||list_move cfs_list_move_tail||list_move_tail cfs_list_splice||list_splice cfs_list_splice_init||list_splice_init cfs_list_splice_tail||list_splice_tail cfs_list_t||struct list_head -struct timeval||struct timespec64 -get_seconds||ktime_get_real_seconds -cfs_time_current_sec||ktime_get_real_seconds -cfs_time_current_64||ktime_get -cfs_time_add_64||ktime_add -cfs_time_after|time_after -cfs_time_aftereq|time_after_eq -cfs_time_before|time_before -cfs_time_beforeeq|time_before_eq -cfs_time_before_64||ktime_before -cfs_time_beforeq_64||ktime_compare -cfs_time_current|jiffies 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 -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 +cfs_time_add_64||ktime_add +cfs_time_after||time_after +cfs_time_aftereq||time_after_eq +cfs_time_before||time_before +cfs_time_beforeeq||time_before_eq +cfs_time_beforeq_64||ktime_compare +cfs_time_before_64||ktime_before +cfs_time_current||jiffies +cfs_time_current_64||ktime_get +cfs_time_current_sec||ktime_get_real_seconds +DEFINE_TIMER||CFS_DEFINE_TIMER +DN_MAX_BONUSLEN||DN_BONUS_SIZE(dnodesize) +DN_OLD_MAX_BONUSLEN||DN_BONUS_SIZE(DNODE_MIN_SIZE) +from_timer||cfs_from_timer +f_dentry||f_path.dentry +get_seconds||ktime_get_real_seconds +GETSTRIPE||LFS getstripe 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_hash_def_t||struct ldlm_ns_hash_def 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 +lnet_acceptor_connreq_t||struct lnet_acceptor_connreq +lnet_counters_t||struct lnet_counters +lnet_handle_wire_t||struct lnet_handle_wire +lnet_hdr_t||struct lnet_hdr +lnet_magicversion_t||struct lnet_magicversion +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 LPD64||%lld -LPX64||%#llx -LPX64i||%llx -LPO64||%#llo -LPLU||%lu LPLD||%ld +LPLU||%lu LPLX||%#lx +LPO64||%#llo LPPID||%d +lprocfs_str_to_s64||kstrtoxxx_from_user LPROCFS||CONFIG_PROC_FS -LPROC_SEQ_FOPS_WR_ONLY||LUSTRE_WO_ATTR +LPROC_SEQ_FOPS||LUSTRE_RW_ATTR LPROC_SEQ_FOPS_RO_TYPE||LUSTRE_RO_ATTR LPROC_SEQ_FOPS_RO||LUSTRE_RO_ATTR LPROC_SEQ_FOPS_RW_TYPE||LUSTRE_RW_ATTR -LPROC_SEQ_FOPS||LUSTRE_RW_ATTR -lprocfs_str_to_s64||kstrtoxxx_from_user +LPROC_SEQ_FOPS_WR_ONLY||LUSTRE_WO_ATTR +LPU64||%llu +LPX64i||%llx +LPX64||%#llx mktemp||mkstemp +page_cache_get||get_page +PAGE_CACHE_MASK||PAGE_MASK +page_cache_release||put_page +PAGE_CACHE_SHIFT||PAGE_SHIFT +PAGE_CACHE_SIZE||PAGE_SIZE +return seq_printf||seq_printf +SETSTRIPE||LFS setstripe +setup_timer||cfs_timer_setup += seq_printf||seq_printf sprintf||snprintf -strcpy||strncpy strcat||strncat +strcpy||strncpy +struct timeval||struct timespec64 tempnam||mkstemp -f_dentry||f_path.dentry -= seq_printf||seq_printf -return seq_printf||seq_printf -wait_queue_t|wait_queue_entry_t -DN_MAX_BONUSLEN||DN_BONUS_SIZE(dnodesize) -DN_OLD_MAX_BONUSLEN||DN_BONUS_SIZE(DNODE_MIN_SIZE) -setup_timer||cfs_timer_setup timer_setup||cfs_timer_setup -from_timer||cfs_from_timer -DEFINE_TIMER||CFS_DEFINE_TIMER +wait_queue_t||wait_queue_entry_t