Message ID | 20220223230040.159317-3-sjg@chromium.org |
---|---|
State | Superseded |
Delegated to: | Simon Glass |
Headers | show |
Series | binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script | expand |
On 24/02/2022 02:00, Simon Glass wrote: > This is not necessary if simpler code is used. Use the split function and > drop the unnecessary [] > > Signed-off-by: Simon Glass <sjg@chromium.org> > Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> > --- > > Changes in v2: > - Add new patch to remove remove_defconfig() > > tools/moveconfig.py | 13 +------------ > 1 file changed, 1 insertion(+), 12 deletions(-) Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
diff --git a/tools/moveconfig.py b/tools/moveconfig.py index cff1e30658..dea60f4661 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -94,17 +94,6 @@ SIZES = { RE_REMOVE_DEFCONFIG = re.compile(r'(.*)_defconfig') ### helper functions ### -def remove_defconfig(defc): - """Drop the _defconfig suffix on a string - - Args: - defc (str): String to convert - - Returns: - str: string with the '_defconfig' suffix removed - """ - return RE_REMOVE_DEFCONFIG.match(defc)[1] - def check_top_directory(): """Exit if we are not at the top of source directory.""" for fname in 'README', 'Licenses': @@ -1671,7 +1660,7 @@ def do_find_config(config_list): print(f"Error: Not in Kconfig: %s" % ' '.join(adhoc)) else: print(f'{len(out)} matches') - print(' '.join([remove_defconfig(item) for item in out])) + print(' '.join(item.split('_defconfig')[0] for item in out)) def prefix_config(cfg):
This is not necessary if simpler code is used. Use the split function and drop the unnecessary [] Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> --- Changes in v2: - Add new patch to remove remove_defconfig() tools/moveconfig.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)