From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62798C433EF for ; Wed, 23 Feb 2022 23:02:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC22883D37; Thu, 24 Feb 2022 00:02:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="gmGnpYhU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D747983CDE; Thu, 24 Feb 2022 00:01:02 +0100 (CET) Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C6FCC83CF7 for ; Thu, 24 Feb 2022 00:00:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oo1-xc32.google.com with SMTP id k13-20020a4a948d000000b003172f2f6bdfso862146ooi.1 for ; Wed, 23 Feb 2022 15:00:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hawRGu8xlqP3QF1eiPbBmbwsyfbig8aE13mBXOxCwGY=; b=gmGnpYhU1xJKf/jL7v09wCJKbCeBg4vm98/gQOYatw3FclEgKszL9riNgB/A94O+4p 1w+lvsN5QCPw1mvoFYqwvk+E2LfM4i2mA6XavO16C0HD/b3wed13AhigTqhSzdPKyW3v hXT+pIufy7v/AOGDfRuzeIoMbbB01LRtdfAPM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hawRGu8xlqP3QF1eiPbBmbwsyfbig8aE13mBXOxCwGY=; b=yIS+EFSLAjIQ1NPC9o4+HTSYR2W5GimSM1QHAoA8Qqj5xg/cxkvpY07d1WAZ/Upkcu DIcvzZiXn1H00Q3KpPUJZ1UPNpXjhB8qZbrentrtWMBFAfFS/evLYQzvr+B+9rTAndVq eY4jDnlYt2gxjVeDNKB2iyrNOecd1NwFU6rgDNpUUP1ZsRnGF/oQ8EavRMTwN1mrDVxD +JR2WQFxJybACaPHG5Qg+bt+O5MeutVgKfQVRI8wehYSK6Dd+e3GnvRJdER/17MAEygL t23Ju4uJ+POnBwYeaoDSrCUHPbEAcBgjU0Rk7dT0FMQlU613DqZjuUWgaOgfRyuL5FWQ VhIA== X-Gm-Message-State: AOAM532zzmOEAL2fhE8OpfE9n52Mc0LuEmoty5LtMefuzpSLBKgmxiMZ hZBl8Z3pGnuzzRmsyeG4ew8Bg9KrBOi7dw== X-Google-Smtp-Source: ABdhPJyevOIngQYr00y0w7F2ZRzMb0xtmArzXgjFjO3+Yhpf3Ek5bO8u0NsSGUXZzIHal+dk2obBCg== X-Received: by 2002:a4a:7601:0:b0:2e0:3c62:4787 with SMTP id t1-20020a4a7601000000b002e03c624787mr690639ooc.11.1645657250750; Wed, 23 Feb 2022 15:00:50 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id o2sm427507otl.9.2022.02.23.15.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 15:00:50 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Ivan Mikhaylov , Tom Rini , Philippe Reynes , Roger Quadros , Alper Nebi Yasak , huang lin , Jeffy Chen , Simon Glass , Kever Yang , Philipp Tomsich Subject: [PATCH v2 02/25] moveconfig: Remove remove_defconfig() Date: Wed, 23 Feb 2022 16:00:17 -0700 Message-Id: <20220223230040.159317-3-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.574.g5d30c73bfb-goog In-Reply-To: <20220223230040.159317-1-sjg@chromium.org> References: <20220223230040.159317-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean This is not necessary if simpler code is used. Use the split function and drop the unnecessary [] Signed-off-by: Simon Glass Suggested-by: Alper Nebi Yasak --- Changes in v2: - Add new patch to remove remove_defconfig() tools/moveconfig.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) 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): -- 2.35.1.574.g5d30c73bfb-goog