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 X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A6AEC433F5 for ; Wed, 8 Sep 2021 13:50:40 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B966160F6C for ; Wed, 8 Sep 2021 13:50:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B966160F6C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E603D83373; Wed, 8 Sep 2021 15:50:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com 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=konsulko.com header.i=@konsulko.com header.b="RLXaFMyr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A55B383374; Wed, 8 Sep 2021 15:50:36 +0200 (CEST) Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) (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 17C2E8335F for ; Wed, 8 Sep 2021 15:50:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf30.google.com with SMTP id e18so1488665qvo.1 for ; Wed, 08 Sep 2021 06:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=SUOhdq2I+cAArn/KMedOWWZExVa739kaeDvtbNuL/RE=; b=RLXaFMyrd+ohtmSl6rHHirtJe3Vf+G+tDc9D+R1SPvgxtHk4f+7vdIzntUqmflKjsl MViul9fhWO08dQCK/ALgdmOXAkb63PmF+XXOJowIGYtEre5YqJGnDtWqZdbjZMJnBhd4 Sj3VaaX7mQSannIc8wEZdc9vn7w7W/BDTh9/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=SUOhdq2I+cAArn/KMedOWWZExVa739kaeDvtbNuL/RE=; b=5xMKFiwCNgM+IUdKzgF65rFpSCUWkDmPzDpVT/O5UOLoEwhhbIWx1GPvbtKew7TDrU p/QOlWydGDTvdvZp0nQkqOwAg1p7aO8MHCSYgPtmB0NP7XMe3lGj1tUQ+RLNCXWcPq1i +ooAUjbPWGvNUHFQNs59+QdR0zYaKk4wuCOJ/usYbJ4GzhcRfWDCk0urgy9VFAbsTk0t Un0+rXDEf5l7OH83w3Zet/2nZAYGjEQj84t708ocRBlPohEehq1ULNjIpmdV6Si4KvpB NRoo7ZPJlF8YeFtZ5TqKYOT5/yQMh4btOUTLdRQxVUXTfLe3kE8ljvcLOT2ikpevfAzJ N0yg== X-Gm-Message-State: AOAM532jPI+TKocRhI66aht75UAOrxiUeb+uEhJsdrb+RmLj77h1IIdG oWze8+34OpDN2Tf4BMY0+w9niEjhJ9u3xA== X-Google-Smtp-Source: ABdhPJypOu3NaEveoMA8XynETlngWO4SQ1K2ZfFfzH8Txq1J7MWn1tOF7JuMtkNpXckfBZauygXbDQ== X-Received: by 2002:ad4:4ab1:: with SMTP id i17mr3944577qvx.11.1631109030687; Wed, 08 Sep 2021 06:50:30 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-717f-113d-7bb2-2acf.res6.spectrum.com. [2603:6081:7b01:cbda:717f:113d:7bb2:2acf]) by smtp.gmail.com with ESMTPSA id j9sm1427345qta.65.2021.09.08.06.50.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Sep 2021 06:50:29 -0700 (PDT) Date: Wed, 8 Sep 2021 09:50:28 -0400 From: Tom Rini To: u-boot@lists.denx.de Subject: tools: Check for already migrated symbols in a given file Message-ID: <20210908135028.GC12964@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3C3ZMpwu25Mtx3MN" Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean --3C3ZMpwu25Mtx3MN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey all, As I look over patchwork I see (as one would expect) platforms showing up that will come in either to -next, or once v2021.10 is out. Given the number of newly migrated symbols now in -next, along with my hope to get more done soon as well has having discovered lots of already migrated symbols showing up again in board config.h files, I want to pass along this bit of shell script. It's heavily borrowed from=20 scripts/build-whitelist.sh and basically has comm providing a different column. It's also not fool-proof as I skipped handling CONFIG_SYS_EXTRA_OPTIONS as I just want to remove that symbol entirely. What you do with this is: $ check-migrated-symbols.sh include/configs/am335x_evm.h CONFIG_SYS_I2C_EEPROM_ADDR CONFIG_SYS_I2C_EEPROM_ADDR_LEN CONFIG_SYS_NAND_BLOCK_SIZE CONFIG_SYS_NAND_OOBSIZE CONFIG_SYS_NAND_PAGE_SIZE CONFIG_SYS_NAND_U_BOOT_OFFS And see that oh, those symbols need to be moved to the defconfig. I'm not posting this to complain about existing board files (but I'll be cleaning up stuff) but rather to note that when adding new boards, it's REALLY important to catch and fix those problems. And without a script of some sort, it's also a pain. So here's the script: #!/bin/bash if [ ! -f Kconfig ]; then echo "ERROR: Must be run from root of U-Boot directory" exit 1 fi # Cleanup when done. trap "{ rm -rf ${KSYMLST} ${KUSEDLST}; }" EXIT KSYMLST=3D`mktemp` KUSEDLST=3D`mktemp` # List of existing symbols cat `find . -name "Kconfig*"` | sed -n \ -e 's/^\s*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \ -e 's/^\s*menuconfig *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \ | sort -u > $KSYMLST # Check each argument while test $# -ne 0; do # Not a file [ ! -f "$1" ] && shift 1 grep '#define[[:blank:]]CONFIG_' $1 | sed -n 's/#define.\(CONFIG_[A-Za-z0-= 9_]*\).*/\1/p' | sort -u > ${KUSEDLST} comm -12 ${KSYMLST} ${KUSEDLST} shift 1 done rm -f ${KSYMLST} ${KUSEDLST} --=20 Tom --3C3ZMpwu25Mtx3MN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmE4v50ACgkQFHw5/5Y0 tyyL8AwAhbXZzcpCu2APtMTXjxFYKAWWCosXBWVJKnZqY0RuPmzmo4aDvVbY/fbw LbRRAospk5BtLpgcl+mFypWvAFTZ+6UufUExR+sPCkVW79uLw6meA1dbStohuxsg jJEbKjEadz5ot3A+R0p2hIokKjdrGsY/D+OSdurhuM788aQr10t0Iw/CYcbGKgc3 sPJhH4zbpPRWkOuOWJKa7kellP6TEC2N8/m/mDZTWeemcV+IiOE/UOTdUrWTZI2v /ruF5nAIN0aLHbAdPB727+elVyqadD45rI3ZNsVHY8hSYxVKVz0Nj3iyGWDbZFNg rfX6OzK17rHzVO7F/zqvP8iN3jweUZVjPBcvNRMysS6ngqgvvPX6gEariZH/QssY xVG0LOzMBCNtK3KgFJ/a7eOFReWU9dFwcdbL6QJ2jlQ2oVfoA7nhvp/i3ZiI/0AV t/P9YxVOlBhvzIrNmtk9NMt/aO/cbgTb41V1GNfMgmYAub6T5LeCLX0UFdPll0B7 plCtiBg3 =40Zt -----END PGP SIGNATURE----- --3C3ZMpwu25Mtx3MN--