From patchwork Tue Dec 26 06:52:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 183276 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp714136dyb; Mon, 25 Dec 2023 22:52:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1+uPzErnO5v8mzmqMUz2/M5woxEi9zA1UGoLL8l7mj9prEKeyKoSUsNov7kU+S2D0LL6A X-Received: by 2002:a05:6902:1106:b0:dbd:2bf6:ca7b with SMTP id o6-20020a056902110600b00dbd2bf6ca7bmr3789087ybu.35.1703573559166; Mon, 25 Dec 2023 22:52:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703573559; cv=none; d=google.com; s=arc-20160816; b=Yf+ULX3t94Ucf2l17I5fQUsnmDpFo+guYvGAvpexFePNw7h9NpNEqoS5JcFAv6m7/7 mwGBJQDs+IKBBxy18q9pfQni1MuowOU70rZQ9CVXIV5IbKPzHKF6mJgdBqbFlE/wu//U uuyCn7/mSUHI3bhZKwOtjTbKUafVCE9nekNR3wKEqcG9BFeyxFSMAYDZ8JjSqCijq0Vp RXAstZy2stypAOg/I16pQiddBn+djUJnBGluTtiHKlWCKolFDSoiJB0SiS15wYgHdPsC 6R4z6/ny2mPzpou7Jxo/8Ps+GX4K340l0+gCmBrUgyom9Q1UjtAIuwTeINy+/pBhmxlM xieg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=kkgklDeXRuhCQW767gm/kiIxt834TUdRq1zskO/SUKE=; fh=ZF4KgFNntCOwm2Hz8dv/v6PaU4pUfym3H72oYsTv2J0=; b=bZjYw0grdDrwUnLV6jLcpr+zPCA2tQeXKC9EfVPRasVSMTiPMZi8Fzz6dXiklFKf5B lJ63MwJtRseiCy4ZuPrN+t3nvJQAIGENYcuKLmLGxdlWVYCpsmVoBL3t8MhWoeVeTyIc 4dPO9I+6UzXk8M8PBrIzF/rf3oasbPjqf0N9oo7YXyvt4wXqAt/9Qf6l4n4Wz8j32uVQ naAUg1+x483JkQR4CFfr5IJ/T5dbbpcFsAPkLeKejg1oZBbhj8d3vAoXKYa/EfNGCzfd Yl5+efNRqcaCg1E+MMGGAwshE3nVTjS64qs/rAK6HgeVG+rUOngtnPGM8SZ0dPDjZFlG MKIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xvTXLOrh; spf=pass (google.com: domain of linux-kernel+bounces-11394-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11394-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i28-20020a63541c000000b005cd85f59928si9163843pgb.339.2023.12.25.22.52.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Dec 2023 22:52:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11394-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xvTXLOrh; spf=pass (google.com: domain of linux-kernel+bounces-11394-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11394-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E8BB1282D70 for ; Tue, 26 Dec 2023 06:52:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F3644C620; Tue, 26 Dec 2023 06:52:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="xvTXLOrh" X-Original-To: linux-kernel@vger.kernel.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CA0AC4C3BD; Tue, 26 Dec 2023 06:52:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=kkgklDeXRuhCQW767gm/kiIxt834TUdRq1zskO/SUKE=; b=xvTXLOrhrpyxzm/nxWY/ILl0N/ QwKSw3UC8qJkByrAA9kO9T2rX4cbqE/6NLralyTz97Ml89Ly9utPeqW0TdhnS1SqbLO9ixT+ABdfT /lg8Jx4Y9nso7eggfKdVEooRpoPf3xkmSiBFDP+szt/Kt2FgiWKM6CMCMIONyfWAGs8+SW4VLVbSj FNke/bw0pdMwPbqDiguH2OpmH/1NWITlM9CLM2lS0CcpvG5bFWs6Lj+/VXB6ECF7WZpCXU0fs8mC1 CrEd66DOVJBWepQ3Ru4q+Rq8tiPwZrGclJtTXuCuL88RwGZ+4+f/GLctXrjsa+vIOD4a62xw1jSQb U+oVevPQ==; Received: from [50.53.46.231] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rI1Ia-00BpNA-0w; Tue, 26 Dec 2023 06:52:20 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Jani Nikula , Jonathan Corbet , linux-doc@vger.kernel.org Subject: [PATCH] kernel-doc: handle a void function without producing a warning Date: Mon, 25 Dec 2023 22:52:19 -0800 Message-ID: <20231226065219.319-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786326348174089978 X-GMAIL-MSGID: 1786326348174089978 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; $newcontents = $2;