[Intel-gfx] [PATCH v3 01/37] drm/i915: fix kernel-doc trivial warnings on i915/*.[ch] files
Mauro Carvalho Chehab
mchehab at kernel.org
Mon Sep 26 09:19:16 UTC 2022
Em Fri, 16 Sep 2022 17:03:27 +0300
Gwan-gyeong Mun <gwan-gyeong.mun at intel.com> escreveu:
> > /**
> > - * Called when user space has done writes to this buffer
> > + * i915_gem_sw_finish_ioctl - Called when user space has done writes to
> > + * this buffer
> As per this link[1], the brief description does not have a limitation to
> match the indentation when explained over multiple lines, unlike
> function parameters.
>
> [1]
> https://docs.kernel.org/doc-guide/kernel-doc.html#function-documentation
>
> Therefore if you look at the function brief description over several
> lines in i915 and drm,
>
> One of the drm apis, drm_gem_lock_reservations(), is used without
> indentation in the form below,
> /**
> * drm_gem_lock_reservations - Sets up the ww context and acquires
> * the lock on an array of GEM objects.
>
> In i915_perf.c, indentation is set as follows.
>
> /**
> * gen8_append_oa_reports - Copies all buffered OA reports into
> * userspace read() buffer.
>
> ...
>
> /**
> * gen7_append_oa_reports - Copies all buffered OA reports into
> * userspace read() buffer.
>
> If there is no problem when using the same form as
> gen8_append_oa_reports when generating kernel-doc, it seems to be
> indented to match the existing i915 style. However, if there is a
> problem, I think you need to remove the indented part of the i915 code
> like the drm apis.
>
> except i915_gem_sw_finish_ioctl i915_gem_gtt_pwrite_fast parts, the
> rest of the parts look good to me.
There's no rule about either indent or not. IMO, it makes easier for
humans to read when indent is used.
Yet, I'd say that, right now, 50% of multi-line comments within the
kernel has indent. So, it is more like a matter of personal developer's
preference at the moment.
>
> Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun at intel.com>
Thanks,
Mauro
More information about the dri-devel
mailing list