From patchwork Sun Mar 1 16:02:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2950 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E539D60429 for ; Sun, 1 Mar 2020 17:03:22 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 50B0154A for ; Sun, 1 Mar 2020 17:03:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583078602; bh=SA98HRbEPrexqGYE3h5QRWjoAfw0BtpNUoWgEpsvlSQ=; h=From:To:Subject:Date:From; b=ALgXW73woRnPERJKnYq44wwz8htWv5YOb1HBjBPxFLTMt8mBQT9w7sZbXTzmXxOeh BmveGdd5j9Mlw0JCgZ6DQJJs3MakRYL0grg5zbEEs3w/LUflHC63pgdyM5ASj/SIrh Dliglv//GU+BBBBVjhLY+N0exxic82ZWiMD/GHS8= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sun, 1 Mar 2020 18:02:54 +0200 Message-Id: <20200301160254.4548-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: control_serializer: Use explicit ControlTypeNone case 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-List-Received-Date: Sun, 01 Mar 2020 16:03:23 -0000 Replace the default case with an explicit ControlTypeNone case in ControlSerializer::load() to catch ommissions when adding new control types. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/control_serializer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp index 5537c5466025..e78fca88cfea 100644 --- a/src/libcamera/control_serializer.cpp +++ b/src/libcamera/control_serializer.cpp @@ -361,7 +361,7 @@ ControlValue ControlSerializer::load(ControlType type, return ControlValue(value); } - default: + case ControlTypeNone: return ControlValue(); } }