[merged mm-nonmm-stable] scripts-show_delta-add-__main__-judgement-before-main-code.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The quilt patch titled
     Subject: scripts/show_delta: add __main__ judgement before main code
has been removed from the -mm tree.  Its filename was
     scripts-show_delta-add-__main__-judgement-before-main-code.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Hu Haowen <2023002089@xxxxxxxxxxxxxxxx>
Subject: scripts/show_delta: add __main__ judgement before main code
Date: Fri, 13 Oct 2023 21:28:32 +0800

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/20231013132832.165768-1-2023002089@xxxxxxxxxxxxxxxx
Signed-off-by: Hu Haowen <2023002089@xxxxxxxxxxxxxxxx>
Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
Reviewed-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: Masahiro Yamada <masahiroy@xxxxxxxxxx>
Cc: Nicolas Schier <n.schier@xxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 scripts/show_delta |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/scripts/show_delta~scripts-show_delta-add-__main__-judgement-before-main-code
+++ a/scripts/show_delta
@@ -125,4 +125,5 @@ def main():
 	for line in lines:
 		print (convert_line(line, base_time),)
 
-main()
+if __name__ == "__main__":
+	main()
_

Patches currently in -mm which might be from 2023002089@xxxxxxxxxxxxxxxx are





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux