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
60406040 CHK("MACRO_ARG_PRECEDENCE",
60416041 "Macro argument '$arg' may be better as '($arg)' to avoid precedence issues\n" . "$herectx");
60426042 }
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+ }
60436049 }
60446050
60456051 # 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
2626 if utils.get_gdbserver_type() == utils.GDBSERVER_QEMU:
2727 return gdb.selected_thread().num - 1
2828 elif utils.get_gdbserver_type() == utils.GDBSERVER_KGDB:
29− tid = gdb.selected_thread().ptid[2]
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']
29+ return gdb.parse_and_eval("kgdb_active.counter")
3430 else:
3531 raise gdb.GdbError("Sorry, obtaining the current CPU is not yet "
3632 "supported with this gdb server.")
@@ -152,9 +148,8 @@ Note that VAR has to be quoted as string.""" · 115 unmodified lines
152148 def __init__(self):
153149 super(PerCpu, self).__init__("lx_per_cpu")
154150
155− def invoke(self, var_name, cpu=-1):
156− var_ptr = gdb.parse_and_eval("&" + var_name.string())
157− return per_cpu(var_ptr, cpu)
151+ def invoke(self, var, cpu=-1):
152+ return per_cpu(var.address, cpu)
158153
159154
160155 PerCpu()
scripts/gdb/linux/tasks.py+1−1
@@ -85,7 +85,7 @@ thread_info_type = utils.CachedType("struct thread_info") · 84 unmodified lines
8585
8686 def get_thread_info(task):
8787 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():
8989 return task['thread_info']
9090 thread_info = task['stack'].cast(thread_info_ptr_type)
9191 return thread_info.dereference()
scripts/gdb/linux/utils.py+1−1
@@ -196,7 +196,7 @@ def get_gdbserver_type(): · 195 unmodified lines
196196 def probe_kgdb():
197197 try:
198198 thread_info = gdb.execute("info thread 2", to_string=True)
199− return "shadowCPU0" in thread_info
199+ return "shadowCPU" in thread_info
200200 except gdb.error:
201201 return False
202202