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 B7E7EA04E7; Wed, 4 Nov 2020 08:05:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F25CC848; Wed, 4 Nov 2020 08:04:07 +0100 (CET) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id CB891C81C for ; Wed, 4 Nov 2020 08:04:01 +0100 (CET) Received: by mail-pf1-f194.google.com with SMTP id 10so16529824pfp.5 for ; Tue, 03 Nov 2020 23:04:01 -0800 (PST) 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=Ssx7rkqCID6yWPtFHHoaUynqyCRsHtvcuTNn18C7qCE=; b=pRshjgmPQl3siNCmWT8pbHpZTIZoRTXeQvK10v6/Tt3KKRIQ8NmqcKNCKbpLFUqzbH hksGoW1fw+fAHylgfVnBFryYcX2UK2jVAu7kkvcLRWeHVDDAIisZYWqPANK8q4UeQpXA 4sdQBlQ4qeYXrQbMa/IvHpgWyY4V13TNQyAHyAx4pimj++35vQ5LhS8GWNcwsQc4iISr OTTZtlvhd/EroP/QwJu0A7fVL0tdC37sG++ae/sMDIi5zGSSJHMnI9mlgbby+eH6y3KC yls0D+TKidVCpN1gpd7I/w7+aYszTuIc4Yyl/Miq8kH3n0WMQyP5/k8EOLoav57FctBU JAzQ== 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=Ssx7rkqCID6yWPtFHHoaUynqyCRsHtvcuTNn18C7qCE=; b=ShdwXTxRo5CMmqtDFWLTquND9I1OqYdYEKN7UoMi1HUVRAPJ508jVFjkv8rMzzUdQe idX4oB1Qsu708SYdXGrtRpO6ai2bb1kltpDNGMbw4I7LkFYs3S9K7d5Nm2XD9NMV3al/ VUEtFzU3IsFpEQFdndYewp3ORdspEUj4T065xSB7Gncx0S71iVAYYXyAeXbVqshkYZ+4 drBrcM8mJgRhBocH4SHOIsnT+FRHeyC9Wq3WywOrOctVcKh5BOLJQNGIiBBmqmBFujWh fYWNj5fxeHRS6AX/8xif3Vg+yHFsZD8yoyNx/IoVIn74qkYIFDsYbjkrDlNAj43QJnFg GM0w== X-Gm-Message-State: AOAM532WHG3eZy+zACg+NpWoeibpqy2hrCLjnYW8uNkwmVMkV45exZ1y kqj1Y2ZL8bYjH3QNP/pmsvjS3xxnJNjeqR8Z X-Google-Smtp-Source: ABdhPJx9EUitgcdgy/3fV67h0J+78uYTt9rlcfpsqlkCTJCmfDr/NHMcSaHC/Lc7MxWkw4p2GuiVlw== X-Received: by 2002:a62:7a8d:0:b029:160:9e0:5ff6 with SMTP id v135-20020a627a8d0000b029016009e05ff6mr30425444pfc.52.1604473440688; Tue, 03 Nov 2020 23:04:00 -0800 (PST) Received: from hermes.corp.microsoft.com (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id z21sm1181177pfa.158.2020.11.03.23.03.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2020 23:03:59 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 3 Nov 2020 23:03:50 -0800 Message-Id: <20201104070350.28224-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201104070350.28224-1-stephen@networkplumber.org> References: <20200906013133.26360-12-stephen@networkplumber.org> <20201104070350.28224-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 6/6] dpdk-devbind: use in to test for multiple strings 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" Python lint suggests using in instead of multiple comparisons. Signed-off-by: Stephen Hemminger --- usertools/dpdk-devbind.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index 47373e27bd74..054ad2e1cfbd 100755 --- a/usertools/dpdk-devbind.py +++ b/usertools/dpdk-devbind.py @@ -557,28 +557,28 @@ def show_status(): Displays to the user what devices are bound to the igb_uio driver, the kernel driver or to no driver''' - if status_dev == "net" or status_dev == "all": + if status_dev in ["net", "all"]: show_device_status(network_devices, "Network", if_field=True) - if status_dev == "baseband" or status_dev == "all": + if status_dev in ["baseband", "all"]: show_device_status(baseband_devices, "Baseband") - if status_dev == "crypto" or status_dev == "all": + if status_dev in ["crypto", "all"]: show_device_status(crypto_devices, "Crypto") - if status_dev == "event" or status_dev == "all": + if status_dev in ["event", "all"]: show_device_status(eventdev_devices, "Eventdev") - if status_dev == "mempool" or status_dev == "all": + if status_dev in ["mempool", "all"]: show_device_status(mempool_devices, "Mempool") - if status_dev == "compress" or status_dev == "all": + if status_dev in ["compress", "all"]: show_device_status(compress_devices, "Compress") - if status_dev == "misc" or status_dev == "all": + if status_dev in ["misc", "all"]: show_device_status(misc_devices, "Misc (rawdev)") - if status_dev == "regex" or status_dev == "all": + if status_dev in ["regex", "all"]: show_device_status(regex_devices, "Regex") @@ -703,7 +703,7 @@ def do_arg_actions(): global force_flag global args - if b_flag == "none" or b_flag == "None": + if b_flag in ["none", "None"]: unbind_all(args, force_flag) elif b_flag is not None: bind_all(args, b_flag, force_flag) -- 2.27.0