From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70A87EE49B0 for ; Tue, 22 Aug 2023 11:31:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234780AbjHVLbP (ORCPT ); Tue, 22 Aug 2023 07:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234755AbjHVLbM (ORCPT ); Tue, 22 Aug 2023 07:31:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D17E8CE3; Tue, 22 Aug 2023 04:31:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 63DFE63973; Tue, 22 Aug 2023 11:31:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0BBFC433CA; Tue, 22 Aug 2023 11:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692703865; bh=GiTxZ4OKRVhHnF8rRs0NLEZCAYYMH0DjrFcqPcvbtwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DN61+xfB6xmQ7AyqpeqI5Lbt6RZGqYRq107iKTx7z9cIiic9ULH/Br402hRFuc5f3 mfdRIpt46GhYx98rhxZ8c/6UnmYHeXvz2dy5qBuFXCuDl6iVu+ZzuzatbnDvtfBYJa pEkTMr5ok75l1z5f5rHIAKxJ9S5nIeM/t7lD7lw2TId+USOIXLw/XtAZ1S6y5V1TSv Uxh2ES2WyilzrkXv3rasyHMLSs6JOtAnwUA3+yr2XK/iCADpQ1mZsPuScPbJ8IgbAE zIqqdg+NA1eLCsgLxGDEQ4TV7QQuxbSNVy9xt+SvIpiWvFloUIYs3+8wFXAsJMutlA FGlnLe21Q+n7A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ani Sinha , Wei Liu , Sasha Levin , kys@microsoft.com, haiyangz@microsoft.com, decui@microsoft.com, linux-hyperv@vger.kernel.org Subject: [PATCH AUTOSEL 6.4 02/10] vmbus_testing: fix wrong python syntax for integer value comparison Date: Tue, 22 Aug 2023 07:30:52 -0400 Message-Id: <20230822113101.3549915-2-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230822113101.3549915-1-sashal@kernel.org> References: <20230822113101.3549915-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.4.11 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ani Sinha [ Upstream commit ed0cf84e9cc42e6310961c87709621f1825c2bb8 ] It is incorrect in python to compare integer values using the "is" keyword. The "is" keyword in python is used to compare references to two objects, not their values. Newer version of python3 (version 3.8) throws a warning when such incorrect comparison is made. For value comparison, "==" should be used. Fix this in the code and suppress the following warning: /usr/sbin/vmbus_testing:167: SyntaxWarning: "is" with a literal. Did you mean "=="? Signed-off-by: Ani Sinha Link: https://lore.kernel.org/r/20230705134408.6302-1-anisinha@redhat.com Signed-off-by: Wei Liu Signed-off-by: Sasha Levin --- tools/hv/vmbus_testing | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/hv/vmbus_testing b/tools/hv/vmbus_testing index e7212903dd1d9..4467979d8f699 100755 --- a/tools/hv/vmbus_testing +++ b/tools/hv/vmbus_testing @@ -164,7 +164,7 @@ def recursive_file_lookup(path, file_map): def get_all_devices_test_status(file_map): for device in file_map: - if (get_test_state(locate_state(device, file_map)) is 1): + if (get_test_state(locate_state(device, file_map)) == 1): print("Testing = ON for: {}" .format(device.split("/")[5])) else: @@ -203,7 +203,7 @@ def write_test_files(path, value): def set_test_state(state_path, state_value, quiet): write_test_files(state_path, state_value) - if (get_test_state(state_path) is 1): + if (get_test_state(state_path) == 1): if (not quiet): print("Testing = ON for device: {}" .format(state_path.split("/")[5])) -- 2.40.1