All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Minu Jin <s9430939@naver.com>
Cc: ovidiu.panait.oss@gmail.com, gshahrouzi@gmail.com,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	lkp@intel.com
Subject: Re: [PATCH v2 1/2] staging: axis-fifo: introduce helper functions for register access
Date: Thu, 15 Jan 2026 12:24:00 +0100	[thread overview]
Message-ID: <2026011507-sierra-armhole-95be@gregkh> (raw)
In-Reply-To: <20260115022509.3038062-1-s9430939@naver.com>

On Thu, Jan 15, 2026 at 11:25:08AM +0900, Minu Jin wrote:
> This patch introduces axis_fifo_read_reg(), axis_fifo_write_reg()
> to wrap raw ioread32, iowrite32 calls. Using these helper functions
> improves code readability and provides a cleaner abstraction for
> hardware register access.

Not really.  Normally wrapper functions are not a good idea, why are
they needed here?  What is asking for this change?

> All existing single register I/O calls updated to use these
> new helpers. This refactoring also ensures a consistent access
> pattern and makes future maintenance easier.
> 
> Signed-off-by: Minu Jin <s9430939@naver.com>
> ---
> v2: No changes.
> 
>  drivers/staging/axis-fifo/axis-fifo.c | 45 ++++++++++++++++-----------
>  1 file changed, 27 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
> index 509d620d6ce7..525156583c4a 100644
> --- a/drivers/staging/axis-fifo/axis-fifo.c
> +++ b/drivers/staging/axis-fifo/axis-fifo.c
> @@ -145,16 +145,26 @@ struct axis_fifo_debug_reg {
>   * ----------------------------
>   */
>  
> +static inline u32 axis_fifo_read_reg(struct axis_fifo *fifo, int offset)
> +{
> +	return ioread32(fifo->base_addr + offset);
> +}
> +
> +static inline void axis_fifo_write_reg(struct axis_fifo *fifo, int offset, u32 val)
> +{
> +	iowrite32(val, fifo->base_addr + offset);
> +}
> +
>  static void reset_ip_core(struct axis_fifo *fifo)
>  {
> -	iowrite32(XLLF_SRR_RESET_MASK, fifo->base_addr + XLLF_SRR_OFFSET);
> -	iowrite32(XLLF_TDFR_RESET_MASK, fifo->base_addr + XLLF_TDFR_OFFSET);
> -	iowrite32(XLLF_RDFR_RESET_MASK, fifo->base_addr + XLLF_RDFR_OFFSET);
> -	iowrite32(XLLF_INT_TC_MASK | XLLF_INT_RC_MASK | XLLF_INT_RPURE_MASK |
> +	axis_fifo_write_reg(fifo, XLLF_SRR_OFFSET, XLLF_SRR_RESET_MASK);
> +	axis_fifo_write_reg(fifo, XLLF_TDFR_OFFSET, XLLF_TDFR_RESET_MASK);
> +	axis_fifo_write_reg(fifo, XLLF_RDFR_OFFSET, XLLF_RDFR_RESET_MASK);
> +	axis_fifo_write_reg(fifo, XLLF_IER_OFFSET, XLLF_INT_TC_MASK |
> +			XLLF_INT_RC_MASK | XLLF_INT_RPURE_MASK |
>  		  XLLF_INT_RPORE_MASK | XLLF_INT_RPUE_MASK |

Odd indentation :(

I don't really see the need for this change, sorry.  When reading code,
it's much simpler to see iowrite32() and know what is happening instead
of having to go look up axis_fifo_write_reg() and determine that "hey,
that's just a wrapper for iowrite32()".

thanks,

greg k-h

  parent reply	other threads:[~2026-01-15 11:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15  2:25 [PATCH v2 1/2] staging: axis-fifo: introduce helper functions for register access Minu Jin
2026-01-15  2:25 ` [PATCH v2 2/2] staging: axis-fifo: Use bulk I/O accessors for data transfers Minu Jin
2026-01-15 11:29   ` Greg KH
2026-01-15 11:30   ` Greg KH
2026-01-15 11:24 ` Greg KH [this message]
2026-01-15 11:30 ` [PATCH v2 1/2] staging: axis-fifo: introduce helper functions for register access Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2026-01-15 14:19 Minu Jin
2026-01-14 13:23 Minu Jin
2026-01-14 15:12 ` Greg KH

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=2026011507-sierra-armhole-95be@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=gshahrouzi@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=lkp@intel.com \
    --cc=ovidiu.panait.oss@gmail.com \
    --cc=s9430939@naver.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.