From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932783AbeALGsK (ORCPT + 1 other); Fri, 12 Jan 2018 01:48:10 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:40278 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932489AbeALGsJ (ORCPT ); Fri, 12 Jan 2018 01:48:09 -0500 X-Google-Smtp-Source: ACJfBou8DGNr7pJrKhlMlJAzrmwu2MGsyyGZWmEfxv5UzArDYnYiQu3kT+mTTZ8u0dTUH2lR9TP4Hg== From: Ulf Magnusson To: linux-kbuild@vger.kernel.org Cc: yamada.masahiro@socionext.com, sam@ravnborg.org, linux-kernel@vger.kernel.org, Ulf Magnusson Subject: [PATCH] kconfig: Warn if there is more than one help text Date: Fri, 12 Jan 2018 07:47:47 +0100 Message-Id: <20180112064747.22854-1-ulfalizer@gmail.com> X-Mailer: git-send-email 2.14.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Avoids mistakes like in the following real-world example, where only the final help string ("Say Y...") was used. This particular example was fixed in commit 561b29e4ec8d ("media: fix media Kconfig help syntax issues"). config DVB_NETUP_UNIDVB ... select DVB_CXD2841ER if MEDIA_SUBDRV_AUTOSELECT ---help--- Support for NetUP PCI express Universal DVB card. help Say Y when you want to support NetUP Dual Universal DVB card ... This now prints the following warning: drivers/media/pci/netup_unidvb:13: warning: 'DVB_NETUP_UNIDVB' defined with more than one help text -- only the last one will be used Also free() any extra help strings. Signed-off-by: Ulf Magnusson --- scripts/kconfig/zconf.y | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index c1e4e82f56b5..06ef304ee325 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -435,6 +435,11 @@ help_start: T_HELP T_EOL help: help_start T_HELPTEXT { + if (current_entry->help) { + free(current_entry->help); + zconfprint("warning: '%s' defined with more than one help text -- only the last one will be used", + current_entry->sym->name ?: ""); + } current_entry->help = $2; }; -- 2.14.1