Skip to content

Commit

Permalink
iocost_monitor: reorder BlkgIterator
Browse files Browse the repository at this point in the history
In order to comply with PEP 8, the first parameter of a class should be
__init__.

Signed-off-by: Elijah Conners <business@elijahpepe.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Elijah Conners authored and Tejun Heo committed Sep 24, 2022
1 parent 61c4171 commit b74440d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/cgroup/iocost_monitor.py
Original file line number Diff line number Diff line change
@@ -61,6 +61,11 @@ def err(s):
}

class BlkgIterator:
def __init__(self, root_blkcg, q_id, include_dying=False):
self.include_dying = include_dying
self.blkgs = []
self.walk(root_blkcg, q_id, '')

def blkcg_name(blkcg):
return blkcg.css.cgroup.kn.name.string_().decode('utf-8')

@@ -82,11 +87,6 @@ def walk(self, blkcg, q_id, parent_path):
blkcg.css.children.address_of_(), 'css.sibling'):
self.walk(c, q_id, path)

def __init__(self, root_blkcg, q_id, include_dying=False):
self.include_dying = include_dying
self.blkgs = []
self.walk(root_blkcg, q_id, '')

def __iter__(self):
return iter(self.blkgs)

0 comments on commit b74440d

Please sign in to comment.