[v3,11/41] libipa: fc_queue: Rename template argument to FC
diff mbox series

Message ID 20260914140309.3354666-12-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • rkisp1: pipeline rework for PFC
Related show

Commit Message

Stefan Klug Sept. 14, 2026, 2:02 p.m. UTC
The FCQueue has a template argument called FrameContext which is easily
confused with the class FrameContext defined in the same file.

Reduce that confusion by renaming the template argument to FC.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

---

Changes in v2:
- Collected tag
---
 src/ipa/libipa/fc_queue.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Barnabás Pőcze Sept. 21, 2026, 1:18 p.m. UTC | #1
2026. 09. 14. 16:02 keltezéssel, Stefan Klug írta:
> The FCQueue has a template argument called FrameContext which is easily
> confused with the class FrameContext defined in the same file.
> 
> Reduce that confusion by renaming the template argument to FC.
> 
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
> 
> ---
> 
> Changes in v2:
> - Collected tag
> ---
>   src/ipa/libipa/fc_queue.h | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/src/ipa/libipa/fc_queue.h b/src/ipa/libipa/fc_queue.h
> index a1d136521107..1f4f84c27fbc 100644
> --- a/src/ipa/libipa/fc_queue.h
> +++ b/src/ipa/libipa/fc_queue.h
> @@ -28,7 +28,7 @@ private:
>   	bool initialised = false;
>   };
>   
> -template<typename FrameContext>
> +template<typename FC>

My preference would be `T` since that is already used in the `friend`
declaration above, and it is generally used to denote the "value type"
of containers. In any case, it doesn't matter much.

Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>


>   class FCQueue
>   {
>   public:
> @@ -39,15 +39,15 @@ public:
>   
>   	void clear()
>   	{
> -		for (FrameContext &ctx : contexts_) {
> +		for (FC &ctx : contexts_) {
>   			ctx.initialised = false;
>   			ctx.frame = 0;
>   		}
>   	}
>   
> -	FrameContext &alloc(const uint32_t frame)
> +	FC &alloc(const uint32_t frame)
>   	{
> -		FrameContext &frameContext = contexts_[frame % contexts_.size()];
> +		FC &frameContext = contexts_[frame % contexts_.size()];
>   
>   		/*
>   		 * Do not re-initialise if a get() call has already fetched this
> @@ -69,9 +69,9 @@ public:
>   		return frameContext;
>   	}
>   
> -	FrameContext &get(uint32_t frame)
> +	FC &get(uint32_t frame)
>   	{
> -		FrameContext &frameContext = contexts_[frame % contexts_.size()];
> +		FC &frameContext = contexts_[frame % contexts_.size()];
>   
>   		/*
>   		 * If the IPA algorithms try to access a frame context slot which
> @@ -122,14 +122,14 @@ public:
>   	}
>   
>   private:
> -	void init(FrameContext &frameContext, const uint32_t frame)
> +	void init(FC &frameContext, const uint32_t frame)
>   	{
>   		frameContext = {};
>   		frameContext.frame = frame;
>   		frameContext.initialised = true;
>   	}
>   
> -	std::vector<FrameContext> contexts_;
> +	std::vector<FC> contexts_;
>   };
>   
>   } /* namespace ipa */

Patch
diff mbox series

diff --git a/src/ipa/libipa/fc_queue.h b/src/ipa/libipa/fc_queue.h
index a1d136521107..1f4f84c27fbc 100644
--- a/src/ipa/libipa/fc_queue.h
+++ b/src/ipa/libipa/fc_queue.h
@@ -28,7 +28,7 @@  private:
 	bool initialised = false;
 };
 
-template<typename FrameContext>
+template<typename FC>
 class FCQueue
 {
 public:
@@ -39,15 +39,15 @@  public:
 
 	void clear()
 	{
-		for (FrameContext &ctx : contexts_) {
+		for (FC &ctx : contexts_) {
 			ctx.initialised = false;
 			ctx.frame = 0;
 		}
 	}
 
-	FrameContext &alloc(const uint32_t frame)
+	FC &alloc(const uint32_t frame)
 	{
-		FrameContext &frameContext = contexts_[frame % contexts_.size()];
+		FC &frameContext = contexts_[frame % contexts_.size()];
 
 		/*
 		 * Do not re-initialise if a get() call has already fetched this
@@ -69,9 +69,9 @@  public:
 		return frameContext;
 	}
 
-	FrameContext &get(uint32_t frame)
+	FC &get(uint32_t frame)
 	{
-		FrameContext &frameContext = contexts_[frame % contexts_.size()];
+		FC &frameContext = contexts_[frame % contexts_.size()];
 
 		/*
 		 * If the IPA algorithms try to access a frame context slot which
@@ -122,14 +122,14 @@  public:
 	}
 
 private:
-	void init(FrameContext &frameContext, const uint32_t frame)
+	void init(FC &frameContext, const uint32_t frame)
 	{
 		frameContext = {};
 		frameContext.frame = frame;
 		frameContext.initialised = true;
 	}
 
-	std::vector<FrameContext> contexts_;
+	std::vector<FC> contexts_;
 };
 
 } /* namespace ipa */