[v5,06/22] ipa: libipa: gamma: Static assert lookup node count
diff mbox series

Message ID 20261116174919.1056403-7-barnabas.pocze@ideasonboard.com
State Superseded
Headers show
Series
  • libcamera: rcar-gen4 + rpp-x1
Related show

Commit Message

Barnabás Pőcze Nov. 16, 2026, 5:49 p.m. UTC
Require at least 2, which is the minimum necessary for
the algorithm to function at all.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/ipa/libipa/gamma.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jacopo Mondi Nov. 17, 2026, 8:02 a.m. UTC | #1
On Mon, Nov 16, 2026 at 06:49:02PM +0100, Barnabás Pőcze wrote:
> Require at least 2, which is the minimum necessary for
> the algorithm to function at all.
>
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

> ---
>  src/ipa/libipa/gamma.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/ipa/libipa/gamma.h b/src/ipa/libipa/gamma.h
> index 9954f94ba2..e5ac3f96f5 100644
> --- a/src/ipa/libipa/gamma.h
> +++ b/src/ipa/libipa/gamma.h
> @@ -63,6 +63,8 @@ protected:
>  template<unsigned int NLutNodes, typename UQ>
>  class GammaAlgorithm : public GammaAlgorithmBase
>  {
> +	static_assert(NLutNodes >= 2);
> +
>  public:
>  	GammaAlgorithm()
>  		: GammaAlgorithmBase(NLutNodes)
> --
> 2.56.1
>

Patch
diff mbox series

diff --git a/src/ipa/libipa/gamma.h b/src/ipa/libipa/gamma.h
index 9954f94ba2..e5ac3f96f5 100644
--- a/src/ipa/libipa/gamma.h
+++ b/src/ipa/libipa/gamma.h
@@ -63,6 +63,8 @@  protected:
 template<unsigned int NLutNodes, typename UQ>
 class GammaAlgorithm : public GammaAlgorithmBase
 {
+	static_assert(NLutNodes >= 2);
+
 public:
 	GammaAlgorithm()
 		: GammaAlgorithmBase(NLutNodes)