History

Merge tag 'mm-nonmm-stable-2024-05-19-11-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull non-mm updates from Andrew Morton: "Mainly singleton patches, documented in their respective changelogs. Notable series include: - Some maintenance and performance work for ocfs2 in Heming Zhao's series "improve write IO performance when fragmentation is high". - Some ocfs2 bugfixes from Su Yue in the series "ocfs2 bugs fixes exposed by fstests". - kfifo header rework from Andy Shevchenko in the series "kfifo: Clean up kfifo.h". - GDB script fixes from Florian Rommel in the series "scripts/gdb: Fixes for $lx_current and $lx_per_cpu". - After much discussion, a coding-style update from Barry Song explaining one reason why inline functions are preferred over macros. The series is "codingstyle: avoid unused parameters for a function-like macro"" * tag 'mm-nonmm-stable-2024-05-19-11-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (62 commits) fs/proc: fix softlockup in __read_vmcore nilfs2: convert BUG_ON() in nilfs_finish_roll_forward() to WARN_ON() scripts: checkpatch: check unused parameters for function-like macro Documentation: coding-style: ask function-like macros to evaluate parameters nilfs2: use __field_struct() for a bitwise field selftests/kcmp: remove unused open mode nilfs2: remove calls to folio_set_error() and folio_clear_error() kernel/watchdog_perf.c: tidy up kerneldoc watchdog: allow nmi watchdog to use raw perf event watchdog: handle comma separated nmi_watchdog command line nilfs2: make superblock data array index computation sparse friendly squashfs: remove calls to set the folio error flag squashfs: convert squashfs_symlink_read_folio to use folio APIs scripts/gdb: fix detection of current CPU in KGDB scripts/gdb: make get_thread_info accept pointers scripts/gdb: fix parameter handling in $lx_per_cpu scripts/gdb: fix failing KGDB detection during probe kfifo: don't use "proxy" headers media: stih-cec: add missing io.h media: rc: add missing io.h ...

Linus Torvalds committed 2 years ago

Commit eb6a9332 parents 16dbfae 5cbcb6277 files · +679 −427Browse files

Showing the changes to scripts (4 of 77 files). Show all

Unified · Split

4 files
  1. scripts/checkpatch.pl +6 −0
  2. scripts/gdb/linux/cpus.py +3 −8
  3. scripts/gdb/linux/tasks.py +1 −1
  4. scripts/gdb/linux/utils.py +1 −1
scripts/checkpatch.pl+6−0
@@ -6040,6 +6040,12 @@ sub process { · 6039 unmodified lines
6040 CHK("MACRO_ARG_PRECEDENCE",6040 CHK("MACRO_ARG_PRECEDENCE",
6041 "Macro argument '$arg' may be better as '($arg)' to avoid precedence issues\n" . "$herectx");6041 "Macro argument '$arg' may be better as '($arg)' to avoid precedence issues\n" . "$herectx");
6042 }6042 }
6043
6044# check if this is an unused argument
6045 if ($define_stmt !~ /\b$arg\b/) {
6046 WARN("MACRO_ARG_UNUSED",
6047 "Argument '$arg' is not used in function-like macro\n" . "$herectx");
6048 }
6043 }6049 }
6044 6050
6045# check for macros with flow control, but without ## concatenation6051# check for macros with flow control, but without ## concatenation
scripts/gdb/linux/cpus.py+3−8
@@ -26,11 +26,7 @@ def get_current_cpu(): · 25 unmodified lines
26 if utils.get_gdbserver_type() == utils.GDBSERVER_QEMU:26 if utils.get_gdbserver_type() == utils.GDBSERVER_QEMU:
27 return gdb.selected_thread().num - 127 return gdb.selected_thread().num - 1
28 elif utils.get_gdbserver_type() == utils.GDBSERVER_KGDB:28 elif utils.get_gdbserver_type() == utils.GDBSERVER_KGDB:
29 tid = gdb.selected_thread().ptid[2]29 return gdb.parse_and_eval("kgdb_active.counter")
30 if tid > (0x100000000 - MAX_CPUS - 2):
31 return 0x100000000 - tid - 2
32 else:
33 return tasks.get_thread_info(tasks.get_task_by_pid(tid))['cpu']
34 else:30 else:
35 raise gdb.GdbError("Sorry, obtaining the current CPU is not yet "31 raise gdb.GdbError("Sorry, obtaining the current CPU is not yet "
36 "supported with this gdb server.")32 "supported with this gdb server.")
@@ -152,9 +148,8 @@ Note that VAR has to be quoted as string.""" · 115 unmodified lines
152 def __init__(self):148 def __init__(self):
153 super(PerCpu, self).__init__("lx_per_cpu")149 super(PerCpu, self).__init__("lx_per_cpu")
154 150
155 def invoke(self, var_name, cpu=-1):151 def invoke(self, var, cpu=-1):
156 var_ptr = gdb.parse_and_eval("&" + var_name.string())152 return per_cpu(var.address, cpu)
157 return per_cpu(var_ptr, cpu)
158 153
159 154
160PerCpu()155PerCpu()
scripts/gdb/linux/tasks.py+1−1
@@ -85,7 +85,7 @@ thread_info_type = utils.CachedType("struct thread_info") · 84 unmodified lines
85 85
86def get_thread_info(task):86def get_thread_info(task):
87 thread_info_ptr_type = thread_info_type.get_type().pointer()87 thread_info_ptr_type = thread_info_type.get_type().pointer()
88 if task.type.fields()[0].type == thread_info_type.get_type():88 if task_type.get_type().fields()[0].type == thread_info_type.get_type():
89 return task['thread_info']89 return task['thread_info']
90 thread_info = task['stack'].cast(thread_info_ptr_type)90 thread_info = task['stack'].cast(thread_info_ptr_type)
91 return thread_info.dereference()91 return thread_info.dereference()
scripts/gdb/linux/utils.py+1−1
@@ -196,7 +196,7 @@ def get_gdbserver_type(): · 195 unmodified lines
196 def probe_kgdb():196 def probe_kgdb():
197 try:197 try:
198 thread_info = gdb.execute("info thread 2", to_string=True)198 thread_info = gdb.execute("info thread 2", to_string=True)
199 return "shadowCPU0" in thread_info199 return "shadowCPU" in thread_info
200 except gdb.error:200 except gdb.error:
201 return False201 return False
202 202