From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AF0C3922F for ; Wed, 7 Jun 2023 20:56:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2D9DC433D2; Wed, 7 Jun 2023 20:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1686171385; bh=Mcz5EktUwHLg0suZU3REpBB0SpTgb+SwjpLQnI/u118=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D3cbwqw07BpgdjCtwXaSd/uUp8hvXo+FJCRtjE3Z+STKwgDmO3kwOHxjJH1UKZBV1 xHEx8hqbLolBinncrVvQePq8jf8i9R47sBg9qFQphGCsAES+7JOT53Hd0fZTb7GYzF hRDNxfxEErr5ShIVqVoV5KWjl2tAzIzsAIXhqzxg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lyude Paul , Ilia Mirkin Subject: [PATCH 5.4 97/99] drm/edid: Fix uninitialized variable in drm_cvt_modes() Date: Wed, 7 Jun 2023 22:17:29 +0200 Message-ID: <20230607200903.289571140@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230607200900.195572674@linuxfoundation.org> References: <20230607200900.195572674@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Lyude Paul commit 991fcb77f490390bcad89fa67d95763c58cdc04c upstream. Noticed this when trying to compile with -Wall on a kernel fork. We potentially don't set width here, which causes the compiler to complain about width potentially being uninitialized in drm_cvt_modes(). So, let's fix that. Changes since v1: * Don't emit an error as this code isn't reachable, just mark it as such Changes since v2: * Remove now unused variable Fixes: 3f649ab728cd ("treewide: Remove uninitialized_var() usage") Signed-off-by: Lyude Paul Reviewed-by: Ilia Mirkin Link: https://patchwork.freedesktop.org/patch/msgid/20201105235703.1328115-1-lyude@redhat.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_edid.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2791,6 +2791,8 @@ static int drm_cvt_modes(struct drm_conn case 0x0c: width = height * 15 / 9; break; + default: + unreachable(); } for (j = 1; j < 5; j++) {