diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-07-26 02:36:38 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-07-28 13:47:50 +0300 |
commit | 735f0ffeaac736f91c35774e575b1280ba868d69 (patch) | |
tree | cce1f93a65029a6faed34d8a7993b5ecae175577 /src/ipa/raspberrypi/controller/rpi/ccm.cpp | |
parent | 0821497ddd70a748e4758ecac3536fb73ed0c81c (diff) |
ipa: raspberrypi: Replace Fatal log by error propagation
Replace the Fatal log messages that cause an abort during tuning data
read with Error messages and proper error propagation to the caller.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: Naushir Patuck <naush@raspberrypi.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/ccm.cpp')
-rw-r--r-- | src/ipa/raspberrypi/controller/rpi/ccm.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/ccm.cpp b/src/ipa/raspberrypi/controller/rpi/ccm.cpp index f0110d38..9588e94a 100644 --- a/src/ipa/raspberrypi/controller/rpi/ccm.cpp +++ b/src/ipa/raspberrypi/controller/rpi/ccm.cpp @@ -44,12 +44,16 @@ int Matrix::read(boost::property_tree::ptree const ¶ms) double *ptr = (double *)m; int n = 0; for (auto it = params.begin(); it != params.end(); it++) { - if (n++ == 9) - LOG(RPiCcm, Fatal) << "Ccm: too many values in CCM"; + if (n++ == 9) { + LOG(RPiCcm, Error) << "Too many values in CCM"; + return -EINVAL; + } *ptr++ = it->second.get_value<double>(); } - if (n < 9) - LOG(RPiCcm, Fatal) << "Ccm: too few values in CCM"; + if (n < 9) { + LOG(RPiCcm, Error) << "Too few values in CCM"; + return -EINVAL; + } return 0; } @@ -78,13 +82,17 @@ int Ccm::read(boost::property_tree::ptree const ¶ms) if (ret) return ret; if (!config_.ccms.empty() && - ctCcm.ct <= config_.ccms.back().ct) - LOG(RPiCcm, Fatal) << "Ccm: CCM not in increasing colour temperature order"; + ctCcm.ct <= config_.ccms.back().ct) { + LOG(RPiCcm, Error) << "CCM not in increasing colour temperature order"; + return -EINVAL; + } config_.ccms.push_back(std::move(ctCcm)); } - if (config_.ccms.empty()) - LOG(RPiCcm, Fatal) << "Ccm: no CCMs specified"; + if (config_.ccms.empty()) { + LOG(RPiCcm, Error) << "No CCMs specified"; + return -EINVAL; + } return 0; } |