Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp750875ybz; Wed, 15 Apr 2020 18:09:09 -0700 (PDT) X-Google-Smtp-Source: APiQypJO35tGRHVxWoGcdZLgEw8CwLtXqiGfK1nwpjoWU7aWWWXrfReCr6xxfitIlqLVY6qjChtK X-Received: by 2002:a50:9d83:: with SMTP id w3mr28100870ede.23.1586999349116; Wed, 15 Apr 2020 18:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586999349; cv=none; d=google.com; s=arc-20160816; b=bJm9AmW20PsqtlDcJAYkmP5nxvXQe6JTc3ltRJpvScRHx8KjCjSixgN2Uw+FJonSDS O/cmOHlSCHEbrTLTXGGR6m13SvlN+knWpJe3tgNIfyR7ZJXWsyDaxaoVODMhIBHi1++p iIFWtjIi6EB4ZXX3VFmSeepJEHjoGjnGwZXtvbpTyET8mh4jfWtkgo/gslF7cXNV+cV5 jS+klqLTr8vwdFuQ+qn98U9Det+T7OpBTzJTP5XVovadlhsGfb7jblPcXDKpM07mV34V CCYzgzY5ni04dkzz4fmcq9eB1+4v0hWt6fYRUXPuyzNNKD2XTx76BjNmvE1Qhl5UY89L LLdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=4B8mcvFHcDEpRGJyDZv5gjzy7Uh0UUTpiEk9wXzzEe8=; b=WNyrImz/qeAtTI/iVOehOyoqVlqClav7+V3jopNMlwQ3dbe46qEf+/o8MWs5uU+L2J kFzc38I6DjCW918nFGdkEVpvE7Fog/nQgUdsnZZkrjyXkFbFnikbK0uF4HYgXCOIaoaM iJEcbDpf5+rPoTQ4PjcqhkeltXXG2AxAA8iiuTqU6dAqT5L2LCYme+YBw2mmZa1mccQo bwJSYW6FSOuWXPRU6dR1K3tMHpqH9/i3/Bdq2ci8J0vjS0e5u25ViksdmlMHopc7rxfr STfagCkRiJhB7zBY0laiwPdiPqeblJ/0jx79KluqRqnL/trQncNGwZwB9QKwkJyq/i4f 4uJg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c3si11997254edq.401.2020.04.15.18.08.43; Wed, 15 Apr 2020 18:09:09 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S371378AbgDOVLh (ORCPT + 99 others); Wed, 15 Apr 2020 17:11:37 -0400 Received: from ms.lwn.net ([45.79.88.28]:52784 "EHLO ms.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371372AbgDOVLe (ORCPT ); Wed, 15 Apr 2020 17:11:34 -0400 Received: from lwn.net (localhost [127.0.0.1]) (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 1B799739; Wed, 15 Apr 2020 21:11:34 +0000 (UTC) Date: Wed, 15 Apr 2020 15:11:32 -0600 From: Jonathan Corbet To: Peter Maydell Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini Subject: Re: [PATCH] scripts/kernel-doc: Add missing close-paren in c:function directives Message-ID: <20200415151132.03cad507@lwn.net> In-Reply-To: <20200414143743.32677-1-peter.maydell@linaro.org> References: <20200414143743.32677-1-peter.maydell@linaro.org> Organization: LWN.net MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Apr 2020 15:37:43 +0100 Peter Maydell wrote: > When kernel-doc generates a 'c:function' directive for a function > one of whose arguments is a function pointer, it fails to print > the close-paren after the argument list of the function pointer > argument. For instance: > > long work_on_cpu(int cpu, long (*fn) (void *, void * arg) > > in driver-api/basics.html is missing a ')' separating the > "void *" of the 'fn' arguments from the ", void * arg" which > is an argument to work_on_cpu(). > > Add the missing close-paren, so that we render the prototype > correctly: > > long work_on_cpu(int cpu, long (*fn)(void *), void * arg) > > (Note that Sphinx stops rendering a space between the '(fn*)' and the > '(void *)' once it gets something that's syntactically valid.) > > Signed-off-by: Peter Maydell Interesting. This appears to have affected well over 100 function definitions in the docs, and nobody ever noticed. Good to know we're all reading it closely :) Applied, thanks. > I noticed this first in the copy of kernel-doc that QEMU is using for > its Sphinx documentation. Older versions of Sphinx don't try to > parse the argument to c:function, so the only effect is incorrect > output, but Sphinx 3.0 does do this and will complain: > Invalid C declaration: Expecting "," or ")" in parameters, got "EOF". > > It looks like the kernel docs currently won't build at all > with Sphinx 3.0; https://github.com/sphinx-doc/sphinx/issues/7421 > so I don't have an example of the error for the kernel docs. > > QEMU is currently carrying another patch to our kernel-doc: > https://patchew.org/QEMU/20200411182934.28678-1-peter.maydell@linaro.org/20200411182934.28678-4-peter.maydell@linaro.org/ > which makes it use the new-in-3.0 "c:struct::" directive now > that "c:type::" no longer accepts "struct foo". Does anybody > have a plan for how the kernel kernel-doc is going to deal with > that non-back-compatible Sphinx change? Thinking about 3.0 is on my list, but I've not gotten there yet. I really wish they wouldn't break things like that... Thanks, jon