aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHu Haowen <[email protected]>2023-10-13 21:28:32 +0800
committerAndrew Morton <[email protected]>2023-10-18 14:43:23 -0700
commit94a03e1d22e8dc75ddec159b2efadd4c6354503a (patch)
tree5bd4769fdca322eb192d5c116131eee37ac5b8ba
parent68279f9c9f592e75d30a9ba5154a15e0a0b42ae8 (diff)
scripts/show_delta: add __main__ judgement before main code
When doing Python programming it is a nice convention to insert the if statement `if __name__ == "__main__":` before any main code that does actual functionalities to ensure the code will be executed only as a script rather than as an imported module. Hence attach the missing judgement to show_delta. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Hu Haowen <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Reviewed-by: Miguel Ojeda <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Nicolas Schier <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rwxr-xr-xscripts/show_delta3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/show_delta b/scripts/show_delta
index 28e67e178194..291ad65e3089 100755
--- a/scripts/show_delta
+++ b/scripts/show_delta
@@ -125,4 +125,5 @@ def main():
for line in lines:
print (convert_line(line, base_time),)
-main()
+if __name__ == "__main__":
+ main()