Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759643AbcLTJKh (ORCPT ); Tue, 20 Dec 2016 04:10:37 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34215 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756337AbcLTJKe (ORCPT ); Tue, 20 Dec 2016 04:10:34 -0500 Date: Tue, 20 Dec 2016 17:10:21 +0800 From: Cheah Kok Cheong To: Michal Marek Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] scripts: checkincludes: add exit message for no duplicates found Message-ID: <20161220091020.GA2549@linux-Precision-WorkStation-T5500> References: <1482064519-4352-1-git-send-email-thrust73@gmail.com> <213a88cd-de9c-d7f2-f765-1e8d35b569cf@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <213a88cd-de9c-d7f2-f765-1e8d35b569cf@suse.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 861 Lines: 34 On Mon, Dec 19, 2016 at 11:47:47AM +0100, Michal Marek wrote: > On 2016-12-18 13:35, Cheah Kok Cheong wrote: > > If no duplicates found, inform user. > > > > Signed-off-by: Cheah Kok Cheong > > --- > > scripts/checkincludes.pl | 13 +++++++++++++ > > 1 file changed, 13 insertions(+) > > > > diff --git a/scripts/checkincludes.pl b/scripts/checkincludes.pl > > index 97b2c61..2bf234c 100755 > > --- a/scripts/checkincludes.pl > > +++ b/scripts/checkincludes.pl > > @@ -37,6 +37,13 @@ if ($#ARGV >= 1) { > > } > > } > > > > +my $dup_counter = 0; > > + > > +sub nodup_count { > > + ++$dup_counter; > > + return; > > +} > > I don't think it's necessary to have a function only to increment a > variable. > > Michal Sorry do you mean the subroutine is not required and the "variable" is best placed inside directly? Thanks. CheahKC