Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 8f7abf0b86fe ("drm/msm: generate headers on the fly")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/589427/
Link: https://lore.kernel.org/r/20240412165407.42163-1-jonathanh@nvidia.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Jon Hunter and committed by
Dmitry Baryshkov
b662ade1 afd898c7

+3 -2
+3 -2
drivers/gpu/drm/msm/registers/gen_header.py
··· 323 323 indices = [] 324 324 if self.length != 1: 325 325 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)) 327 327 else: 328 328 indices.append((self.index_ctype(), self.stride, None)) 329 329 return indices ··· 942 942 parser.add_argument('--rnn', type=str, required=True) 943 943 parser.add_argument('--xml', type=str, required=True) 944 944 945 - subparsers = parser.add_subparsers(required=True) 945 + subparsers = parser.add_subparsers() 946 + subparsers.required = True 946 947 947 948 parser_c_defines = subparsers.add_parser('c-defines') 948 949 parser_c_defines.set_defaults(func=dump_c_defines)