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 AF174A04C5; Sun, 6 Sep 2020 03:33:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B30351C136; Sun, 6 Sep 2020 03:31:56 +0200 (CEST) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by dpdk.org (Postfix) with ESMTP id 7270A1C11E for ; Sun, 6 Sep 2020 03:31:52 +0200 (CEST) Received: by mail-pl1-f195.google.com with SMTP id y6so405027plt.9 for ; Sat, 05 Sep 2020 18:31:52 -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=aByLlh9qPbdoOHH7F/DxU/9BzjIrTZlqAe0AUsV6+zE=; b=dIIeJ/g9LVm9VrshWmP+7hrHQr+wgcd7i3xatXIxtiNldesLNgOjSX1MPDzfjF4yAw yHsqIaY7fiU+Yc9op7IEcCsrAKWSqhdkqe4idj3Emc8dm3sv1nvIKBPpN1k1LRyXsahd gayht/zHNV/EqhIKdCmpgvzLKexSQgSidhj88PwOdhPKcxKd8lCH5fUU1tBtcvgQEvTK DDWOxYKM5Cb0PX2mwDvPcu4L8GDeoTp3N8RmNxVFVeeKOR6oV8SkgUBgmIwPzzZCuwxW swRsKywjANZeAiOqLbai+ojTA9wS5m9/aw8T/XndvWWXs2ni2cmCRJzvodBBEXi5Vc26 6B7Q== 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=aByLlh9qPbdoOHH7F/DxU/9BzjIrTZlqAe0AUsV6+zE=; b=axizPmtqXyR0DihHuoDALXNEZMLfdY7+e3HNgZv265u2Eb1X4gtL8K0WvEDY1D19Vs cH+DHF3lbB2KxbAhJNqqvup/0abZlkm0AkLSmooLQ6jTpKHyA+f5qssm3AdKGq96PQ9o G4YM49rXasxel+04aKHO0rF6WCgFE65RKTRS/pJf5V2CWk5nSNJOnaAZvjBp2TuxKNKP abt4gkMwJlunrzj9YbRHXzktFT9hMLnNEcBDRUDR0Puq8qNWQUZnXWqQp1n+UjUmAG/h UbFM28lBZDBEVMF1wmH2EGmmLW0tqhkVc+oA4xaIzsTHfqVgUDuHvIEezcz+WsJlKSCV d6dw== X-Gm-Message-State: AOAM533keviIwDV6ET6RmKXn/+tIiO3WoRdJGaaFReA3IOSoIP8UV+k4 /BOJi9ukFjPkrNPR12ZqNcjW57fVOPoj1Q== X-Google-Smtp-Source: ABdhPJyOoFcW5ljmwKFWH9YdXlz1UKkaVzjiTfl7s54R6Yy3SkF6xiiRIY6rO8tiSAyne7dFCgma0A== X-Received: by 2002:a17:902:b092:b029:d0:89f1:9e2c with SMTP id p18-20020a170902b092b02900d089f19e2cmr12865457plr.8.1599355911259; Sat, 05 Sep 2020 18:31:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Sep 2020 18:31:50 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Sat, 5 Sep 2020 18:31:31 -0700 Message-Id: <20200906013133.26360-10-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 09/11] dpdk-pmdinfo: do not use len(x) to test for empty 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" This fixes the following python lint warnings. usertools/dpdk-pmdinfo.py:188:11: C1801: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition) usertools/dpdk-pmdinfo.py:196:21: C1801: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition) usertools/dpdk-pmdinfo.py:302:11: C1801: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition) Signed-off-by: Stephen Hemminger --- usertools/dpdk-pmdinfo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py index d746348f1415..632271e2f1d2 100755 --- a/usertools/dpdk-pmdinfo.py +++ b/usertools/dpdk-pmdinfo.py @@ -185,7 +185,7 @@ def findDate(self, content): return None def parse(self): - if len(self.contents) < 1: + if not len(self.contents): print("data/%s-pci.ids not found" % self.date) else: vendorID = "" @@ -193,7 +193,7 @@ def parse(self): for l in self.contents: if l[0] == "#": continue - elif len(l.strip()) == 0: + elif not l.strip(): continue else: if l.find("\t\t") == 0: @@ -299,7 +299,7 @@ def parse_pmd_info_string(self, mystring): except KeyError: continue - if len(pmdinfo["pci_ids"]) != 0: + if pmdinfo["pci_ids"]: print("PMD HW SUPPORT:") if pcidb is not None: self.pretty_print_pmdinfo(pmdinfo) -- 2.27.0