Re: [PATCH v4 3/7] drm/xe/sysctrl: Make sysctrl_write_frame() void

Michal Wajdeczko <[email protected]>
Newsgroups org.freedesktop.lists.intel-xe
Message-ID <[email protected]>

On 8/20/2026 12:16 PM, Mallesh Koujalagi wrote:
> The function always returned 0, so the int return type is misleading.
> Convert to void and drop the error handling in the caller.
> 
> Signed-off-by: Mallesh Koujalagi <[email protected]>

Reviewed-by: Michal Wajdeczko <[email protected]>

> ---
>  drivers/gpu/drm/xe/xe_sysctrl_mailbox.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> index 3523651b467b..ac58571f2a43 100644
> --- a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> @@ -49,8 +49,8 @@ static int sysctrl_wait_bit_set(struct xe_sysctrl *sc, u32 bit_mask,
>  			     timeout_ms * 1000, NULL, false);
>  }
>  
> -static int sysctrl_write_frame(struct xe_sysctrl *sc, const void *frame,
> -			       size_t len)
> +static void sysctrl_write_frame(struct xe_sysctrl *sc, const void *frame,
> +				size_t len)
>  {
>  	static const struct xe_reg regs[] = {
>  		SYSCTRL_MB_DATA0, SYSCTRL_MB_DATA1, SYSCTRL_MB_DATA2, SYSCTRL_MB_DATA3
> @@ -66,8 +66,6 @@ static int sysctrl_write_frame(struct xe_sysctrl *sc, const void *frame,
>  
>  	for (i = 0; i < dw; i++)
>  		xe_mmio_write32(sc->mmio, regs[i], val[i]);
> -
> -	return 0;
>  }
>  
>  static int sysctrl_read_frame(struct xe_sysctrl *sc, void *frame,
> @@ -154,11 +152,7 @@ static int sysctrl_send_frames(struct xe_sysctrl *sc,
>  	for (frame = 0; frame < total_frames; frame++) {
>  		frame_size = min_t(size_t, cmd_size - bytes_sent, XE_SYSCTRL_MB_FRAME_SIZE);
>  
> -		if (sysctrl_write_frame(sc, mbox_cmd + bytes_sent, frame_size)) {
> -			xe_err(xe, "sysctrl: Failed to write frame %u\n", frame);
> -			sc->phase_bit = 0;
> -			return -EIO;
> -		}
> +		sysctrl_write_frame(sc, mbox_cmd + bytes_sent, frame_size);
>  
>  		ctrl_reg = SYSCTRL_MB_CTRL_RUN_BUSY |
>  			   REG_FIELD_PREP(SYSCTRL_FRAME_CURRENT_MASK, frame) |
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.