From: "Christian König" <christian.koenig@amd.com>
To: Omokefe Emmanuel Onanaroghene <emmaonana18@gmail.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Cc: alexander.deucher@amd.com, airlied@gmail.com, simona@ffwll.ch,
paulmck@kernel.org, rostedt@goodmis.org, ast@kernel.org,
peterz@infradead.org, gregkh@linuxfoundation.org,
abo@medichon.fr, skhan@linuxfoundation.org
Subject: Re: [PATCH v2] drm/amd/display: remove unused cgs register accessor typedefs
Date: Tue, 20 Oct 2026 09:02:44 +0200 [thread overview]
Message-ID: <367a13c8-1c18-4a79-a82f-12bb8430fa99@amd.com> (raw)
In-Reply-To: <20261017130047.42080-1-emmaonana18@gmail.com>
On 10/17/26 15:00, Omokefe Emmanuel Onanaroghene wrote:
> kernel-doc reports prototype mismatches for the cgs register accessor
> typedefs, e.g.:
>
> drivers/gpu/drm/amd/include/cgs_common.h:89: expecting prototype
> for cgs_read_register(). Prototype was for uint32_t() instead
>
> Each of the four typedefs is used exactly once, as
> the type of a struct cgs_ops member, so they are merely an
> unnecessary layer of indirection. Drop the typedefs along with their
> kernel-doc comments and write the function pointer types directly in
> struct cgs_ops.
>
> Suggested-by: Christian König <christian.koenig@amd.com>
> Link: https://lore.kernel.org/all/981f01e1-0c3b-4854-9d72-8bf22af9fc64@amd.com/
> Signed-off-by: Omokefe Emmanuel Onanaroghene <emmaonana18@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/include/cgs_common.h | 60 +++++++-----------------
> 1 file changed, 18 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/include/cgs_common.h b/drivers/gpu/drm/amd/include/cgs_common.h
> index f40b6a03fe63..1750401c7d08 100644
> --- a/drivers/gpu/drm/amd/include/cgs_common.h
> +++ b/drivers/gpu/drm/amd/include/cgs_common.h
> @@ -80,43 +80,6 @@ struct cgs_firmware_info {
>
> typedef unsigned long cgs_handle_t;
>
> -/**
> - * cgs_read_register() - Read an MMIO register
> - * @cgs_device: opaque device handle
> - * @offset: register offset
> - *
> - * Return: register value
> - */
> -typedef uint32_t (*cgs_read_register_t)(struct cgs_device *cgs_device, unsigned offset);
> -
> -/**
> - * cgs_write_register() - Write an MMIO register
> - * @cgs_device: opaque device handle
> - * @offset: register offset
> - * @value: register value
> - */
> -typedef void (*cgs_write_register_t)(struct cgs_device *cgs_device, unsigned offset,
> - uint32_t value);
> -
> -/**
> - * cgs_read_ind_register() - Read an indirect register
> - * @cgs_device: opaque device handle
> - * @offset: register offset
> - *
> - * Return: register value
> - */
> -typedef uint32_t (*cgs_read_ind_register_t)(struct cgs_device *cgs_device, enum cgs_ind_reg space,
> - unsigned index);
> -
> -/**
> - * cgs_write_ind_register() - Write an indirect register
> - * @cgs_device: opaque device handle
> - * @offset: register offset
> - * @value: register value
> - */
> -typedef void (*cgs_write_ind_register_t)(struct cgs_device *cgs_device, enum cgs_ind_reg space,
> - unsigned index, uint32_t value);
> -
> #define CGS_REG_FIELD_SHIFT(reg, field) reg##__##field##__SHIFT
> #define CGS_REG_FIELD_MASK(reg, field) reg##__##field##_MASK
>
> @@ -137,14 +100,27 @@ typedef int (*cgs_get_firmware_info)(struct cgs_device *cgs_device,
> enum cgs_ucode_id type,
> struct cgs_firmware_info *info);
>
> +/**
> + * struct cgs_ops - Common Graphics Services operations
> + * @read_register: read register value
> + * @write_register: write register value
> + * @read_ind_register: read indirect register value
> + * @write_ind_register: write indirect register value
> + * @get_firmware_info: get firmware information
> + */
> struct cgs_ops {
> /* MMIO access */
> - cgs_read_register_t read_register;
> - cgs_write_register_t write_register;
> - cgs_read_ind_register_t read_ind_register;
> - cgs_write_ind_register_t write_ind_register;
> + uint32_t (*read_register)(struct cgs_device *cgs_device, unsigned int offset);
> + void (*write_register)(struct cgs_device *cgs_device, unsigned int offset,
> + uint32_t value);
> + uint32_t (*read_ind_register)(struct cgs_device *cgs_device, enum cgs_ind_reg space,
> + unsigned int index);
> + void (*write_ind_register)(struct cgs_device *cgs_device, enum cgs_ind_reg space,
> + unsigned int index, uint32_t value);
> /* Firmware Info */
> - cgs_get_firmware_info get_firmware_info;
> + int (*get_firmware_info)(struct cgs_device *cgs_device,
> + enum cgs_ucode_id type,
> + struct cgs_firmware_info *info);
> };
>
> struct cgs_os_ops; /* To be define in OS-specific CGS header */
> --
> 2.43.0
>
prev parent reply other threads:[~2026-10-20 7:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 2:17 [PATCH] drm/amd/display: fix kernel-doc warnings for cgs register typedefs Omokefe Emmanuel Onanaroghene
2026-10-02 11:38 ` Christian König
2026-10-02 20:46 ` Omokefe Emmanuel Onanaroghene
2026-10-17 13:00 ` [PATCH v2] drm/amd/display: remove unused cgs register accessor typedefs Omokefe Emmanuel Onanaroghene
2026-10-19 7:54 ` Arnaud Bonnet
2026-10-19 16:35 ` [PATCH v3] " Omokefe Emmanuel Onanaroghene
2026-10-20 7:02 ` Christian König [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=367a13c8-1c18-4a79-a82f-12bb8430fa99@amd.com \
--to=christian.koenig@amd.com \
--cc=abo@medichon.fr \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ast@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=emmaonana18@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=simona@ffwll.ch \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®