Skip to content

Commit 454b4db

Browse files
committed
mypy
1 parent 454cde3 commit 454b4db

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

sdb/commands/zfs/internal/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def BP_GET_COMPRESS(bp: drgn.Object) -> int:
116116

117117

118118
def BP_IS_EMBEDDED(bp: drgn.Object) -> bool:
119-
return BF64_GET(bp.blk_prop, 39, 1)
119+
return bool(BF64_GET(bp.blk_prop, 39, 1))
120120

121121

122122
def BP_GET_CHECKSUM(bp: drgn.Object) -> int:
@@ -134,7 +134,7 @@ def BP_GET_LEVEL(bp: drgn.Object) -> int:
134134

135135

136136
def BP_USES_CRYPT(bp: drgn.Object) -> bool:
137-
return BF64_GET(bp.blk_prop, 61, 1)
137+
return bool(BF64_GET(bp.blk_prop, 61, 1))
138138

139139

140140
def BP_IS_ENCRYPTED(bp: drgn.Object) -> bool:
@@ -152,7 +152,7 @@ def BP_HAS_INDIRECT_MAC_CKSUM(bp: drgn.Object) -> bool:
152152

153153

154154
def BP_GET_DEDUP(bp: drgn.Object) -> bool:
155-
return BF64_GET(bp.blk_prop, 62, 1)
155+
return bool(BF64_GET(bp.blk_prop, 62, 1))
156156

157157

158158
def BP_GET_BYTEORDER(bp: drgn.Object) -> int:
@@ -194,7 +194,7 @@ def BP_GET_FILL(bp: drgn.Object) -> int:
194194
return BF64_GET(bp.blk_fill, 0, 32)
195195
if BP_IS_EMBEDDED(bp):
196196
return 1
197-
return bp.blk_fill
197+
return int(bp.blk_fill)
198198

199199

200200
def BP_GET_IV2(bp: drgn.Object) -> int:
@@ -204,7 +204,7 @@ def BP_GET_IV2(bp: drgn.Object) -> int:
204204
def BP_IS_GANG(bp: drgn.Object) -> bool:
205205
if BP_IS_EMBEDDED(bp):
206206
return False
207-
return BF64_GET(bp.blk_dva[0].dva_word[1], 63, 1)
207+
return bool(BF64_GET(bp.blk_dva[0].dva_word[1], 63, 1))
208208

209209

210210
def BP_IS_REDACTED(bp: drgn.Object) -> bool:
@@ -241,13 +241,13 @@ def DVA_IS_VALID(dva: drgn.Object) -> bool:
241241

242242

243243
def DVA_IS_EMPTY(dva: drgn.Object) -> bool:
244-
return (dva.dva_word[0] == 0 and dva.dva_word[1] == 0)
244+
return bool(dva.dva_word[0] == 0 and dva.dva_word[1] == 0)
245245

246246

247-
def DMU_OT_IS_ENCRYPTED(ot: int) -> int:
247+
def DMU_OT_IS_ENCRYPTED(ot: int) -> bool:
248248
if ot & DMU_OT_NEWTYPE:
249-
return ot & DMU_OT_ENCRYPTED
250-
return int(sdb.get_object("dmu_ot")[ot].ot_encrypt)
249+
return bool(ot & DMU_OT_ENCRYPTED)
250+
return bool(sdb.get_object("dmu_ot")[ot].ot_encrypt)
251251

252252

253253
SPA_LSIZEBITS = 16

0 commit comments

Comments
 (0)