Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1202097rdg; Fri, 13 Oct 2023 13:28:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjh22eVR3bqS3wd06+kkOpG8L56dOQM/3BlVocLDB/CdXqVO/Trq2ygV/ifMFXk1HzLAIl X-Received: by 2002:a05:6358:7299:b0:163:ce28:91ee with SMTP id w25-20020a056358729900b00163ce2891eemr21974975rwf.19.1697228896226; Fri, 13 Oct 2023 13:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697228896; cv=none; d=google.com; s=arc-20160816; b=x9aGdAKQ0k2WkuU0SaX3s94wMDU9JcpPq1k6c9wzv4ICmHTrk4bjENwwgCNr011nFf dpemHCrUhPNrAFUWIGriWnhnWmBfKpmVkXuN+mkPr4I1yxU7RW3TwTERGOOYMnwU5mUQ Z1o11VgjempuhVH5PBqowznxkPf2vMK9+sGaf6hCq92ngB9r69CbI9/+wumlffBNvwYY GoHnMNXBrDSWZS1jlHuOhZ4Wdo+sdi12v89/Q8BuxHfwFvkgg3HMM1x6yOe7rSG0weoJ jxNCokFGW6MGA0S12xT7PF83bBC87Smruvi+23nSbG1Tbys1GWECKCLF6WMWbpGnP4FI Kh0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=iaZqQEuB1EDABln979ILtGuG4qYa8Us/Meb6pDFY+K0=; fh=wAgtcQZysEjbjee0XbyocJ/RCCr9QhpLXR6/qpNDbss=; b=FA2G0EhhgV6D6HE2DqGM90oqy0Ut88156sxvwPCqv0IBdEGSYqVbUCa06oLw1gg1x6 +rmZ9ariTD/kec27jZoVe+iswDE35Alzl0XYZRf/8Eod/0yJzJ5nbJOLbk+Bzv8/5mTw ovT8eGcBAvMvfFMgEJzuR5lWVWDAPmFHwysvGhFpHDp36SBEt1WpajeEdeEOpsrYPlbk nyKvzx7O2sSGuEculn+0gUHp5pR2vXrqEBGOMwrgfexPu+a/lGjTAEdOF9uricv8FpUa cKYZCCKg9BOEhZabZEx5xaQBNZpsxUIxNmrlQvvypwBmT8YIU2jwjlCZAw+2Fo2o+SPv hY3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=1d9nFnws; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id fb12-20020a056a002d8c00b00691004e7db0si7279589pfb.170.2023.10.13.13.28.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 13:28:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=1d9nFnws; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 45DB581BD020; Fri, 13 Oct 2023 13:28:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232099AbjJMU2D (ORCPT + 99 others); Fri, 13 Oct 2023 16:28:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232021AbjJMU2C (ORCPT ); Fri, 13 Oct 2023 16:28:02 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C655BDA for ; Fri, 13 Oct 2023 13:27:37 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-323168869daso2344277f8f.2 for ; Fri, 13 Oct 2023 13:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697228856; x=1697833656; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iaZqQEuB1EDABln979ILtGuG4qYa8Us/Meb6pDFY+K0=; b=1d9nFnwspgu2gyqkAw0fEABg69M5MW8BldPoifAEiWLhdqiO5iQhblciAacrXH2WAP 4Tncte0GkC6v5OdxD2YsLAVC8SiJjbDQxOT8ZgbEGTb6/57cNDobdHIIX5sRrlW0Ke6+ QuhWnvEuAElx6TcA0mlQdoLaA2zdTPJ6UoKScCWO6QH9L/yDOfafcZEQTERAzT7RHkDV ISuld2FhzPMFmuPlvw7BhuWAu0twW7otehwMDzGfFFOCGi6fY4MSJsv1dfQQC9uwEM9T t7xl/2O8ywk0XDISzRrOULNGIpCOfH+6hE7e48xLv/EtT85TfP7WBFs1DWcBidnVQkxo JJfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697228856; x=1697833656; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iaZqQEuB1EDABln979ILtGuG4qYa8Us/Meb6pDFY+K0=; b=dUqPz7MlL95muXqrDpDu0UHJSPQLwMRAelgb/N3NEmpfRXWSn+XbPOkwoMdUrLWvfI J7chq/ew/V9ZcEHXijAl7yNP2wcif0fcsAoDA4IoCG+hk/RQ+mK3Abx/CuPVCi5GliBq 10GZvFiqjG5UeQOfmvAKjOaTTbVUa0HHzsx6zGKXAqgZ4w7HCrRiKuU2lRLTVof/YGkP 9fjpnc5JvE2M+jFRe2b00YFgaW2a6z/0/NdeWDOPmh28rhsC3tSt0rV3Dg4YLmYrfHke zsNokT9+0e5KZs5JMOB79YhtwRzKk/W1h/x6GQLtKwz81Ntj55Gd3pcbyQHVO51+3iD5 5VoA== X-Gm-Message-State: AOJu0YzBHlRHQfzj1O89TeebA1lXb5olgLr01tWkdronL8LGpklHAgxf YQndMvVXLwUbSsty9tWDiVHaxjkyJYDiYyyyG4zTiw== X-Received: by 2002:a5d:5303:0:b0:32d:a29c:7321 with SMTP id e3-20020a5d5303000000b0032da29c7321mr1018120wrv.67.1697228855931; Fri, 13 Oct 2023 13:27:35 -0700 (PDT) MIME-Version: 1.0 References: <20231013132832.165768-1-2023002089@link.tyut.edu.cn> In-Reply-To: <20231013132832.165768-1-2023002089@link.tyut.edu.cn> From: Nick Desaulniers Date: Fri, 13 Oct 2023 13:27:24 -0700 Message-ID: Subject: Re: [PATCH] scripts/show_delta: add __main__ judgement before main code To: Hu Haowen <2023002089@link.tyut.edu.cn> Cc: gregkh@linuxfoundation.org, masahiroy@kernel.org, akpm@linux-foundation.org, n.schier@avm.de, ojeda@kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 13 Oct 2023 13:28:14 -0700 (PDT) On Fri, Oct 13, 2023 at 6:29=E2=80=AFAM Hu Haowen <2023002089@link.tyut.edu= .cn> wrote: > > When doing Python programming it is a nice convention to insert the if > statement `if __name__ =3D=3D "__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. > > Signed-off-by: Hu Haowen <2023002089@link.tyut.edu.cn> Thanks for the patch! Reviewed-by: Nick Desaulniers > --- > scripts/show_delta | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > 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__ =3D=3D "__main__": > + main() > -- > 2.34.1 > --=20 Thanks, ~Nick Desaulniers