From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 11AA7A04C5; Sun, 6 Sep 2020 03:32:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 653EC1C126; Sun, 6 Sep 2020 03:31:53 +0200 (CEST) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by dpdk.org (Postfix) with ESMTP id 2FA581C0CD for ; Sun, 6 Sep 2020 03:31:49 +0200 (CEST) Received: by mail-pg1-f176.google.com with SMTP id 31so6263046pgy.13 for ; Sat, 05 Sep 2020 18:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aRa6qQxtPXReZzHu42y98tv9PIL+dbM+384ha1rUngw=; b=n8YBASWAL976+O4bMyfeSrvYUczyJ/R4HrwAL7TRP4q3prbkwNRnVJ/r4xwKWz8L5z c231B3lUJ4UxpiCZmi24kuj4tJl0wP83hyvzn7Q8iQXnhi/EyuPQrjWjToHkb6Azr8FX SOnmRyg5W7QC4FjvGydiyYmQ9JQSlBX0RFhewQuPieS8K8yGCD6NS6f3imTF0g7C2vr/ t9A4t6ClqLzioYJEBgoOudMxo/Ty+0bLbLagFquXhwgA+zH3mmljsqJ5daTN+cDPflt1 eYp9oPMpSP8WzwfBAqyDByYT48c4oiDcuQnjNyLEGqVSF1+I0XG/chG5V/ziK0mehxrv UO4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aRa6qQxtPXReZzHu42y98tv9PIL+dbM+384ha1rUngw=; b=Vr7S/4UeJnEjtxhgwwWiHD9BaDfONWGoeG3RIzWPFt32aAARWVj2EsjxFbcXyO6pi6 yRCFLT2u7UvHhh1jcWGOZde3+NoViEW8qxHbqYq/qScCHdAreN34HZ+pyHsnudBZQ4D/ GdbLj2EAd+a+Z/9tVJZTGx2WpL2veuGRUWphty3j3pl2Gc2IymXI5sl0UWdItBX7lWyu TENvxIMzV4vVtfTitbyyeRpVTDtDj76BWNf4xojK4pS5HRky3mB0/DCvQ4Yysp3nTnaH m5A3wiSnvR/szZLKnk5HulFo7Vwr4JrejPNWVqliZaAXwYluGtKhCnwUo2JfFFp/BJ9g sp/Q== X-Gm-Message-State: AOAM531vJm2+zB+oLTF5gWoEXcQS5GwsRI1QuZFSubSjfAgRcG/agHbF YIeMk0Ya3rghZmdNwBAbQrJzBri9zOwN3Q== X-Google-Smtp-Source: ABdhPJykHW147q/i17vIfg9/NLRyb6Wgh8F8EaeZLZDLqyqw6Hns9n1zN0JFDns7Gfl3E6AtaDcugA== X-Received: by 2002:a63:4746:: with SMTP id w6mr12460848pgk.412.1599355908003; Sat, 05 Sep 2020 18:31:48 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id n127sm10731863pfn.155.2020.09.05.18.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Sep 2020 18:31:47 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Sat, 5 Sep 2020 18:31:28 -0700 Message-Id: <20200906013133.26360-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200906013133.26360-1-stephen@networkplumber.org> References: <20200906013133.26360-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 06/11] dpdk-pmdinfo: replace is False and is True X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Code reads better if unnecessary comparison with False and True is not used. Signed-off-by: Stephen Hemminger --- usertools/dpdk-pmdinfo.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py index 32f8a82519fb..7c27a91182e4 100755 --- a/usertools/dpdk-pmdinfo.py +++ b/usertools/dpdk-pmdinfo.py @@ -367,7 +367,7 @@ def search_for_autoload_path(self): ":/usr/lib64:/lib64:/usr/lib:/lib") if library is None: return (None, None) - if raw_output is False: + if not raw_output: print("Scanning for autoload path in %s" % library) scanfile = open(library, 'rb') scanelf = ReadElf(scanfile, sys.stdout) @@ -443,7 +443,7 @@ def process_dt_needed_entries(self): runpath + ":" + ldlibpath + ":/usr/lib64:/lib64:/usr/lib:/lib") if library is not None: - if raw_output is False: + if not raw_output: print("Scanning %s for pmd information" % library) with open(library, 'rb') as file: try: @@ -473,7 +473,7 @@ def force_bytes(s): def scan_autoload_path(autoload_path): global raw_output - if os.path.exists(autoload_path) is False: + if not os.path.exists(autoload_path): return try: @@ -497,7 +497,7 @@ def scan_autoload_path(autoload_path): # No permission to read the file, skip it continue - if raw_output is False: + if not raw_output: print("Hw Support for library %s" % d) readelf.display_pmd_info_strings(".rodata") file.close() @@ -510,8 +510,8 @@ def scan_for_autoload_pmds(dpdk_path): """ global raw_output - if os.path.isfile(dpdk_path) is False: - if raw_output is False: + if not os.path.isfile(dpdk_path): + if not raw_output: print("Must specify a file name") return @@ -519,22 +519,22 @@ def scan_for_autoload_pmds(dpdk_path): try: readelf = ReadElf(file, sys.stdout) except ElfError: - if raw_output is False: + if not raw_output: print("Unable to parse %s" % file) return (autoload_path, scannedfile) = readelf.search_for_autoload_path() if not autoload_path: - if raw_output is False: + if not raw_output: print("No autoload path configured in %s" % dpdk_path) return - if raw_output is False: + if not raw_output: if scannedfile is None: scannedfile = dpdk_path print("Found autoload path %s in %s" % (autoload_path, scannedfile)) file.close() - if raw_output is False: + if not raw_output: print("Discovered Autoload HW Support:") scan_autoload_path(autoload_path) return @@ -593,14 +593,14 @@ def main(stream=None): optparser.print_usage() exit(1) - if options.pdir is True: + if options.pdir: exit(scan_for_autoload_pmds(args[0])) ldlibpath = os.environ.get('LD_LIBRARY_PATH') if ldlibpath is None: ldlibpath = "" - if os.path.exists(args[0]) is True: + if os.path.exists(args[0]): myelffile = args[0] else: myelffile = search_file( -- 2.27.0