From 4690304c59b28f34e0a2deb1422b340a28a220f8 Mon Sep 17 00:00:00 2001 From: renxiaohui Date: Thu, 3 Jul 2025 16:08:43 +0800 Subject: [PATCH] embsys:Standardize variables and address variable renaming issues. Description: Optimize variable names in the remount and usbflash_error module. --- nos/extend_features/remount_consistent/remount.c | 10 +++++----- .../usbflash_error/usbflash_error.c | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/nos/extend_features/remount_consistent/remount.c b/nos/extend_features/remount_consistent/remount.c index 4f3202768bf3..d33457ee7256 100644 --- a/nos/extend_features/remount_consistent/remount.c +++ b/nos/extend_features/remount_consistent/remount.c @@ -24,16 +24,16 @@ void init_lookup_symbol(void) new_kallsyms_lookup_name = (void *)kprobe_kallsyms_lookup_name.addr; unregister_kprobe(&kprobe_kallsyms_lookup_name); } -seqlock_t* my_mount_lock; +seqlock_t* remount_lock; static inline void lock_mount_hash(void) { - write_seqlock(my_mount_lock); + write_seqlock(remount_lock); } static inline void unlock_mount_hash(void) { - write_sequnlock(my_mount_lock); + write_sequnlock(remount_lock); } static void sb_prepare_remount_readwrite(void *ignore, struct super_block *sb) @@ -87,7 +87,7 @@ int __init remount_consistent_init(void) } #endif init_lookup_symbol(); - my_mount_lock = (seqlock_t*)new_kallsyms_lookup_name("mount_lock"); + remount_lock = (seqlock_t*)new_kallsyms_lookup_name("mount_lock"); for_each_kernel_tracepoint(register_tracepoint, NULL); return 0; } @@ -103,4 +103,4 @@ void __exit remount_consistent_exit(void) module_init(remount_consistent_init); module_exit(remount_consistent_exit); -MODULE_LICENSE("GPL"); \ No newline at end of file +MODULE_LICENSE("GPL"); diff --git a/nos/extend_features/usbflash_error/usbflash_error.c b/nos/extend_features/usbflash_error/usbflash_error.c index d7b2f8d71b9c..25029bef1aff 100644 --- a/nos/extend_features/usbflash_error/usbflash_error.c +++ b/nos/extend_features/usbflash_error/usbflash_error.c @@ -13,7 +13,7 @@ static struct extend_feature usbflash_error_feature = { int handler_time = 5 * 60 * 1000; int nl_sndto_user(const char *snd_str); struct hrtimer hrtimer; -struct dentry *scsi_timeout; +struct dentry *usbflash_err_scsi_timeout; static enum hrtimer_restart send_handler_blocked_msg_timer_fn(struct hrtimer *hrtimer) { @@ -32,7 +32,7 @@ void hrtimer_detect(struct Scsi_Host *shost){ return; } -void my_hrtimer_cancel(struct Scsi_Host *shost){ +void usbflash_err_hrtimer_cancel(struct Scsi_Host *shost){ hrtimer_cancel(&hrtimer); return; } @@ -47,7 +47,7 @@ static void register_tracepoint(struct tracepoint *tp, void *priv) } if (strcmp(tp->name, "exit_hrtimer_detect") == 0) { - ret = tracepoint_probe_register(tp, my_hrtimer_cancel, NULL); + ret = tracepoint_probe_register(tp, usbflash_err_hrtimer_cancel, NULL); if(ret != 0) pr_err("register trace exit_hrtimer_detect failed: %d\n", ret); } @@ -63,7 +63,7 @@ static void unregister_tracepoint(struct tracepoint *tp, void *priv) } if (strcmp(tp->name, "exit_hrtimer_detect") == 0) { - ret = tracepoint_probe_unregister(tp, my_hrtimer_cancel, NULL); + ret = tracepoint_probe_unregister(tp, usbflash_err_hrtimer_cancel, NULL); if(ret != 0) pr_err("register trace exit_hrtimer_detect failed: %d\n", ret); } @@ -141,7 +141,7 @@ static int extend_feature_init(void){ int __init usbflash_error_init(void) { - scsi_timeout = debugfs_create_file("scsi_err_handler_timeout" ,S_IFREG | S_IRUGO,NULL,NULL,&scsi_err_handler_timeout_fops); + usbflash_err_scsi_timeout = debugfs_create_file("scsi_err_handler_timeout" ,S_IFREG | S_IRUGO,NULL,NULL,&scsi_err_handler_timeout_fops); for_each_kernel_tracepoint(register_tracepoint, NULL); #ifdef CONFIG_EXTEND_FEATURES extend_feature_init(); @@ -152,7 +152,7 @@ int __init usbflash_error_init(void) void __exit usbflash_error_exit(void) { for_each_kernel_tracepoint(unregister_tracepoint, NULL); - debugfs_remove(scsi_timeout); + debugfs_remove(usbflash_err_scsi_timeout); #ifdef CONFIG_EXTEND_FEATURES extend_feature_unregister(&usbflash_error_feature); #endif @@ -161,4 +161,4 @@ void __exit usbflash_error_exit(void) module_init(usbflash_error_init); module_exit(usbflash_error_exit); -MODULE_LICENSE("GPL"); \ No newline at end of file +MODULE_LICENSE("GPL"); -- Gitee