From patchwork Tue May 2 17:55:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 18582 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 446F1BD16B for ; Tue, 2 May 2023 17:56:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 89AB3627DC; Tue, 2 May 2023 19:56:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1683050170; bh=04H/DXKI5LlhmPajHoyUUnxN3EAtSN4UWhA3FDBCHXM=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=rHF9eVAy3fxMP3IYpU6jang9wf/7TeotkIXi+hgkDq1W4U6qOKadgPao59ZcfJXOA e8udKvpf9/lU2U5/w6PztBsCcJCo9PDsm147GA1h3yBtdLbNQ933N4h4ZGApzRwjx/ 7nmQ7tXoGD9Gsg4eFjK6hz6mk1GZs9iSld5PeBBWMka1vY+3NW4AJRM8IiGS+nDUJZ 3sNMoDRxRHno2TCbmAE6iFL2ErKi6B0rwVeOorsCVeDu+6GhnSfozAGTkFB5n7usFT 9LhQkxrCqQR+F1UBoEDh8pbO/rkixNzL63ZC3SpJ1Jjl1Q+PksZR8fYSbUBz9kJ5fP v2CwUfQJ//njQ== Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2D30860538 for ; Tue, 2 May 2023 19:56:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=protonmail.com header.i=@protonmail.com header.b="AA31HTur"; dkim-atps=neutral Date: Tue, 02 May 2023 17:55:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1683050168; x=1683309368; bh=04H/DXKI5LlhmPajHoyUUnxN3EAtSN4UWhA3FDBCHXM=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=AA31HTur5N7HvN13cvrs/PiO3I9Bp9IDk8FdJD1ZLZz2yix75+97zEkuEkVqp26fX RiJ6B8FrlnCo1ouC4j9Tu86xaJpqQtTbgNIdbMKIdFNd/HbFCxpGQSN+fM3bmh3FO0 HarE/tly5hIeeS2XHEB7a47NyPl/GZXODdiIRqRwmg4Za8SZQluxyyXCoYvj1azeVE cHodz/hrEs8eODtKI31u0jpB3nI64g08b9ukWbb5uIMC/s+HijFnjXkSd0/+Y4VIJY A/Q5tZCJBfn3W3seAaxOQrvCuVz0xHMriDHtkJ3aDqAHm86EjfosSdbyAkeW1x7K41 gEw/RQwAvMtOQ== To: libcamera-devel@lists.libcamera.org Message-ID: <20230502175551.70018-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1] qcam: Remove redundant check 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: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze_via_libcamera-devel?= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Reply-To: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The switch statement checks `roles.size()` with cases for 1 and 2, so in the `default` branch, `role.size() > 2`, i.e. it is always different from 1, so the check is unnecessary. Signed-off-by: Barnabás Pőcze Reviewed-by: Jacopo Mondi Reviewed-by: Umang Jain --- src/apps/qcam/main_window.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.40.1 diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp index fb2db4aa..680668df 100644 --- a/src/apps/qcam/main_window.cpp +++ b/src/apps/qcam/main_window.cpp @@ -381,11 +381,8 @@ int MainWindow::startCapture() } break; default: - if (roles.size() != 1) { - qWarning() << "Unsupported stream configuration"; - return -EINVAL; - } - break; + qWarning() << "Unsupported stream configuration"; + return -EINVAL; } /* Configure the camera. */