From patchwork Tue Jul 19 14:45:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 16691 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id B62DFBE173 for ; Tue, 19 Jul 2022 14:45:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F41506048A; Tue, 19 Jul 2022 16:45:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1658241931; bh=k/zG/ljkSuOuSmG/20b4puyBsrVxrkK2j1CtpsZ/oVU=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=TcQU3YDOpbDotMEB3vbm1HUlxPlvHh8xu6fpY2pJ5Eu4Zc1uwOhfAL1fjckFTGSO3 S3cEvmchYAgOb8Gt6TW4p2Vw1aRpnhxVH+9/cX4gUgaq63ygdIgX1x4PPq3+KZnv03 6tqtvAontpBBhWbPastqAP6o8N81RETjndO2aavogTdSxB7+vRGkYJXOYHlQx3/8SB dvbOkBgJlC9AbbTp/P/jfeORv7f4XQ1alyAN1xccrzGQHPXKK0es13EtxtNAyomii6 5ABWtxsNcRDA3jii8993qK27n+wBnj4Gx5TLpPrJoa72NRur+EwGiWcOd1Xe4dBOPH tfTVl4LsnMF4g== Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8E396603F4 for ; Tue, 19 Jul 2022 16:45:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="kRzlVY8J"; dkim-atps=neutral Received: by mail-wr1-x430.google.com with SMTP id z13so2370567wro.13 for ; Tue, 19 Jul 2022 07:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rNY/5LexuX+odnFz4tAEPDs5Ksd92Koi3QfHFr1/7PU=; b=kRzlVY8Jv4wQMzVOde4OKbM14Ul7o85c9GBo/QMg5CRcj+XovV8Lhg181q2rrIdvOH tF66IXfTI3XsYKPyUna7quUYEAPN5wYxuGGnZPHktYg+jRaqeCyycyqY8wgm/uFt+dcW CwL3k7/eOa2HtrjCUzNWTPGuyMToqEH7VVy89egSLsf04Hg2EgvaBEnS18Rw9Y5fkkSR zDWe/oJf3PuwIKvBiHoG49mwglFw0WXFguv/RyIdaKMROiMsAoGL9uPKeOvxEd9/7R1l sEySAFWEaHqbzHXeQfWrK1AMxnMV4MQ3+K2nXugKKPbfxrNP0pVe2LlwjL0ht4seKnbH Xd0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rNY/5LexuX+odnFz4tAEPDs5Ksd92Koi3QfHFr1/7PU=; b=G26HJP0LYnS/HrJ+V6fPua+MZHKXIZSojDznWCTbPRwBpjUbMNQKDnULCKX9rvYT+K KN2FuCdDlMasE9B1vwJzSIqoFZcmNwqRZrX2zsYNujDiQ63X1q4xZ9nRbFedeTX0zIV3 3MALUhmfuB1xWnI5CxtuMMQIrkaILxlGPRuCbqJfEUfOZOP2wL0v1OmrYF1Brf2PkHic ZNSGs+8E2Nt83vadgCiYD3ODigO11ZZaI+H318comIgAlhetBS1iqOD1GKplZBXmelP8 DircBwNIlaR72nG9tJCad2qEGATriINPQrK7Z3xKl0U2rY9X22iCKTzuwYtfHKJ0jafn Zpmw== X-Gm-Message-State: AJIora80kvEcaMUg1CWGtYMtuurdOTZccoY7nOgWLxKxiRjOh65OPTPg AWEYfxckFG3pJ0VW5wQ0hS641akQOFxLUg== X-Google-Smtp-Source: AGRyM1t/h4xfUbB9eQC/hb6U9wjnnHuSa/71O9fqrX8cDT6hd01ad7uZkh7H66D6fMJzKCXJojKiYQ== X-Received: by 2002:a5d:5903:0:b0:21d:6dd5:d9c3 with SMTP id v3-20020a5d5903000000b0021d6dd5d9c3mr26370414wrd.85.1658241928775; Tue, 19 Jul 2022 07:45:28 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id x5-20020a05600c21c500b003a3188bef63sm9374037wmj.11.2022.07.19.07.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 07:45:28 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Tue, 19 Jul 2022 15:45:17 +0100 Message-Id: <20220719144517.15898-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: controls: Suppress error message from ControlList::find() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Now that controls::get() returns a std::optional handle invalid controls, the error log message in ControlList::find() is unnecessary and likely invalid in the case when calling controls::get() on a missing control. Remove this error message. Fixes: 1c4d48018505 ("libcamera: controls: Use std::optional to handle invalid control values") Signed-off-by: Naushir Patuck --- src/libcamera/controls.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index 03ac6345247c..701a872185e3 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -1051,24 +1051,16 @@ void ControlList::set(unsigned int id, const ControlValue &value) const ControlValue *ControlList::find(unsigned int id) const { const auto iter = controls_.find(id); - if (iter == controls_.end()) { - LOG(Controls, Error) - << "Control " << utils::hex(id) << " not found"; - + if (iter == controls_.end()) return nullptr; - } return &iter->second; } ControlValue *ControlList::find(unsigned int id) { - if (validator_ && !validator_->validate(id)) { - LOG(Controls, Error) - << "Control " << utils::hex(id) - << " is not valid for " << validator_->name(); + if (validator_ && !validator_->validate(id)) return nullptr; - } return &controls_[id]; }