[v1,05/12] ipa: rkisp1: lsc: Rename res to ret
diff mbox series

Message ID 20251014075252.2876485-6-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • Add resampling support for polynomial LSC data
Related show

Commit Message

Stefan Klug Oct. 14, 2025, 7:52 a.m. UTC
Rename res to ret as that is used in libcamera for return codes.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/ipa/rkisp1/algorithms/lsc.cpp | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

Barnabás Pőcze Oct. 24, 2025, 4:11 p.m. UTC | #1
2025. 10. 14. 9:52 keltezéssel, Stefan Klug írta:
> Rename res to ret as that is used in libcamera for return codes.
> 
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> ---
>   src/ipa/rkisp1/algorithms/lsc.cpp | 13 +++++++------
>   1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
> index bb58386ae646..e4938dbd657c 100644
> --- a/src/ipa/rkisp1/algorithms/lsc.cpp
> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp
> @@ -320,28 +320,29 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,
>   		return -EINVAL;
>   	}
>   
> +	int ret = 0;
>   	std::map<unsigned int, Components> lscData;
> -	int res = 0;
> +

I think I liked the previous order better.

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


>   	std::string type = tuningData["type"].get<std::string>("table");
>   	if (type == "table") {
>   		LOG(RkISP1Lsc, Debug) << "Loading tabular LSC data.";
>   		auto loader = LscTableLoader();
> -		res = loader.parseLscData(yamlSets, lscData);
> +		ret = loader.parseLscData(yamlSets, lscData);
>   	} else if (type == "polynomial") {
>   		LOG(RkISP1Lsc, Debug) << "Loading polynomial LSC data.";
>   		auto loader = LscPolynomialLoader(context.sensorInfo.activeAreaSize,
>   						  context.sensorInfo.analogCrop,
>   						  xSize_,
>   						  ySize_);
> -		res = loader.parseLscData(yamlSets, lscData);
> +		ret = loader.parseLscData(yamlSets, lscData);
>   	} else {
>   		LOG(RkISP1Lsc, Error) << "Unsupported LSC data type '"
>   				      << type << "'";
> -		res = -EINVAL;
> +		ret = -EINVAL;
>   	}
>   
> -	if (res)
> -		return res;
> +	if (ret)
> +		return ret;
>   
>   	sets_.setData(std::move(lscData));
>
Rui Wang Oct. 27, 2025, 9:01 p.m. UTC | #2
On 2025-10-14 03:52, Stefan Klug wrote:
> Rename res to ret as that is used in libcamera for return codes.
>
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> ---
>   src/ipa/rkisp1/algorithms/lsc.cpp | 13 +++++++------
>   1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
> index bb58386ae646..e4938dbd657c 100644
> --- a/src/ipa/rkisp1/algorithms/lsc.cpp
> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp
> @@ -320,28 +320,29 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,
>   		return -EINVAL;
>   	}
>   
> +	int ret = 0;
>   	std::map<unsigned int, Components> lscData;
> -	int res = 0;
> +
>   	std::string type = tuningData["type"].get<std::string>("table");
>   	if (type == "table") {
>   		LOG(RkISP1Lsc, Debug) << "Loading tabular LSC data.";
>   		auto loader = LscTableLoader();
> -		res = loader.parseLscData(yamlSets, lscData);
> +		ret = loader.parseLscData(yamlSets, lscData);
>   	} else if (type == "polynomial") {
>   		LOG(RkISP1Lsc, Debug) << "Loading polynomial LSC data.";
>   		auto loader = LscPolynomialLoader(context.sensorInfo.activeAreaSize,
>   						  context.sensorInfo.analogCrop,
>   						  xSize_,
>   						  ySize_);
> -		res = loader.parseLscData(yamlSets, lscData);
> +		ret = loader.parseLscData(yamlSets, lscData);
>   	} else {
>   		LOG(RkISP1Lsc, Error) << "Unsupported LSC data type '"
>   				      << type << "'";
> -		res = -EINVAL;
> +		ret = -EINVAL;
>   	}
>   
> -	if (res)
> -		return res;
> +	if (ret)
> +		return ret;
>   
>   	sets_.setData(std::move(lscData));
>   

Reviewed-by: Rui Wang <rui.wang@ideasonboard.com>

Reviewed-by: Rui Wang <rui.wang@ideasonboard.com>

Reviewed-by: Rui Wang <rui.wang@ideasonboard.com>

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
index bb58386ae646..e4938dbd657c 100644
--- a/src/ipa/rkisp1/algorithms/lsc.cpp
+++ b/src/ipa/rkisp1/algorithms/lsc.cpp
@@ -320,28 +320,29 @@  int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,
 		return -EINVAL;
 	}
 
+	int ret = 0;
 	std::map<unsigned int, Components> lscData;
-	int res = 0;
+
 	std::string type = tuningData["type"].get<std::string>("table");
 	if (type == "table") {
 		LOG(RkISP1Lsc, Debug) << "Loading tabular LSC data.";
 		auto loader = LscTableLoader();
-		res = loader.parseLscData(yamlSets, lscData);
+		ret = loader.parseLscData(yamlSets, lscData);
 	} else if (type == "polynomial") {
 		LOG(RkISP1Lsc, Debug) << "Loading polynomial LSC data.";
 		auto loader = LscPolynomialLoader(context.sensorInfo.activeAreaSize,
 						  context.sensorInfo.analogCrop,
 						  xSize_,
 						  ySize_);
-		res = loader.parseLscData(yamlSets, lscData);
+		ret = loader.parseLscData(yamlSets, lscData);
 	} else {
 		LOG(RkISP1Lsc, Error) << "Unsupported LSC data type '"
 				      << type << "'";
-		res = -EINVAL;
+		ret = -EINVAL;
 	}
 
-	if (res)
-		return res;
+	if (ret)
+		return ret;
 
 	sets_.setData(std::move(lscData));