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 ...
Showing the changes to scripts (4 of 77 files). Show all
Unified · Split
| @@ -6040,6 +6040,12 @@ sub process { · 6039 unmodified lines | ||
| 6040 | 6040 | CHK("MACRO_ARG_PRECEDENCE", |
| 6041 | 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 | 6051 | # check for macros with flow control, but without ## concatenation |
| @@ -26,11 +26,7 @@ def get_current_cpu(): · 25 unmodified lines | ||
| 26 | 26 | if utils.get_gdbserver_type() == utils.GDBSERVER_QEMU: |
| 27 | 27 | return gdb.selected_thread().num - 1 |
| 28 | 28 | 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") | |
| 34 | 30 | else: |
| 35 | 31 | raise gdb.GdbError("Sorry, obtaining the current CPU is not yet " |
| 36 | 32 | "supported with this gdb server.") |
| @@ -152,9 +148,8 @@ Note that VAR has to be quoted as string.""" · 115 unmodified lines | ||
| 152 | 148 | def __init__(self): |
| 153 | 149 | super(PerCpu, self).__init__("lx_per_cpu") |
| 154 | 150 | |
| 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) | |
| 158 | 153 | |
| 159 | 154 | |
| 160 | 155 | PerCpu() |
| @@ -85,7 +85,7 @@ thread_info_type = utils.CachedType("struct thread_info") · 84 unmodified lines | ||
| 85 | 85 | |
| 86 | 86 | def get_thread_info(task): |
| 87 | 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 | 89 | return task['thread_info'] |
| 90 | 90 | thread_info = task['stack'].cast(thread_info_ptr_type) |
| 91 | 91 | return thread_info.dereference() |
| @@ -196,7 +196,7 @@ def get_gdbserver_type(): · 195 unmodified lines | ||
| 196 | 196 | def probe_kgdb(): |
| 197 | 197 | try: |
| 198 | 198 | thread_info = gdb.execute("info thread 2", to_string=True) |
| 199 | − return "shadowCPU0" in thread_info | |
| 199 | + return "shadowCPU" in thread_info | |
| 200 | 200 | except gdb.error: |
| 201 | 201 | return False |
| 202 | 202 | |