From patchwork Thu Dec 8 11:47:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13068330 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 923F0C63703 for ; Thu, 8 Dec 2022 11:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cUlTEulhzQHkeVC7LicgouEQ+PDojtc5Dlgv7Z6e39w=; b=LFhhpqT9L0S99t gii3bl8uJovmAbRWa/uDCes2QUHsZHP1Y9fEYOsaDBHfmu1NIuOKNsSMNF0o86Cyo70A57hyT0f1g AyP0D8A5pkOqIh1dr/tFZE/oJmSHWXkBkaAi4EB7E+FjZrnHvi/ZUyNTrZAHpbPj+vk86I02MEjky H9PGcQe7Qx+wQma0PKvQoYLXoySlRVE0AChRenuKvdLas6zz55tq80wzudJUt4YqSx6QKlOyULucA obbz18SI7bnGfoDA3bYIe9lBqqFyN2rULlWLd14dMus0oTc315sNqloEAh351jWAcjIfsv5NaQ6qG Mukly6u9CBaVDevsOo1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3FNx-00FpUB-0D; Thu, 08 Dec 2022 11:48:18 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3FNo-00FpKX-L8 for linux-arm-kernel@lists.infradead.org; Thu, 08 Dec 2022 11:48:10 +0000 Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 4523B24000F; Thu, 8 Dec 2022 11:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G6S8oJ3aFtNCcZoU3kaxCoOFZa8bIBnBoUJ/ngEwAfA=; b=dUWD1ZGv9IFpByixdjm7gJRgcw5SjjHfkd6ABN3i8v5wYathBEODJDb0Tms3YqwJUPLlRF tGP8LlqVTbFp4iykF4Cx9VkPdKLr3eSzR9Jy/plnGlEN1ZF0W883+/HEdPPWa+PmNMlujP D1i/wBPeZpKni3KK+1mPH1vKaX3Y9BfBtWLx+Xy7rfRqdTqwSaj9Mg3KM+OdC8F3LSnxYZ XzAiJGPOsVdL3GvomGO2wmIHvu9FoQqXwraQrx84Ez12QB1bythbGFxMQJwTdWfAj0TrSV N9NEpX40Ilc0J55PCC1PoOxkkWurcxbc+GCCqLdKTRGpa+iv4naZdnbnOFOYcQ== From: Paul Kocialkowski To: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Cc: Yong Deng , Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thomas Petazzoni , Hans Verkuil , Sakari Ailus Subject: [PATCH 3/9] media: sun6i-csi: bridge: Error out on invalid port to fix warning Date: Thu, 8 Dec 2022 12:47:36 +0100 Message-Id: <20221208114742.399461-4-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> References: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221208_034808_891847_7EE1ED10 X-CRM114-Status: GOOD ( 10.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The enabled variable is only set for a valid port and used later, which triggers an uninitialized use smatch warning. Explicitly error out in that case to fix the warning. Signed-off-by: Paul Kocialkowski --- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c index 88df3a73ebfa..4517c0346eef 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c @@ -663,7 +663,7 @@ sun6i_csi_bridge_notifier_bound(struct v4l2_async_notifier *notifier, enabled = !bridge->source_parallel.expected; break; default: - break; + return -EINVAL; } source->subdev = remote_subdev;