From patchwork Mon May 31 17:43:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 12289829 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08880C47080 for ; Mon, 31 May 2021 17:45:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C3A6461108 for ; Mon, 31 May 2021 17:45:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3A6461108 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: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:In-Reply-To:References: List-Owner; bh=MgyziL8h+wDa1bZuxy3ncNBBTmLmPjH/EH7RLejFIf4=; b=3JsvQV6Ck1caQl MIR2+3SZYna4MVe0hNl1s2qfVHE5XdSo7LI9/76ANngt5ddSrP7GHpLlG5uQuxtNkjE4BmyMpe/3Q Uf3FU+1Wgemfgs1yc6PSqLmhqbCraJ/EQTVrXcwd7qyOzCbTM+B2KrlMbUcpJ0irKa+2Bst9mrrZB 0+BfiYArw79q76pxKNrLxMB7n/xGCGAnVJspbWDE4LgH89XIIVEmdyD1qqHwc862FCmFP4cFBByxb ZpnppyCOp4QATwozT6QHcpSCRQSwNYQlM64bEE/GNMfsBuv5bzPm5iimf7+nWjOMQdP4Qo++5KRL8 DvM/aWSaeh0Kom2DK26A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnlwZ-00D1Di-PR; Mon, 31 May 2021 17:43:15 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnlwV-00D1Cn-8M for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 17:43:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622482988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K8nNOkX4zuqczQHURLREmFQOVbuEo/yfo6wOnioYIqU=; b=JcNY20K58fO+OTVMxLzSy6Xq+Y1w+n0RMrxxBM+RDz9OxwbZ/El/htibNbuHmuupP3Mwss 1pQzwVz/jOF7TvXg0YNPLc3RStoLgKChrvNiKQzzPpLaf6o8HzhWi1AFYYD3ZEd+fKkMi7 WZYlzOPF2XwcVv8yHk8F26zq5Sh+U+I= Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-593-TSX7aeSmPauQNIRa2xGisQ-1; Mon, 31 May 2021 13:43:06 -0400 X-MC-Unique: TSX7aeSmPauQNIRa2xGisQ-1 Received: by mail-oi1-f200.google.com with SMTP id w15-20020acac60f0000b02901e5b6e8f60fso5605697oif.1 for ; Mon, 31 May 2021 10:43:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K8nNOkX4zuqczQHURLREmFQOVbuEo/yfo6wOnioYIqU=; b=Yp4hDYKIgUV7t0L4P4YBCBhfifc28KDItEx4WG7G8LMuCdYpurvzXf/ir2H7laC8nH 1b2zZIbd5cJCshw9n1J7dVNI6I6qHurOtfVYu2KE+k64NmYLp73wgKW7RePo0yP4Ygr8 hqC6DYBb1GRb3Y9Zn3gQy/UAVjjRdUjzZIJ5Cb3svigQHXPtPtE3dn2QVm7m1pRkarh9 cW8+aAqhNnuZDFcODPI2fPRdZNhwrh9QBfJPrCCPXKKfRmxGFBym1Z+MSd15k+m9s3KI LrI3KQGMriyP22UT6sas36gHvfS15JY7vTQxpBR2eCujHlZL8wmJN6GzHAjYYDZ4ptFa +9Uw== X-Gm-Message-State: AOAM531CD1nBEhZ9Yt/Uw7yRGMA6kB9gL7lc6wPB3uLnZ88EPFIaSCbH CmQW41hRNSWtqdilKwpHoCaxx4/4/Lm/sy3Ske+Czhggkgbx9nmVH6NFuoTj2hI/121yyafc2Is XebJGCIr8o9YEulrjV9K4TwrBDCxJ2+XOtdE= X-Received: by 2002:a05:6830:1d64:: with SMTP id l4mr17260147oti.95.1622482985552; Mon, 31 May 2021 10:43:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylhACZOWlRSSP56Xe+/shqCqK0nGlc+aQdIrngGYo9DVADhn8bqhxQrwJTGkiF1rvA1tn1sA== X-Received: by 2002:a05:6830:1d64:: with SMTP id l4mr17260135oti.95.1622482985395; Mon, 31 May 2021 10:43:05 -0700 (PDT) Received: from localhost.localdomain.com (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id i4sm2943902oih.13.2021.05.31.10.43.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 10:43:05 -0700 (PDT) From: trix@redhat.com To: rmfrfs@gmail.com, laurent.pinchart@ideasonboard.com, slongerbeam@gmail.com, p.zabel@pengutronix.de, mchehab@kernel.org, gregkh@linuxfoundation.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tom Rix Subject: [PATCH] media: imx: imx7_mipi_csis: convert some switch cases to the default Date: Mon, 31 May 2021 10:43:00 -0700 Message-Id: <20210531174300.2594109-1-trix@redhat.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=trix@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_104311_378795_4E233C59 X-CRM114-Status: GOOD ( 11.01 ) 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 From: Tom Rix Static analysis reports this false positive imx7-mipi-csis.c:1027:2: warning: 4th function call argument is an uninitialized value The variable 'align' is falsely reported as uninitialized. Even though all the cases are covered in the switch (csis_fmt->width % 8) { Because there is no default case, it is reported as uninialized. Improve the switch by converting the most numerous set of cases to the default and silence the false positive. Signed-off-by: Tom Rix Reviewed-by: Rui Miguel Silva Reviewed-by: Laurent Pinchart --- drivers/staging/media/imx/imx7-mipi-csis.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c index d573f3475d28..330f283030ec 100644 --- a/drivers/staging/media/imx/imx7-mipi-csis.c +++ b/drivers/staging/media/imx/imx7-mipi-csis.c @@ -1016,10 +1016,8 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *sd, case 6: align = 2; break; - case 1: - case 3: - case 5: - case 7: + default: + /* 1, 3, 5, 7 */ align = 3; break; }