Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1753661ybi; Wed, 3 Jul 2019 22:49:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6F6XyhFbyM7nRMpaCie3m09lIQWrc9Vz+De3u2DJ0wRkPdJdcIU0zuHyUP8xOFQ4WRPNK X-Received: by 2002:a63:b547:: with SMTP id u7mr42722834pgo.322.1562219342171; Wed, 03 Jul 2019 22:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562219342; cv=none; d=google.com; s=arc-20160816; b=Kejq1gYDrrYedgA4+4iISJJtA14E2KIqBdRbaNon3hZSfUdDRZ2KSa6qvRlEgdHTRC p9LMGR8Q0eqCXdr74jieYkvBRK5T7EDi2ZR0MmlhZIwD6/zpvAJGtbS+Ef2v88/azsUQ JtvEulMEcLCdAkqIiStqgaZ0FzoKE5mZxy3lM6f1h9mmP9nzSQTeFkpwrqrqjULgCBmv mPsarkZLvuxu+6GoBgvVOJbgXeUWUn++2qQQ8E8IzYCrvdkkrouquxBfXrXHK1RSxALz 2wWVPuts2PGd4J5ajrms+T+0MLA33wGVqktAhqPeh+0yhWxKnhs/zKlYHKaH9Th45IPt NnuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=YT4qAS1wGOYlOmDjxOdscOo7BxVxy4QBAO8pl5FF/LU=; b=HJ3lc5TTOxY2uyy44dFKBgZyccOjxMwDwm8JubLAaM/gBDU9afGEb3Z6LqC9cc/8gh a9Jt3n2TBI93FdRyRu4q3lxad1NMnVLwRo3fQKwEbl2WoftcaSYANosyDuFxLz1NIbaE GemJGtd3efczNoVXBm3MPeNXwSxl8+Y7hecC3wGG8Ona//w5r+wv5D7YuU9GiHseF05p CDICuzkY6zuRI0BtRgbS2UU05A7v0v3in8J6EoPJH2uAdVKnr0vSx4vm3Z8AxkhFzXxc 0lxZplaJ9i+O4847+2CVUpsgeG0ybMIWW7FA9EC4DuQ/P0eWdCc35cFFpfIh6DWMAMhH UpVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4si4138055pjh.87.2019.07.03.22.48.46; Wed, 03 Jul 2019 22:49:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726069AbfGDFs1 (ORCPT + 99 others); Thu, 4 Jul 2019 01:48:27 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:16614 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725861AbfGDFs1 (ORCPT ); Thu, 4 Jul 2019 01:48:27 -0400 X-UUID: 86e90e4136a24fdc803c254df76da0ab-20190704 X-UUID: 86e90e4136a24fdc803c254df76da0ab-20190704 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 531091066; Thu, 04 Jul 2019 13:48:04 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 4 Jul 2019 13:48:03 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 4 Jul 2019 13:48:03 +0800 Message-ID: <1562219283.6549.2.camel@mtkswgap22> Subject: Re: [PATCH] checkpatch: avoid default n From: Miles Chen To: Joe Perches CC: Yingjoe Chen , Andy Whitcroft , , , Date: Thu, 4 Jul 2019 13:48:03 +0800 In-Reply-To: References: <20190703083031.2950-1-miles.chen@mediatek.com> <1562144624.3550.1.camel@mtksdaap41> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-07-03 at 08:37 -0700, Joe Perches wrote: > On Wed, 2019-07-03 at 17:03 +0800, Yingjoe Chen wrote: > > On Wed, 2019-07-03 at 01:42 -0700, Joe Perches wrote: > > > On Wed, 2019-07-03 at 16:30 +0800, Miles Chen wrote: > > > > This change reports a warning when "default n" is used. > > > > > > > > I have seen several "remove default n" patches, so I think > > > > it might be helpful to add this test in checkpatch. > > > > DEFAULT_VALUE_STYLE > > > > tested: > > > > WARNING: 'default n' is the default value, no need to write it explicitly. > > > > + default n > > > > > > I don't think this is reasonable as there are > > > several uses like: > > > > > > default y > > > default n if > > > > > > For instance: > > > > > > arch/alpha/Kconfig-config ALPHA_WTINT > > > arch/alpha/Kconfig- bool "Use WTINT" if ALPHA_SRM || ALPHA_GENERIC > > > arch/alpha/Kconfig- default y if ALPHA_QEMU > > > arch/alpha/Kconfig: default n if ALPHA_EV5 || ALPHA_EV56 || (ALPHA_EV4 && !ALPHA_LCA) > > > arch/alpha/Kconfig: default n if !ALPHA_SRM && !ALPHA_GENERIC > > > > Hi, > > > > > > I've sent similar patch in 2016, my version won't complain about these. > > > > https://lkml.org/lkml/2016/4/22/580 > > Hi again. > > https://lore.kernel.org/lkml/1461259011.1918.23.camel@perches.com/ > > I would prefer a generic solution that also handles the > quoted use. > > $ git grep -P 'default\s*\"[ynm]"' -- '*/Kconfig*' > arch/mips/Kconfig: default "y" > arch/mips/Kconfig: default "y" > arch/mips/Kconfig: default "y" > arch/mips/Kconfig: default "y" > arch/mips/cavium-octeon/Kconfig: default "n" > arch/mips/cavium-octeon/Kconfig: default "y" > arch/mips/cavium-octeon/Kconfig: default "y" > arch/mips/cavium-octeon/Kconfig: default "y" > arch/mips/cavium-octeon/Kconfig: default "y" > arch/mips/cavium-octeon/Kconfig: default "y" > arch/mips/cavium-octeon/Kconfig: default "y" > arch/powerpc/Kconfig: default "y" if PPC_POWERNV > arch/powerpc/Kconfig: default "y" if PPC_POWERNV > arch/powerpc/Kconfig: default "n" > drivers/auxdisplay/Kconfig: default "n" > drivers/crypto/Kconfig: default "m" > drivers/rapidio/devices/Kconfig: default "n" > > or maybe 2 separate patches. > > And the "default y" case and probably the > "default \!?EXPERT" is or should be generally > discouraged. Especially for drivers. > > https://lore.kernel.org/lkml/CAHk-=wiZ24JuVehJ5sEC0UG1Gk2nvB363wO02RRsR1oEht6R9Q@mail.gmail.com/ > > Thanks for your comment, I'll send another patch for these cases: 1. default "[ynm]" 2. default \!?EXPERT 3. default n$