aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/task-analyzer.py
diff options
context:
space:
mode:
authorLorenzo Stoakes <[email protected]>2024-09-24 21:10:23 +0100
committerAndrew Morton <[email protected]>2024-11-05 16:56:23 -0800
commitcd3f8467afd470ccab0de2fbc7c76664af4a0bac (patch)
treeb003ded030766b06b9442941539d90f7b6c88674 /tools/perf/scripts/python/task-analyzer.py
parent5e99893444a0e0582feb49d618195114b6e35760 (diff)
mm: refactor mm_access() to not return NULL
mm_access() can return NULL if the mm is not found, but this is handled the same as an error in all callers, with some translating this into an -ESRCH error. Only proc_mem_open() returns NULL if no mm is found, however in this case it is clearer and makes more sense to explicitly handle the error. Additionally we take the opportunity to refactor the function to eliminate unnecessary nesting. Simplify things by simply returning -ESRCH if no mm is found - this both eliminates confusing use of the IS_ERR_OR_NULL() macro, and simplifies callers which would return -ESRCH by returning this error directly. [[email protected]: prefer neater pointer error comparison] Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Lorenzo Stoakes <[email protected]> Suggested-by: Arnd Bergmann <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions