Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp686080ybg; Wed, 23 Oct 2019 04:28:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZtiP0/xO1wQKaGvsa6FV4B2rz1LtUT8PLFdOLjQcxZXYZcaNeSRnu2MHtZK+8bLlqd1eU X-Received: by 2002:a17:906:48c6:: with SMTP id d6mr32352003ejt.291.1571830096112; Wed, 23 Oct 2019 04:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571830096; cv=none; d=google.com; s=arc-20160816; b=LqDGEWMcbaIWcPH37GwIrxuVL3UMQIxnBLaexM+7IqhGfmiGJWuY7iTRBO8BcqrK0w z7+zqCBdEfzBHTRqHgAH5qxoXmQkkn9gZEmq5znGVwmneL7jwaJZnL9F8xrI+WRPm4Wm gEQE5DQOOCp3l+nxBbW7+7uheXr+PZtCmCwAoYLA50OIc+F+kChjP2Z+sa++AB3XvYqR 4oSX4AFx81lfs63utgg4PTfIODYVOsiTZqnoAJuX/41BaMF245r51ib4Tov4y9iARd0E 7hkm21V41lfMwwC0cx5ykvYhTvMCfPVCdRth/YnsoAVHXvZNqesFCEjhb2jG3Y9mW1fq IiTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fb1aYcSbpq+9iaeIeVo4QA9jJ6hhJT83G2zP5+xozbs=; b=lGEPfIqb5UrPXzrFMy1c0Ub/aPZXrcxwccVgcNFsONAcvV+e/Dn7i85x/EqC4yQaHN uC9nhF3MdjC/mgR126gYNxRaw2gZhqTpkFSJC3DGAiMfG+VlUshf/qZPRUz76ahOSdp2 chseY69NCrIKrmk5jjxNSey2qHnGukn6XB8ovm9W8a71qOR+vrbRAIAUurV0x2CsPdZ3 qeg7xU02ZkwVeO5GvqVg2hhJuDMvzatTX7kLMNQCLf++0XEvysZomrDs9Lf0fV6Cr1ns e/GfPmIFVLfSjE+olk7uNlCcZZ+fUtcK+5PBNf0tpBdiZuVkXmezF4kZtfzUXowyD4FG UBAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LuEjJ4Kr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z97si8135716ede.122.2019.10.23.04.27.52; Wed, 23 Oct 2019 04:28:16 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LuEjJ4Kr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404808AbfJWL1V (ORCPT + 99 others); Wed, 23 Oct 2019 07:27:21 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55078 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732149AbfJWL1V (ORCPT ); Wed, 23 Oct 2019 07:27:21 -0400 Received: by mail-wm1-f67.google.com with SMTP id g7so2738449wmk.4; Wed, 23 Oct 2019 04:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fb1aYcSbpq+9iaeIeVo4QA9jJ6hhJT83G2zP5+xozbs=; b=LuEjJ4KrhoHTIiiGH1NOFoCM9U0V8AryNd/hjKDnuqr9sxyP4/5VcFSjDgqPX26yyX ZvjcUjAWd0f1J2iMs23WBPsWr9UxC1dqqTRX6RUXpFU0qfZCkbzObSQNpRyoEdLbycuJ 53SDQ6yvIEUkgJGRBeQxmgcQMwiZd1DvOsAUMPCDhDnk9d2nROA+P4fhimgc7kSkmub4 MrpLurFv3dE82YJP0ExNlmWHBTaN7lPjECkPjceHMcZCZ4czSio4mYLvDaSo9h9RIt2j 2CLCTLpa6YOCPEpApEpcK2xkr9AkS+U2RWn1/vkklVs4LkXf47k7ObIW1DarR0ssannk 6QJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fb1aYcSbpq+9iaeIeVo4QA9jJ6hhJT83G2zP5+xozbs=; b=YihR6IVPePMnZe4HnV1nh1Ldqn8kg1BZcy/Z3RwJHJJfCDQcPy1/dxPZRb9RaFn7El L6aTuRPCmt2x2MvX1iEMY966Q3nmvApSigARd140K4DVeoJlz/KfN5FGtgLErW+UXOT8 g8t6ugIpTnUxijJOHWdBC23HGjG1NXH284kH8xH2uctLQ2E9QtB9OF1KoL64zIumA6an IX/InbZJIkw2WSeO+WYus/Px1Qsh4Epr2z3brJDFNxXENav70a/yi+65NkGSNLegaB3E J/V76KSX5C7je0dIcsQuEVhUBu/P1NxGjOMPnyC4etKASjZTqnCq1Je/NuDY0l3hDFUa QKzg== X-Gm-Message-State: APjAAAWHNIE0oMlSYnRUo/jhwkpNmcuZ/eTFYtfWbtz7Pivb3QwP64Pz o7MBmZT/NYHZQrNzZlmI65r6q8TboBI= X-Received: by 2002:a1c:7517:: with SMTP id o23mr7738150wmc.34.1571830038540; Wed, 23 Oct 2019 04:27:18 -0700 (PDT) Received: from mail.google.com ([104.238.174.53]) by smtp.gmail.com with ESMTPSA id g11sm20566012wmh.45.2019.10.23.04.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 04:27:17 -0700 (PDT) Date: Wed, 23 Oct 2019 19:27:11 +0800 From: Changbin Du To: Matthew Wilcox Cc: Changbin Du , Jonathan Corbet , Jiri Kosina , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kernel-doc: trivial improvement for warning message Message-ID: <20191023112709.dpc64xc3g3e7wks3@mail.google.com> References: <20191020132323.29658-1-changbin.du@gmail.com> <20191021185406.GC9214@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191021185406.GC9214@bombadil.infradead.org> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 21, 2019 at 11:54:06AM -0700, Matthew Wilcox wrote: > On Sun, Oct 20, 2019 at 09:23:23PM +0800, Changbin Du wrote: > > The message "Function parameter or member ..." looks weird. > > > > Signed-off-by: Changbin Du > > --- > > scripts/kernel-doc | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/scripts/kernel-doc b/scripts/kernel-doc > > index 81dc91760b23..cd3d2ca52c34 100755 > > --- a/scripts/kernel-doc > > +++ b/scripts/kernel-doc > > @@ -1475,8 +1475,13 @@ sub push_parameter($$$$) { > > $parameterdescs{$param} = $undescribed; > > > > if (show_warnings($type, $declaration_name) && $param !~ /\./) { > > - print STDERR > > - "${file}:$.: warning: Function parameter or member '$param' not described in '$declaration_name'\n"; > > + if ($decl_type eq "struct" or $decl_type eq 'union') { > > + print STDERR > > + "${file}:$.: warning: $decl_type member '$param' not described in '$declaration_name'\n"; > > + } else { > > + print STDERR > > + "${file}:$.: warning: $decl_type parameter '$param' not described in '$declaration_name'\n"; > > + } > > ++$warnings; > > How about instead ... > > if (show_warnings($type, $declaration_name) && $param !~ /\./) { if ($decl_type eq "struct") > $msg = "struct member"; > elif ($decl_type eq "union") > $msg = "union member"; > else > $msg = "function parameter"; > print STDERR "${file}:$.: warning: $msg '$param' not described in '$declaration_name'\n"; > > (please excuse my perl, i am not a native speaker) This removes some duplicated characters, but need to decalare a extra variable. I am okay for both approaches. :) -- Cheers, Changbin Du