[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200320163820.3634106-1-vincent@bernat.ch>
Date: Fri, 20 Mar 2020 17:38:20 +0100
From: Vincent Bernat <vincent@...nat.ch>
To: Jan Kiszka <jan.kiszka@...mens.com>,
Kieran Bingham <kbingham@...nel.org>,
Stephen Boyd <swboyd@...omium.org>,
linux-kernel@...r.kernel.org
Cc: Vincent Bernat <vincent@...nat.ch>
Subject: [PATCH] scripts/gdb: replace "is 0" by "== 0"
While for small numbers, using "node is 0" works with CPython, it is
more portable to use "node == 0". Moreover, with Python 3, this
triggers a syntax warning:
SyntaxWarning: "is" with a literal. Did you mean "=="?
Signed-off-by: Vincent Bernat <vincent@...nat.ch>
---
scripts/gdb/linux/rbtree.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/gdb/linux/rbtree.py b/scripts/gdb/linux/rbtree.py
index 39db889b874c..87d4738984d2 100644
--- a/scripts/gdb/linux/rbtree.py
+++ b/scripts/gdb/linux/rbtree.py
@@ -17,7 +17,7 @@ def rb_first(root):
raise gdb.GdbError("Must be struct rb_root not {}".format(root.type))
node = root['rb_node']
- if node is 0:
+ if node == 0:
return None
while node['rb_left']:
@@ -33,7 +33,7 @@ def rb_last(root):
raise gdb.GdbError("Must be struct rb_root not {}".format(root.type))
node = root['rb_node']
- if node is 0:
+ if node == 0:
return None
while node['rb_right']:
--
2.26.0.rc2
Powered by blists - more mailing lists