[PATCH 2/2] drm/doc: Fix more kerneldoc/sphinx warnings
Em Wed, 20 Jul 2016 20:35:09 +0200 Markus Heiser escreveu: > Am 20.07.2016 um 14:20 schrieb Mauro Carvalho Chehab s-opensource.com>: > > > Em Tue, 19 Jul 2016 14:36:50 +0200 > > Daniel Vetter escreveu: > > > >> On Tue, Jul 19, 2016 at 01:42:55PM +0200, Daniel Vetter wrote: > >>> These are the leftovers I could only track down using keep_warnings = > >>> True. For some of them we might want to update our style guide on how > >>> to reference structures and constants, not sure ... > >>> > >>> Cc: Markus Heiser > >>> Cc: Jonathan Corbet > >>> Cc: linux-doc at vger.kernel.org > >>> Signed-off-by: Daniel Vetter > >> > >> Aside: With this and the latest docs-next branch from Jon it's possible to > >> compile test doc changes (e.g. with git rebase -x) using: > >> > >> $ make IGNORE_DOCBOOKS=1 SPHINXOPTS=-W htmldocs > > > > Unfortunately, we'll not get rid of Sphinx warnings any time soon. > > > > The Sphinx function parser is really broken, even on version 1.4.5. > > > > Every time Sphinx finds a typedef argument or return value, like here: > > > > ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, > > size_t idx, int offset, u8 __user * buf, size_t len); > > > > It produces a very ugly noisy warning: > > > > ./drivers/media/dvb-core/dvb_ringbuffer.h:149: WARNING: Error when parsing > > function declaration. > > If the function has no return type: > > Error in declarator or parameters and qualifiers > > Invalid definition: Expecting "(" in parameters_and_qualifiers. [error at > > 8] > >ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, > > size_t idx, int offset, u8 __user * buf, size_t len) > >^ > > If the function has a return type: > > Error in declarator or parameters and qualifiers > > If pointer to member declarator: > >Invalid definition: Expected '::' in pointer to member (function). > > [error at 37] > > ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, > > size_t idx, int offset, u8 __user * buf, size_t len) > > -^ > > If declarator-id: > >Invalid definition: Expecting "," or ")" in parameters_and_qualifiers, > > got "*". [error at 102] > > ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, > > size_t idx, int offset, u8 __user * buf, size_t len) > > > > --^ > > > > Aaargh ... it seems you are right. Just sent a fix for the above: https://git.linuxtv.org/mchehab/experimental.git/commit/?h=docs-next=263bbae9c1bf6ea7c14dad8c29f9b3148b2b5de7 I was able to fix the other two typedef warnings with: https://git.linuxtv.org/mchehab/experimental.git/commit/?h=docs-next=b32909983ab03e03504bb44d5c66f44b9d57adc3 Basically, I had to: 1) Make kernel-doc ignore __user; 2) typedef the function argument for v4l2_ctrl_add_handler(); 3) not let kernel-doc generate :cpp:function: for function typedefs. With DocBook, we used kernel-doc to produce a page for typedef functions. Now, such capability got lost. Not sure if/how Sphinx would support it. Thanks, Mauro
[PATCH 2/2] drm/doc: Fix more kerneldoc/sphinx warnings
Am 20.07.2016 um 14:20 schrieb Mauro Carvalho Chehab : > Em Tue, 19 Jul 2016 14:36:50 +0200 > Daniel Vetter escreveu: > >> On Tue, Jul 19, 2016 at 01:42:55PM +0200, Daniel Vetter wrote: >>> These are the leftovers I could only track down using keep_warnings = >>> True. For some of them we might want to update our style guide on how >>> to reference structures and constants, not sure ... >>> >>> Cc: Markus Heiser >>> Cc: Jonathan Corbet >>> Cc: linux-doc at vger.kernel.org >>> Signed-off-by: Daniel Vetter >> >> Aside: With this and the latest docs-next branch from Jon it's possible to >> compile test doc changes (e.g. with git rebase -x) using: >> >> $ make IGNORE_DOCBOOKS=1 SPHINXOPTS=-W htmldocs > > Unfortunately, we'll not get rid of Sphinx warnings any time soon. > > The Sphinx function parser is really broken, even on version 1.4.5. > > Every time Sphinx finds a typedef argument or return value, like here: > > ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, > size_t idx, int offset, u8 __user * buf, size_t len); > > It produces a very ugly noisy warning: > > ./drivers/media/dvb-core/dvb_ringbuffer.h:149: WARNING: Error when parsing > function declaration. > If the function has no return type: > Error in declarator or parameters and qualifiers > Invalid definition: Expecting "(" in parameters_and_qualifiers. [error at 8] >ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, size_t > idx, int offset, u8 __user * buf, size_t len) >^ > If the function has a return type: > Error in declarator or parameters and qualifiers > If pointer to member declarator: >Invalid definition: Expected '::' in pointer to member (function). [error > at 37] > ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, > size_t idx, int offset, u8 __user * buf, size_t len) > -^ > If declarator-id: >Invalid definition: Expecting "," or ")" in parameters_and_qualifiers, got > "*". [error at 102] > ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, > size_t idx, int offset, u8 __user * buf, size_t len) > > --^ > Aaargh ... it seems you are right. There is a discussion about function overloading and identifiers https://github.com/sphinx-doc/sphinx/issues/2682#issuecomment-229515888 If we use the C-domain ("..c:function::" instead of ".. cpp:function::") this error did not expire. But using the C-domain has other drawbacks, we discussed with ioctl. May be it is better to switch to the c-domain and try to handle these drawbacks ... I don't know. > I guess that the problem is because Sphinx tries to generate a CPP like > function name for cross-ref, and such parser is unable to handle typedef > arguments. IMHO, this is broken by design. by design? -- Markus -- > > > Thanks, > Mauro
[PATCH 2/2] drm/doc: Fix more kerneldoc/sphinx warnings
Em Wed, 20 Jul 2016 20:35:09 +0200 Markus Heiser escreveu: > Am 20.07.2016 um 14:20 schrieb Mauro Carvalho Chehab s-opensource.com>: > > > Em Tue, 19 Jul 2016 14:36:50 +0200 > > Daniel Vetter escreveu: > > > >> On Tue, Jul 19, 2016 at 01:42:55PM +0200, Daniel Vetter wrote: > >>> These are the leftovers I could only track down using keep_warnings = > >>> True. For some of them we might want to update our style guide on how > >>> to reference structures and constants, not sure ... > >>> > >>> Cc: Markus Heiser > >>> Cc: Jonathan Corbet > >>> Cc: linux-doc at vger.kernel.org > >>> Signed-off-by: Daniel Vetter > >> > >> Aside: With this and the latest docs-next branch from Jon it's possible to > >> compile test doc changes (e.g. with git rebase -x) using: > >> > >> $ make IGNORE_DOCBOOKS=1 SPHINXOPTS=-W htmldocs > > > > Unfortunately, we'll not get rid of Sphinx warnings any time soon. > > > > The Sphinx function parser is really broken, even on version 1.4.5. > > > > Every time Sphinx finds a typedef argument or return value, like here: > > > > ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, > > size_t idx, int offset, u8 __user * buf, size_t len); > > > > It produces a very ugly noisy warning: > > > > ./drivers/media/dvb-core/dvb_ringbuffer.h:149: WARNING: Error when parsing > > function declaration. > > If the function has no return type: > > Error in declarator or parameters and qualifiers > > Invalid definition: Expecting "(" in parameters_and_qualifiers. [error at > > 8] > >ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, > > size_t idx, int offset, u8 __user * buf, size_t len) > >^ > > If the function has a return type: > > Error in declarator or parameters and qualifiers > > If pointer to member declarator: > >Invalid definition: Expected '::' in pointer to member (function). > > [error at 37] > > ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, > > size_t idx, int offset, u8 __user * buf, size_t len) > > -^ > > If declarator-id: > >Invalid definition: Expecting "," or ")" in parameters_and_qualifiers, > > got "*". [error at 102] > > ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, > > size_t idx, int offset, u8 __user * buf, size_t len) > > > > --^ > > > > Aaargh ... it seems you are right. > > There is a discussion about function overloading and identifiers > > https://github.com/sphinx-doc/sphinx/issues/2682#issuecomment-229515888 > > If we use the C-domain ("..c:function::" instead of ".. cpp:function::") > this error did not expire. But using the C-domain has other drawbacks, we > discussed with ioctl. > > May be it is better to switch to the c-domain and try to handle > these drawbacks ... I don't know. > > > I guess that the problem is because Sphinx tries to generate a CPP like > > function name for cross-ref, and such parser is unable to handle typedef > > arguments. IMHO, this is broken by design. > > by design? What I mean is that, in order to solve typedefs, Sphinx would need to parse all include files that contains typedefs, in order to discover if a typedef argument is used, and parse such argument to the original one, e. g., if we have something like: typedef long int size_t; it would need to replace "size_t" by "long int" internally, before being able to produce an unique reference for a function that uses "size_t" as an argument or returned value. However, AFAICT, Sphinx is not like Doxygen: it doesn't parse header files. So, there's no easy fix. On the other hand, the C domain is too simple: it assumes that all functions, enums, etc are global, e. g. there should be just one function called "ioctl", or "open". So, both domains are broken by design. I agree with you, however, that fixing the c domain seems to be easier. It would require some way to let the user to force the cross reference name, like, for example: .. c:function:: :name: vidioc_ioctl int ioctl( int fd, int request, struct v4l2_capability *argp ) Is it possible to extend the c-domain to do something like that and still be backward-compatible with Sphinx 1.2? Regards, Mauro
[PATCH 2/2] drm/doc: Fix more kerneldoc/sphinx warnings
Em Tue, 19 Jul 2016 14:36:50 +0200 Daniel Vetter escreveu: > On Tue, Jul 19, 2016 at 01:42:55PM +0200, Daniel Vetter wrote: > > These are the leftovers I could only track down using keep_warnings = > > True. For some of them we might want to update our style guide on how > > to reference structures and constants, not sure ... > > > > Cc: Markus Heiser > > Cc: Jonathan Corbet > > Cc: linux-doc at vger.kernel.org > > Signed-off-by: Daniel Vetter > > Aside: With this and the latest docs-next branch from Jon it's possible to > compile test doc changes (e.g. with git rebase -x) using: > > $ make IGNORE_DOCBOOKS=1 SPHINXOPTS=-W htmldocs Unfortunately, we'll not get rid of Sphinx warnings any time soon. The Sphinx function parser is really broken, even on version 1.4.5. Every time Sphinx finds a typedef argument or return value, like here: ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, size_t idx, int offset, u8 __user * buf, size_t len); It produces a very ugly noisy warning: ./drivers/media/dvb-core/dvb_ringbuffer.h:149: WARNING: Error when parsing function declaration. If the function has no return type: Error in declarator or parameters and qualifiers Invalid definition: Expecting "(" in parameters_and_qualifiers. [error at 8] ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, size_t idx, int offset, u8 __user * buf, size_t len) ^ If the function has a return type: Error in declarator or parameters and qualifiers If pointer to member declarator: Invalid definition: Expected '::' in pointer to member (function). [error at 37] ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, size_t idx, int offset, u8 __user * buf, size_t len) -^ If declarator-id: Invalid definition: Expecting "," or ")" in parameters_and_qualifiers, got "*". [error at 102] ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, size_t idx, int offset, u8 __user * buf, size_t len) --^ I guess that the problem is because Sphinx tries to generate a CPP like function name for cross-ref, and such parser is unable to handle typedef arguments. IMHO, this is broken by design. Thanks, Mauro
[PATCH 2/2] drm/doc: Fix more kerneldoc/sphinx warnings
On Tue, Jul 19, 2016 at 01:42:55PM +0200, Daniel Vetter wrote: > These are the leftovers I could only track down using keep_warnings = > True. For some of them we might want to update our style guide on how > to reference structures and constants, not sure ... > > Cc: Markus Heiser > Cc: Jonathan Corbet > Cc: linux-doc at vger.kernel.org > Signed-off-by: Daniel Vetter Aside: With this and the latest docs-next branch from Jon it's possible to compile test doc changes (e.g. with git rebase -x) using: $ make IGNORE_DOCBOOKS=1 SPHINXOPTS=-W htmldocs To make this easier I've quickly pulled in the latest docs-next into drm-intel-nightly. Cheers, Daniel > --- > drivers/gpu/drm/drm_crtc.c | 4 ++-- > drivers/gpu/drm/drm_fb_helper.c | 2 +- > drivers/gpu/drm/drm_irq.c | 8 +++ > drivers/gpu/drm/drm_simple_kms_helper.c | 2 +- > drivers/gpu/drm/i915/i915_vgpu.c| 42 > - > drivers/gpu/drm/i915/intel_audio.c | 6 ++--- > drivers/gpu/drm/i915/intel_guc_fwif.h | 5 ++-- > include/drm/drm_crtc.h | 8 +++ > include/drm/drm_gem.h | 4 ++-- > 9 files changed, 41 insertions(+), 40 deletions(-) > > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c > index f9f2506b1855..420f4fc8e6a7 100644 > --- a/drivers/gpu/drm/drm_crtc.c > +++ b/drivers/gpu/drm/drm_crtc.c > @@ -1273,7 +1273,7 @@ static unsigned int drm_num_planes(struct drm_device > *dev) > * @plane: plane object to init > * @possible_crtcs: bitmask of possible CRTCs > * @funcs: callbacks for the new plane > - * @formats: array of supported formats (%DRM_FORMAT_*) > + * @formats: array of supported formats (DRM_FORMAT\_\*) > * @format_count: number of elements in @formats > * @type: type of plane (overlay, primary, cursor) > * @name: printf style format string for the plane name, or NULL for default > name > @@ -1388,7 +1388,7 @@ static void drm_plane_unregister_all(struct drm_device > *dev) > * @plane: plane object to init > * @possible_crtcs: bitmask of possible CRTCs > * @funcs: callbacks for the new plane > - * @formats: array of supported formats (%DRM_FORMAT_*) > + * @formats: array of supported formats (DRM_FORMAT\_\*) > * @format_count: number of elements in @formats > * @is_primary: plane type (primary vs overlay) > * > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > index ce54e985d91b..95f405e04f5f 100644 > --- a/drivers/gpu/drm/drm_fb_helper.c > +++ b/drivers/gpu/drm/drm_fb_helper.c > @@ -2194,7 +2194,7 @@ EXPORT_SYMBOL(drm_fb_helper_initial_config); > * @fb_helper: the drm_fb_helper > * > * Scan the connectors attached to the fb_helper and try to put together a > - * setup after *notification of a change in output configuration. > + * setup after notification of a change in output configuration. > * > * Called at runtime, takes the mode config locks to be able to check/change > the > * modeset configuration. Must be run from process context (which usually > means > diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c > index b49a4a6e97cd..a33465d8e133 100644 > --- a/drivers/gpu/drm/drm_irq.c > +++ b/drivers/gpu/drm/drm_irq.c > @@ -713,10 +713,10 @@ EXPORT_SYMBOL(drm_calc_timestamping_constants); > * Negative value on error, failure or if not supported in current > * video mode: > * > - * -EINVAL - Invalid CRTC. > - * -EAGAIN - Temporary unavailable, e.g., called before initial modeset. > - * -ENOTSUPP - Function not supported in current display mode. > - * -EIO - Failed, e.g., due to failed scanout position query. > + * -EINVALInvalid CRTC. > + * -EAGAINTemporary unavailable, e.g., called before initial modeset. > + * -ENOTSUPP Function not supported in current display mode. > + * -EIO Failed, e.g., due to failed scanout position query. > * > * Returns or'ed positive status flags on success: > * > diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c > b/drivers/gpu/drm/drm_simple_kms_helper.c > index 0db36d27e90b..4e1de31f072b 100644 > --- a/drivers/gpu/drm/drm_simple_kms_helper.c > +++ b/drivers/gpu/drm/drm_simple_kms_helper.c > @@ -152,7 +152,7 @@ static const struct drm_plane_funcs > drm_simple_kms_plane_funcs = { > * @dev: DRM device > * @pipe: simple display pipe object to initialize > * @funcs: callbacks for the display pipe (optional) > - * @formats: array of supported formats (%DRM_FORMAT_*) > + * @formats: array of supported formats (DRM_FORMAT\_\*) > * @format_count: number of elements in @formats > * @connector: connector to attach and register > * > diff --git a/drivers/gpu/drm/i915/i915_vgpu.c > b/drivers/gpu/drm/i915/i915_vgpu.c > index 142bac976919..ca2e91259948 100644 > --- a/drivers/gpu/drm/i915/i915_vgpu.c > +++ b/drivers/gpu/drm/i915/i915_vgpu.c > @@ -156,27 +156,27 @@ static int vgt_balloon_space(struct drm_mm *mm, > * host point of view, the
[PATCH 2/2] drm/doc: Fix more kerneldoc/sphinx warnings
These are the leftovers I could only track down using keep_warnings = True. For some of them we might want to update our style guide on how to reference structures and constants, not sure ... Cc: Markus Heiser Cc: Jonathan Corbet Cc: linux-doc at vger.kernel.org Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_crtc.c | 4 ++-- drivers/gpu/drm/drm_fb_helper.c | 2 +- drivers/gpu/drm/drm_irq.c | 8 +++ drivers/gpu/drm/drm_simple_kms_helper.c | 2 +- drivers/gpu/drm/i915/i915_vgpu.c| 42 - drivers/gpu/drm/i915/intel_audio.c | 6 ++--- drivers/gpu/drm/i915/intel_guc_fwif.h | 5 ++-- include/drm/drm_crtc.h | 8 +++ include/drm/drm_gem.h | 4 ++-- 9 files changed, 41 insertions(+), 40 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index f9f2506b1855..420f4fc8e6a7 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1273,7 +1273,7 @@ static unsigned int drm_num_planes(struct drm_device *dev) * @plane: plane object to init * @possible_crtcs: bitmask of possible CRTCs * @funcs: callbacks for the new plane - * @formats: array of supported formats (%DRM_FORMAT_*) + * @formats: array of supported formats (DRM_FORMAT\_\*) * @format_count: number of elements in @formats * @type: type of plane (overlay, primary, cursor) * @name: printf style format string for the plane name, or NULL for default name @@ -1388,7 +1388,7 @@ static void drm_plane_unregister_all(struct drm_device *dev) * @plane: plane object to init * @possible_crtcs: bitmask of possible CRTCs * @funcs: callbacks for the new plane - * @formats: array of supported formats (%DRM_FORMAT_*) + * @formats: array of supported formats (DRM_FORMAT\_\*) * @format_count: number of elements in @formats * @is_primary: plane type (primary vs overlay) * diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index ce54e985d91b..95f405e04f5f 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -2194,7 +2194,7 @@ EXPORT_SYMBOL(drm_fb_helper_initial_config); * @fb_helper: the drm_fb_helper * * Scan the connectors attached to the fb_helper and try to put together a - * setup after *notification of a change in output configuration. + * setup after notification of a change in output configuration. * * Called at runtime, takes the mode config locks to be able to check/change the * modeset configuration. Must be run from process context (which usually means diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index b49a4a6e97cd..a33465d8e133 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -713,10 +713,10 @@ EXPORT_SYMBOL(drm_calc_timestamping_constants); * Negative value on error, failure or if not supported in current * video mode: * - * -EINVAL - Invalid CRTC. - * -EAGAIN - Temporary unavailable, e.g., called before initial modeset. - * -ENOTSUPP - Function not supported in current display mode. - * -EIO - Failed, e.g., due to failed scanout position query. + * -EINVALInvalid CRTC. + * -EAGAINTemporary unavailable, e.g., called before initial modeset. + * -ENOTSUPP Function not supported in current display mode. + * -EIO Failed, e.g., due to failed scanout position query. * * Returns or'ed positive status flags on success: * diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c index 0db36d27e90b..4e1de31f072b 100644 --- a/drivers/gpu/drm/drm_simple_kms_helper.c +++ b/drivers/gpu/drm/drm_simple_kms_helper.c @@ -152,7 +152,7 @@ static const struct drm_plane_funcs drm_simple_kms_plane_funcs = { * @dev: DRM device * @pipe: simple display pipe object to initialize * @funcs: callbacks for the display pipe (optional) - * @formats: array of supported formats (%DRM_FORMAT_*) + * @formats: array of supported formats (DRM_FORMAT\_\*) * @format_count: number of elements in @formats * @connector: connector to attach and register * diff --git a/drivers/gpu/drm/i915/i915_vgpu.c b/drivers/gpu/drm/i915/i915_vgpu.c index 142bac976919..ca2e91259948 100644 --- a/drivers/gpu/drm/i915/i915_vgpu.c +++ b/drivers/gpu/drm/i915/i915_vgpu.c @@ -156,27 +156,27 @@ static int vgt_balloon_space(struct drm_mm *mm, * host point of view, the graphic address space is partitioned by multiple * vGPUs in different VMs. :: * - *vGPU1 view Host view - * 0 --> +---+ +---+ - * ^ |###| | vGPU3 | - * | |###| +---+ - * | |###| | vGPU2 | - * | +---+ +---+ - *mappable GM| available | ==> | vGPU1 | - * | +---+ +---+ - *