aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl4
-rw-r--r--scripts/gdb/linux/modules.py9
2 files changed, 3 insertions, 10 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 89b1df4e72ab..c5ec977b9c37 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3169,12 +3169,12 @@ sub process {
3169 } 3169 }
3170 3170
3171# check for global initialisers. 3171# check for global initialisers.
3172 if ($line =~ /^\+(\s*$Type\s*$Ident\s*(?:\s+$Modifier))*\s*=\s*(0|NULL|false)\s*;/) { 3172 if ($line =~ /^\+$Type\s*$Ident(?:\s+$Modifier)*\s*=\s*(?:0|NULL|false)\s*;/) {
3173 if (ERROR("GLOBAL_INITIALISERS", 3173 if (ERROR("GLOBAL_INITIALISERS",
3174 "do not initialise globals to 0 or NULL\n" . 3174 "do not initialise globals to 0 or NULL\n" .
3175 $herecurr) && 3175 $herecurr) &&
3176 $fix) { 3176 $fix) {
3177 $fixed[$fixlinenr] =~ s/($Type\s*$Ident\s*(?:\s+$Modifier))*\s*=\s*(0|NULL|false)\s*;/$1;/; 3177 $fixed[$fixlinenr] =~ s/(^.$Type\s*$Ident(?:\s+$Modifier)*)\s*=\s*(0|NULL|false)\s*;/$1;/;
3178 } 3178 }
3179 } 3179 }
3180# check for static initialisers. 3180# check for static initialisers.
diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
index a1504c4f1900..25db8cff44a2 100644
--- a/scripts/gdb/linux/modules.py
+++ b/scripts/gdb/linux/modules.py
@@ -73,18 +73,11 @@ class LxLsmod(gdb.Command):
73 " " if utils.get_long_type().sizeof == 8 else "")) 73 " " if utils.get_long_type().sizeof == 8 else ""))
74 74
75 for module in module_list(): 75 for module in module_list():
76 ref = 0
77 module_refptr = module['refptr']
78 for cpu in cpus.cpu_list("cpu_possible_mask"):
79 refptr = cpus.per_cpu(module_refptr, cpu)
80 ref += refptr['incs']
81 ref -= refptr['decs']
82
83 gdb.write("{address} {name:<19} {size:>8} {ref}".format( 76 gdb.write("{address} {name:<19} {size:>8} {ref}".format(
84 address=str(module['module_core']).split()[0], 77 address=str(module['module_core']).split()[0],
85 name=module['name'].string(), 78 name=module['name'].string(),
86 size=str(module['core_size']), 79 size=str(module['core_size']),
87 ref=str(ref))) 80 ref=str(module['refcnt']['counter'])))
88 81
89 source_list = module['source_list'] 82 source_list = module['source_list']
90 t = self._module_use_type.get_type().pointer() 83 t = self._module_use_type.get_type().pointer()