From patchwork Wed Feb 8 13:07:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 13133032 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B420BC636CC for ; Wed, 8 Feb 2023 13:08:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230472AbjBHNIK (ORCPT ); Wed, 8 Feb 2023 08:08:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230390AbjBHNIK (ORCPT ); Wed, 8 Feb 2023 08:08:10 -0500 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 212134617A for ; Wed, 8 Feb 2023 05:08:04 -0800 (PST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230208130800euoutp0243e704aa508d730ac309c3e6319c9c04~B21HOSGOD2825428254euoutp02Y for ; Wed, 8 Feb 2023 13:08:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230208130800euoutp0243e704aa508d730ac309c3e6319c9c04~B21HOSGOD2825428254euoutp02Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1675861680; bh=NkEieWj4aKUt96PeZd1bqkfzO/gq34U0pcl+tnglNUI=; h=From:To:Cc:Subject:Date:References:From; b=A4M0iwJJbEftcHv7IQbIYKmO/2dG399k28Ha7aob8a0Eowddelek/H8ukUSOR2bp2 p503nVliZaq9D9WmInoT3A+aHvrWZoUYMbX8Ow669v/xDmUQ3xVrY6KkovMnyiiMA9 Qnk5IJXNnTtVmKcYw4oyoAZhB6xQ9WSG9m20Tnl8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230208130800eucas1p15c541fcab51c8e22b3b0847eb7145c98~B21HBM4XZ2912229122eucas1p1V; Wed, 8 Feb 2023 13:08:00 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 55.B5.01471.0BE93E36; Wed, 8 Feb 2023 13:08:00 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230208130800eucas1p2fbcba741dbd7483bb0a9b2d4b6c6dbfd~B21Gq6z360495104951eucas1p2z; Wed, 8 Feb 2023 13:08:00 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230208130800eusmtrp13a60800edbd9df7c0d18e10bec8fb70e~B21Gkmfd11465714657eusmtrp1M; Wed, 8 Feb 2023 13:08:00 +0000 (GMT) X-AuditID: cbfec7f2-2b1ff700000105bf-d9-63e39eb07fc1 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 54.47.02722.FAE93E36; Wed, 8 Feb 2023 13:07:59 +0000 (GMT) Received: from localhost (unknown [106.120.51.111]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230208130759eusmtip1f0e4adb3d8f60d785b1d4b36f8c67945~B21GYJZ2A1152411524eusmtip1M; Wed, 8 Feb 2023 13:07:59 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Masahiro Yamada Cc: Marek Szyprowski , =?utf-8?q?=C5=81ukasz_Stelm?= =?utf-8?q?ach?= , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] merge_config.sh: do not report some differencess between input and output Date: Wed, 8 Feb 2023 14:07:31 +0100 Message-Id: <20230208130732.63172-1-l.stelmach@samsung.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Developer-Signature: v=1; a=openpgp-sha256; l=2893; i=l.stelmach@samsung.com; h=from:subject; bh=ljJ8pdV8ot5fsQIHCmsxZhK0/bwnqKfQLWVxPbc7Jag=; b=owEBbQGS/pANAwAIAbCuHpyYpYAQAcsmYgBj456TTgtcXeJlSAO5UF/8PpdGefmnuc/BOEeEQ kAmmZeAKL+JATMEAAEIAB0WIQRem7KqOr2QYRWv1RCwrh6cmKWAEAUCY+OekwAKCRCwrh6cmKWA EEGACACkXZiwHDXmtv5Z3phxrzPm5KTIDif7qPim+El7+ThBFyqTzugCz/31SvWZl/ucLxaUbgF exc7x5pMwiA5j3h6OCrmF7szN9XDn1/luaHyBhJuIJsY1UFudTwIyp1JWjP0d8TcU8aULSvKtRk nxf/wjU7+Of5xOTjTg+ExmS+whLRIkiMiF2sICpFFjh2JDX5lq8rKUroL1BtL9M9yaKjsgcjUcW 1n1+uFME9g4wyZFkv2mkhnoHXNIphN61uwOvZ6j3ZFnKwRA3ReyP/80ERYfmcQb0c/EZKwHZdfx Z/NQUWDyBlusP1gmpMgVt6NORiW0oRw7LeqA6iKwSKhhexiM X-Developer-Key: i=l.stelmach@samsung.com; a=openpgp; fpr=A2B9843766B15A4D32BCBF0DEC1B3A02E80CD5C8 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHIsWRmVeSWpSXmKPExsWy7djPc7ob5j1ONri/Vsbi5qEVjBZ/du1g sri8aw6bxdojd9ktHj64werA6rFpVSebR9+WVYwenzfJBTBHcdmkpOZklqUW6dslcGWs3ptb cF6s4tfSh6wNjOcEuxg5OSQETCTurlrE2sXIxSEksIJR4tfM02wQzhdGiabZexkhnM+MEhef 7GGCaVn9p4cVxBYSWM4o8e0zP0TRC0aJ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OCXYycHBIC JhKr//SwdjFycQgJLGWUmPf1FWMXIwdQQkpi5dx0iBphiT/Xutggap4xSmycd5wVJMEm4CjR v/QEmC0ioCVxZ2kH2CBmgXWMEnOn/mQHSQgLxEr8vDUZzGYRUJVY/KKXBcTmFbCWePXuJAvE BnmJtuvTGSHighInZz5hATmCWUBdYv08IZAwP9D8NU3XWUDmSwh0skrc+7CQHaI3SeLA+nVg vcxAc5q3zmaewCg0C8moWQijZiGpWsDIvIpRJLW0ODc9t9hQrzgxt7g0L10vOT93EyMwYrYd +7l5B+O8Vx/1DjEycTAeYpTgYFYS4f0+8XGyEG9KYmVValF+fFFpTmrxIUZToNcmMkuJJucD YzavJN7QzMDU0MTM0sDU0sxYSZzXs6AjUUggPbEkNTs1tSC1CKaPiYNTqoGJYaLVZI7NdXcn BlctrrIJXblWIeI0U9Kh5Vq5uhNb33bKyjefXezWsXWaPVd4YfDCNWfPTbqp+tzJdplchX2y tXZXDyPTjnkcd2bWavRbnuA/d9/V+H7cnOrHh27K+/5eF7p8Cj9T9Ply74mhEel/1IMY7VSX CGobfvo67/K7xs03Tp5PvX5/alu04qRbn2Z8KPH8UGIweWpfcSgX+3nZNXxzc1r6kl+fMC5p 9dywboVEZPHKz8f9LNfEst6uas+64PvKYXZhNte5qc+qY+ecXrTE2CXofaCz22HT7Vd2SP27 LHHbfXbOPnu9bROafgVs4ly7wuOXxsfgH5OPKM2RuROWUr+Vo/797KwXhgn7lFiKMxINtZiL ihMBiOpjGSEDAAA= X-CMS-MailID: 20230208130800eucas1p2fbcba741dbd7483bb0a9b2d4b6c6dbfd X-Msg-Generator: CA X-RootMTR: 20230208130800eucas1p2fbcba741dbd7483bb0a9b2d4b6c6dbfd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230208130800eucas1p2fbcba741dbd7483bb0a9b2d4b6c6dbfd References: Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org If an input config file contains CONFIG_FOO=n the output one will contain a line '# CONFIG_FOO is not set'. merge_config.sh should not report it as difference because the end result of CONFIG_FOO being disabled is achieved. Inexistence of CONFIG_FOO (because of unment dependencies) in case CONFIG_FOO=n is requested, should also be ignored. Change-Id: I129f3a0b4205a76d8c42020f8adb72b1889d75fb Signed-off-by: Ɓukasz Stelmach --- Changes in v2: - suppress reports reports if an option was "not set" in input files but is missing from the filnal .config due to unmet dependecies. - apply the same logic to suppress some reports during the merging phase BTW. Do you think adding "| sort -u" after "grep -w" to avoid reports about repeated entries may make sense or do you want such reports to be printed. scripts/kconfig/merge_config.sh | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index e5b46980c22a..1086bdc7abf2 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh @@ -144,12 +144,17 @@ for ORIG_MERGE_FILE in $MERGE_LIST ; do echo BUILTIN_FLAG=true elif [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then - echo Value of $CFG is redefined by fragment $ORIG_MERGE_FILE: - echo Previous value: $PREV_VAL - echo New value: $NEW_VAL - echo - if [ "$STRICT" = "true" ]; then - STRICT_MODE_VIOLATED=true + if [ \( "x$PREV_VAL" != "x$CFG=n" -a \ + "x$PREV_VAL" != "x# $CFG is not set" \) -o \ + \( "x$NEW_VAL" != "x" -a \ + "x$NEW_VAL" != "x# $CFG is not set" \) ]; then + echo Value of $CFG is redefined by fragment $ORIG_MERGE_FILE: + echo Previous value: $PREV_VAL + echo New value: $NEW_VAL + echo + if [ "$STRICT" = "true" ]; then + STRICT_MODE_VIOLATED=true + fi fi elif [ "$WARNREDUN" = "true" ]; then echo Value of $CFG is redundant by fragment $ORIG_MERGE_FILE: @@ -196,9 +201,14 @@ for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE) ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG" || true) if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then - echo "Value requested for $CFG not in final .config" - echo "Requested value: $REQUESTED_VAL" - echo "Actual value: $ACTUAL_VAL" - echo "" + if [ \( "x$REQUESTED_VAL" != "x$CFG=n" -a \ + "x$REQUESTED_VAL" != "x# $CFG is not set" \) -o \ + \( "x$ACTUAL_VAL" != "x" -a \ + "x$ACTUAL_VAL" != "x# $CFG is not set" \) ]; then + echo "Value requested for $CFG not in final .config" + echo "Requested value: $REQUESTED_VAL" + echo "Actual value: $ACTUAL_VAL" + echo "" + fi fi done