From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ms.lwn.net (ms.lwn.net [45.79.88.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D4141D687; Wed, 3 Jan 2024 21:13:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lwn.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lwn.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lwn.net header.i=@lwn.net header.b="thrsfLlP" Received: from localhost (unknown [IPv6:2601:280:5e00:7e19::646]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id B79B21C33; Wed, 3 Jan 2024 21:13:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 ms.lwn.net B79B21C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lwn.net; s=20201203; t=1704316416; bh=Z9wBUNkIgI1KjeMMPZc6rSKy4oBEXR9BlVUj6OtV9uI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=thrsfLlP77MOXmB2UFnPrAPvKi8nCbKhM4/jiA2DsSt1OzJWwxacP255IxO3RWr+h BLeecooI+oUYzgNVAOLDxbVno4j0sTneuB3UJLAxSHrb3tgGQdg/vqNPRzPCz60+iE PilAJa/NgU3fynrEBLA4496+Khl8sh/FEd+Ao6Uag2TmI53IRVEQBb8BHGGGajNmOb tHD5ZQKbIC3wv3fDikABq3bRANZ6W+F67hqRxOAj4Whk8scDHDT38btyDIt2Rw10+3 ue68xJFNJmsN6k+bVyN7g1mS4LahLa6Q8Yrh5lgpak74Yf8oi34Drousj30aImLLTb 1L5YZsi+TO2kw== From: Jonathan Corbet To: Randy Dunlap , linux-kernel@vger.kernel.org Cc: Randy Dunlap , Jani Nikula , linux-doc@vger.kernel.org Subject: Re: [PATCH] kernel-doc: handle a void function without producing a warning In-Reply-To: <20231226065219.319-1-rdunlap@infradead.org> References: <20231226065219.319-1-rdunlap@infradead.org> Date: Wed, 03 Jan 2024 14:13:36 -0700 Message-ID: <87le9686in.fsf@meer.lwn.net> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Randy Dunlap writes: > Currently a void function can produce a warning: > main.c:469: warning: contents before sections > > This one is from arch/x86/kernel/cpu/sgx/main.c (which is not included > in any produced kernel documentation output). > > Handle this by setting $in_doc_sect to 1 whenever any recognized > document section name is processed. > > Fixes: f624adef3d0b ("kernel-doc: limit the "section header:" detection to a select few") > Signed-off-by: Randy Dunlap > Cc: Jani Nikula > Cc: Jonathan Corbet > Cc: linux-doc@vger.kernel.org > --- > scripts/kernel-doc | 1 + > 1 file changed, 1 insertion(+) > > diff -- a/scripts/kernel-doc b/scripts/kernel-doc > --- a/scripts/kernel-doc > +++ b/scripts/kernel-doc > @@ -2126,6 +2126,7 @@ sub process_body($$) { > } > > if (/$doc_sect/i) { # case insensitive for supported section names > + $in_doc_sect = 1; > $newsection = $1; Applied, thanks. jon