Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5859931pxb; Tue, 16 Feb 2021 09:15:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCZ9cd6sZp7BBCiStaWl7cmQ0YH0KzCKhC3DVVhwePqmfS4up/5GBMH1yF9jqwYO15gB9O X-Received: by 2002:a17:907:d25:: with SMTP id gn37mr21537414ejc.303.1613495710154; Tue, 16 Feb 2021 09:15:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613495710; cv=none; d=google.com; s=arc-20160816; b=aJE4sndc3aN8AWGxIK216jpySOirsjDs8D9mHIWt8dMvS/3QDxHZm3ESlvH6TEelbv 0AKwZE/H5dJynNkC7PtPGvrM3ySr6Y3/UI0NJWZlW+el6GnSmqmew+PSVdeX8/aE1W3z B5ZZyNa/4YTFPcuECchl9hF55TejClP/GflqKIUvJ9Nrj7TCctmWWW0jdsZaR7NMnHkx zeFWRdSi9h/j7ON/lZa/ukdjYqWvMGqK5H+9G+r2jyM0RwR89gKM+UgZ/zW0lXXfsPHN bP4QPyGA9aCZtUzDWGuSuVHDKMj7SNCDfyiO1pc927sQCvJI/sPRT5DxI0XcQJMSk8W/ tRKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ekOOag42UZN3Eu67e57VbrsLUqfCOHv+bajvQxzjCe4=; b=fb+R0Khj474w7iV2Q2mgyzkY6pxHaMjblQmiZeRVPJb8NCOwQZeBChsomyBj3Lgjbp Lq1kIoP9Letxvwxv5yrG1axudWOk6aaeeGS/agnibytt3J1RGTfTEjEg5gsCUjShpK90 p+gpkyeBSgr3qs7rnZcEi3adF4rta5u/5xe494mW6vfqkUTQCtZ3GfDdXWL6BR/oTE0v HnQBfXeX1iitC3r1h9wnHuKFB78jPuKL/G51PGAr/xBGkzv/ILPXgyRjYs3gbsHln/O7 ZeRi+9ZqQa/dHbuowgRO/O0Gl8FQQkaZ6uI825+8JdFrB40UTANzsdx1V00vFGQqNR79 M4qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vECeKvEo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id h22si6497251ejc.680.2021.02.16.09.14.38; Tue, 16 Feb 2021 09:15:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vECeKvEo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229784AbhBPROC (ORCPT + 99 others); Tue, 16 Feb 2021 12:14:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230332AbhBPRNz (ORCPT ); Tue, 16 Feb 2021 12:13:55 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F13ECC061574; Tue, 16 Feb 2021 09:13:14 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id e9so6363927pjj.0; Tue, 16 Feb 2021 09:13:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ekOOag42UZN3Eu67e57VbrsLUqfCOHv+bajvQxzjCe4=; b=vECeKvEornGldAk+V24b5sxJbH61gD6gHUEXzmN6ARUlrYfeXRiqU9DfNGRmiS6xLj CeWYuB3Iq6kRvbBXFuGpeZmq72b3eMSd4VNRZySiFH4s9i38NH5hL1teBWwiMXPNluHh o5U4n5ecv5yyWzoQKJIKWQj4+rhfoDGB8FEVuCZ/VTde0Qr9MuEToWR+M9rtB1bLixrI UKN23a8j+sAYq/LCZFp1uCNJaRJFoRLrfF6c8KTH1yXn01KzOCQWRuYfafqO9M7QJdOE KH4LIU93AQMnz71OvGv/4Dj/uM8nWp/j8k35j3uhmt/96rsT/uC3agVHqVkUjB/UTsX9 I08w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ekOOag42UZN3Eu67e57VbrsLUqfCOHv+bajvQxzjCe4=; b=RF3kctDOnXteL89owP4kJdtoFOm8WkutMHfxhdTuMs7cV0ukDATAZbloY5it/R4F3H nWmKjkvt8GbjyUgIuVG1JcaFHh9HpXpnCrQe7eeeFZo4jaDjx/YBZ4N2y+9sBggo0Rw1 Wu1ynPz/x7jvWKMfZCDFgw/LQC75eAfY3kJIjxf+UuFgx9JDLBrou3ExnLVVNYaPgSVt X0OaqngIWCaKQj65pfcuG7FTk4YF5drISGt6U4pGj4NH5NJaMIx6sFkm1R7NXD5NYO1b yTw3mKpFL5hMDX6QfjRKmWKDRqJer9D4ofEAsekGsgHkzKAS61l590HgfuzrzVXqz/Cc FcIw== X-Gm-Message-State: AOAM533LWbFhFerUJq4qNFvzmkyvWRgaqp3aKsc8Xsdl6h1/Wqb1mhAO 2bHTc8EJnBn5zDx4qt0CIs+2g0+qQLZqoYlVTke0JFrtb6Q8/DKV X-Received: by 2002:a17:90a:4fc1:: with SMTP id q59mr5380026pjh.129.1613495594441; Tue, 16 Feb 2021 09:13:14 -0800 (PST) MIME-Version: 1.0 References: <87r1lgx8fo.fsf@meer.lwn.net> <87mtw4x7rw.fsf@meer.lwn.net> In-Reply-To: <87mtw4x7rw.fsf@meer.lwn.net> From: Andy Shevchenko Date: Tue, 16 Feb 2021 19:12:58 +0200 Message-ID: Subject: Re: anonymous enums in kernel doc To: Jonathan Corbet Cc: Linux Kernel Mailing List , Linux Documentation List , Mauro Carvalho Chehab Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 16, 2021 at 7:05 PM Jonathan Corbet wrote: > > Andy Shevchenko writes: > > > On Tue, Feb 16, 2021 at 6:51 PM Jonathan Corbet wrote: > >> > >> > Mauro, can you do some test cases in your workflow against anonymous > >> > enum in ernel doc, please? > >> > > >> > They are broken again, please fix the script! > >> > > >> > drivers/pinctrl/intel/pinctrl-intel.c:204: warning: wrong kernel-doc > >> > identifier on line: > >> > * enum - Locking variants of the pad configuration > >> > > >> > Above is simply a wrong statement. > >> > >> The real problem, perhaps, is that there seems to be little point in > >> adding kerneldoc comments for anonymous enums; where are you going to > >> use that documentation? > > > > I had been explicitly told during review (IIRC by maintainers) to make > > it such, while the initial version was exactly like you are thinking > > of. So, I'm not the right person to be asked :-) Just for a reference [1]. > >> The error message could perhaps be changed to > >> say that; meanwhile, perhaps this one could be fixed with an action like > >> s%/**%/*% ? > > > > See above. I think regression comes from the kernel doc script, > > earlier it was okay. That said, the author of kernel doc changes has > > to submit a patch to amend the driver and maintainers will review it. > > kerneldoc now warns about various incorrect things that it used to just > silently pass over. There is no regression here, just a new diagnostic > to point out something that was never going to work right. Unless you > have a good idea for what kerneldoc should do with a block like that? As it does, put description of individual fields and prepend it with a common part. So, enum - Bla bla bla @FOO: ABC @BAR: DEF Description Should go in the doc for the corresponding file like (as an example) Anonymous enumeration Bla bla bla Description FOO ABC BAR DEF (not sure about indentation, emphasizing and separators, but I think you got the idea). > (An alternative fix, of course, would be to give the enum a name so it > can actually be used for type checking.) That enum is not used as an enum, it provides the logically unified constants. Personally I don't see why the kernel doc can't digest this. [1]: https://patchwork.ozlabs.org/project/linux-gpio/patch/20190808132128.13359-1-andriy.shevchenko@linux.intel.com/ -- With Best Regards, Andy Shevchenko