From mboxrd@z Thu Jan 1 00:00:00 1970 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 17C1BC4332F for ; Fri, 25 Feb 2022 13:23:15 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MRc0f892FOLOCxBydlEGZcjrBwdKUc3YdBVrmLFgyG8=; b=I1I8npMDTEnh0n QrjCR/UQKYNIgXjKHu0DnGA/PwanmPvLyWSsXCQ8Ugbuq5ep3l4Tq7s6LukIxsCkw6sQ6uF2R2WB2 eM7vX8muRr4D0t7ATHmP0ijAKFl3Vu4NHaTVTuV6kCmI6bhLQYMhe8edb+6VGojScFkgjEMbJOkv4 jCHJpvrQJ6fCj+ZpivMMtJrvRfNVCWLcmWA8ssgujgxnFYNYtjRIJIwrhRqooGzZhFsqamdZca0+h 7X6e5t/+Yp21QDb+SRqK6zhEfmN8nBZsis+NM8P425lfOi0La/jt4XeYSZhyCL5Yh6LfQc89uUw2n 73ar/Ep8zTAh35JpEFCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNaXR-005404-P2; Fri, 25 Feb 2022 13:21:38 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNaW0-0053K8-GR for linux-arm-kernel@lists.infradead.org; Fri, 25 Feb 2022 13:20:10 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 21PD7oji031571; Fri, 25 Feb 2022 14:19:52 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=LkW62k1kez4onNz5WnO7tO0QIWuCB9ldqXvRsV6nPqw=; b=SVostm1nI+zn46O/FSyoSL038Zksrwu7/d4jbLLajBAFOENbSLEy0Zw6sdZKfZw176h/ Nnhkow09gC+lg3WAIU8G9P6HQcm2JB/ODPSSlDAT6s3Tub1d7gZWUNZfLdQ7hRzlLY9w RSjv0jeFGgodwvwK9v3NxLcjmdSmSCOFSeQv63yqq+97kk9++aGrRb12Ygar49rNvbfq 38WsZRvfD3pajWcRtcVtCzoAS0UGTqbimhDyOGCOkhAQWxax4zGWhWVlC6xTwtKwc2wv CflTeGvXaGthztqES4z/YjJnrqgvcqKO8shiPN6OQx4IYUge35CHdiC1UH6UBYuQ3zi4 Kw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3eetrf25hn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Feb 2022 14:19:52 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4CDC010002A; Fri, 25 Feb 2022 14:19:51 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 3F423226FB7; Fri, 25 Feb 2022 14:19:51 +0100 (CET) Received: from [10.201.22.81] (10.75.127.47) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Fri, 25 Feb 2022 14:19:50 +0100 Message-ID: Date: Fri, 25 Feb 2022 14:19:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2] drm/stm: Avoid using val uninitialized in ltdc_set_ycbcr_config() Content-Language: en-US To: Nathan Chancellor , Yannick Fertre CC: Nick Desaulniers , , , , , , Raphael Gallais-Pou References: <20220222152045.484610-1-nathan@kernel.org> From: Philippe CORNU In-Reply-To: <20220222152045.484610-1-nathan@kernel.org> X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-02-25_07,2022-02-25_01,2022-02-23_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220225_052008_891434_99AF2805 X-CRM114-Status: GOOD ( 21.31 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2/22/22 16:20, Nathan Chancellor wrote: > Clang warns: > > drivers/gpu/drm/stm/ltdc.c:625:2: warning: variable 'val' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] > default: > ^~~~~~~ > drivers/gpu/drm/stm/ltdc.c:635:2: note: uninitialized use occurs here > val |= LxPCR_YCEN; > ^~~ > drivers/gpu/drm/stm/ltdc.c:600:9: note: initialize the variable 'val' to silence this warning > u32 val; > ^ > = 0 > 1 warning generated. > > Use a return instead of break in the default case to fix the warning. > Add an error message so that this return is not silent, which could hide > issues in the future. > > Fixes: 484e72d3146b ("drm/stm: ltdc: add support of ycbcr pixel formats") > Link: https://github.com/ClangBuiltLinux/linux/issues/1575 > Acked-by: Yannick Fertre > Reviewed-by: Nick Desaulniers > Reviewed-by: Raphael Gallais-Pou > Signed-off-by: Nathan Chancellor > --- > > v1 -> v2: https://lore.kernel.org/r/20220207165304.1046867-1-nathan@kernel.org/ > > * Use DRM_ERROR() instead of drm_err() (Philippe). Hi Nathan, Applied on drm-misc-next. Many thanks for your patch, Philippe :-) > > * Collect tags from v1, as nothing substantial has changed. > > drivers/gpu/drm/stm/ltdc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c > index 5eeb32c9c9ce..c9bc4ccb6d43 100644 > --- a/drivers/gpu/drm/stm/ltdc.c > +++ b/drivers/gpu/drm/stm/ltdc.c > @@ -624,7 +624,8 @@ static inline void ltdc_set_ycbcr_config(struct drm_plane *plane, u32 drm_pix_fm > break; > default: > /* RGB or not a YCbCr supported format */ > - break; > + DRM_ERROR("Unsupported pixel format: %u\n", drm_pix_fmt); > + return; > } > > /* Enable limited range */ > > base-commit: 542898c5aa5c6a3179dffb1d1606884a63f75fed _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel