From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752329AbcFFTLK (ORCPT ); Mon, 6 Jun 2016 15:11:10 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:38277 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751313AbcFFTLI (ORCPT ); Mon, 6 Jun 2016 15:11:08 -0400 Date: Mon, 6 Jun 2016 20:10:47 +0100 From: Andy Whitcroft To: Joe Perches Cc: Yingjoe Chen , Andrew Morton , linux-kernel@vger.kernel.org, srv_heupstream@mediatek.com, Andi Kleen , Paul Bolle Subject: Re: [PATCH v3 1/2] checkpatch: add Kconfig 'default n' test Message-ID: <20160606191047.GK18360@brain> References: <1465017040-12777-1-git-send-email-yingjoe.chen@mediatek.com> <1465231395.25087.13.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1465231395.25087.13.camel@perches.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 06, 2016 at 09:43:15AM -0700, Joe Perches wrote: > On Sat, 2016-06-04 at 13:10 +0800, Yingjoe Chen wrote: > > If a Kconfig config option doesn't specify 'default', the default > > will be n. Adding 'default n' is unnecessary. > > Add a test to warn about this. > > Is it obvious that a Kconfig has "default n" ? > This seems to work, but is this useful? > > + if ($realfile =~ /Kconfig/ && > > +     $line =~ /^\+\s*default\s*n\s*(#.*|$)/i) { I wonder particually when the submitter has supplied a comment, presumably to tell us why it defaults to 'n'. I feel more accepting of rejecting uncommented ones than those with. > > + WARN("CONFIG_DEFAULT_N", > > +      "Use of default n is unnecessary, default is n when omitted.\n" . $herecurr); > > + } > > + > >   if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && > >       ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) { > >   my $flag = $1; -apw