Skip to content

Commit b662ade

Browse files
jonhunterlumag
authored andcommitted
drm/msm: Fix gen_header.py for older python3 versions
The gen_header.py script is failing for older versions of python3 such as python 3.5. Two issues observed with python 3.5 are ... 1. Python 3 versions prior to 3.6 do not support the f-string format. 2. Early python 3 versions do not support the 'required' argument for the argparse add_subparsers(). Fix both of the above so that older versions of python 3 still work. Fixes: 8f7abf0 ("drm/msm: generate headers on the fly") Signed-off-by: Jon Hunter <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/589427/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent afd898c commit b662ade

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/msm/registers/gen_header.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def indices(self):
323323
indices = []
324324
if self.length != 1:
325325
if self.fixed_offsets:
326-
indices.append((self.index_ctype(), None, f"__offset_{self.local_name}"))
326+
indices.append((self.index_ctype(), None, "__offset_%s" % self.local_name))
327327
else:
328328
indices.append((self.index_ctype(), self.stride, None))
329329
return indices
@@ -942,7 +942,8 @@ def main():
942942
parser.add_argument('--rnn', type=str, required=True)
943943
parser.add_argument('--xml', type=str, required=True)
944944

945-
subparsers = parser.add_subparsers(required=True)
945+
subparsers = parser.add_subparsers()
946+
subparsers.required = True
946947

947948
parser_c_defines = subparsers.add_parser('c-defines')
948949
parser_c_defines.set_defaults(func=dump_c_defines)

0 commit comments

Comments
 (0)