Received: by 10.223.176.5 with SMTP id f5csp449235wra; Fri, 9 Feb 2018 01:36:44 -0800 (PST) X-Google-Smtp-Source: AH8x227KR6di6ZrlJJowp5bHJyh2m01RxyLhGAq9DfXBpQoYukfvwPLLEOaEz42acysX4rvSrI8e X-Received: by 10.98.190.11 with SMTP id l11mr2234084pff.32.1518169003999; Fri, 09 Feb 2018 01:36:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518169003; cv=none; d=google.com; s=arc-20160816; b=diIOWzYKCtgoY7l4AIrT4sgrfvc1a7WSmB8wwEFFUNXXtAEk9Nx4/V/9mPgMeYdiEV NFquVzf1ziS8aeLw8v/DqkpNhOHooDd/ZKufED59yz/MH/kFN6E7H0lEgX6GYIUXMsRo WOYYJtfPPeT2xfA97nDiKIs44DQNIldNflJl82R1jsB8icPcs883k6O2pPfSWLwOv9Vi XeEIxt7eXer86FmJJXhX0ZbWsQesteBS0yMZue/doVrwl3ujJKsezUDq5lLaKoZi+vCJ VmJNi9CkD8pWeummoj2l3K/s4NnjQNqaQz3pPuacqk07ZGvF88CgRfbduQN9TyMOx5dA 0q4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from :arc-authentication-results; bh=ifoy7jIOo2/MRVo6AWTmF0KosJV39SVPOKWULWKYJos=; b=zpUgUx/NKIScftv2eaEmKVMaP+7ih5yB71M80bEzCLt5G6zc3EFNsDyJaazQXc3327 7f7JHhW0JyBHrfovP4n6enGbBVE2C5/bx8z0yLUmlv3cWu/ukNBas9VDcStSEKhEnrac vgM70ul0rlv8yPerYwUvG78BkKIQG6d0Xbp6F4Xplax3C8XF/oddAkoA0Nrbmxi9f5yo Z7DDfZT6AS5h+spjBX1WaF5h3ycaSDI+tVo9pJG8XBJgzGx8CL2VXoSbGgdaXVTbvmbC 0Ho0RWBLp/2VdXel83+tvuGV3A1f4WRXLCZttqqZDdxx8/pJksCBu1PePUkSk5tCJQIM O0EQ== 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 c8si1444146pfi.93.2018.02.09.01.36.26; Fri, 09 Feb 2018 01:36:43 -0800 (PST) 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 S1752381AbeBIJeJ (ORCPT + 99 others); Fri, 9 Feb 2018 04:34:09 -0500 Received: from mga06.intel.com ([134.134.136.31]:5050 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbeBIJeF (ORCPT ); Fri, 9 Feb 2018 04:34:05 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2018 01:34:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,482,1511856000"; d="scan'208";a="29438553" Received: from jnikula-mobl2.fi.intel.com (HELO localhost) ([10.237.72.62]) by fmsmga001.fm.intel.com with ESMTP; 09 Feb 2018 01:34:02 -0800 From: Jani Nikula To: Jonathan Corbet , linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, mchehab@kernel.org, me@tobin.cc, Jonathan Corbet Subject: Re: [PATCH 6/8] docs: kernel-doc: Move STATE_PROTO processing into its own function In-Reply-To: <20180207172624.24555-7-corbet@lwn.net> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20180207172624.24555-1-corbet@lwn.net> <20180207172624.24555-7-corbet@lwn.net> Date: Fri, 09 Feb 2018 11:33:57 +0200 Message-ID: <874lmqa4my.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 07 Feb 2018, Jonathan Corbet wrote: > Move the top-level prototype-processing code out of process_file(). > > Signed-off-by: Jonathan Corbet Reviewed-by: Jani Nikula > --- > scripts/kernel-doc | 46 ++++++++++++++++++++++++++++------------------ > 1 file changed, 28 insertions(+), 18 deletions(-) > > diff --git a/scripts/kernel-doc b/scripts/kernel-doc > index a6a7bb46ea29..2deddb876156 100755 > --- a/scripts/kernel-doc > +++ b/scripts/kernel-doc > @@ -1965,6 +1965,32 @@ sub process_body($$) { > } > > > +# > +# STATE_PROTO: reading a function/whatever prototype. > +# > +sub process_proto($$) { > + my $file = shift; > + > + if (/$doc_inline_oneline/) { > + $section = $1; > + $contents = $2; > + if ($contents ne "") { > + $contents .= "\n"; > + dump_section($file, $section, $contents); > + $section = $section_default; > + $contents = ""; > + } > + } elsif (/$doc_inline_start/) { > + $state = STATE_INLINE; > + $inline_doc_state = STATE_INLINE_NAME; > + } elsif ($decl_type eq 'function') { > + process_proto_function($_, $file); > + } else { > + process_proto_type($_, $file); > + } > +} > + > + > sub process_file($) { > my $file; > my $func; > @@ -2031,24 +2057,8 @@ sub process_file($) { > ++$warnings; > } > } > - } elsif ($state == STATE_PROTO) { # scanning for function '{' (end of prototype) > - if (/$doc_inline_oneline/) { > - $section = $1; > - $contents = $2; > - if ($contents ne "") { > - $contents .= "\n"; > - dump_section($file, $section, $contents); > - $section = $section_default; > - $contents = ""; > - } > - } elsif (/$doc_inline_start/) { > - $state = STATE_INLINE; > - $inline_doc_state = STATE_INLINE_NAME; > - } elsif ($decl_type eq 'function') { > - process_proto_function($_, $file); > - } else { > - process_proto_type($_, $file); > - } > + } elsif ($state == STATE_PROTO) { > + process_proto($file, $_); > } elsif ($state == STATE_DOCBLOCK) { > if (/$doc_end/) > { -- Jani Nikula, Intel Open Source Technology Center