Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1710051pxb; Wed, 9 Feb 2022 02:49:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLie4ReRIfPWvH/JoOE8/O+mHZVPtr8OM51qWJst1q60QYWOrIpRgU/Hrg0SnwXto2f+HA X-Received: by 2002:a17:902:db0e:: with SMTP id m14mr1502062plx.65.1644403787805; Wed, 09 Feb 2022 02:49:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644403787; cv=none; d=google.com; s=arc-20160816; b=aB8Wvu/ECxKDO2VjiN2S4A2udewzsIb0pPiKLd+C6kASEmws4oxLJ7o4TYmW8ET99L t2nlSFSftXtWWjazT12ANBXponkV8lJd29rqkhcv+D60BO9yX7DELqXNM9EmG34KLHFo hVNQkKZK2NePDXYQ4TpY4Hxxt8OztKg0laYcdEkT6pz0J1Z6JyeQZR8eM5tqDDQF2tlU N6jOQkYX5+WR0gTaduYl+4qME7v4z+BrypDSvgGTIit8TfGeVX+Ogu5HSPrLt/cK6WRV XWyTaiJ8y7Bgmf8iXeDXZaDe35kOweNcrBZakxVRkjG4pqrffHWb9gRnvV5OerTRrFpG 2+dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ddNKQeBNsufwtCR82T3hW0VvpqNHVS9IOC40mmH+H4Y=; b=MFxwMOohpGNbvvY1FBr0NRl8Q53ra/P80XvDRpXrpoxZsLj2AlZRhyejv329zpTL5U OzGZA85RHhk9JWUIZJt86FDG4K/apXc3LZ3xevjNFQKUNesH6cfzfMA6unCiiDIVkJbB HXxrb9iyo+eEsMq4O/zpySJ5Z1UFAudzpU8PNyJOX3pKmGzNCs/MQl/uqs1iHm4ZGAWf f2qMq5LSVS+jhzCLpGgS5MISUQ/Oiyqgsob4KBxFJqtcDKuj4IQZa/lQtRoyY0ld7quW qElAO9sKOpk+UH//8h+9KwxfWtzJdwADn0RAZyN++3CfsXdRloD8FVWzUJRV7rAK0BBp qaqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=r7xz+kjg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d123si7394031pgc.563.2022.02.09.02.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 02:49:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=r7xz+kjg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7617AE0B7B65; Wed, 9 Feb 2022 01:27:03 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381620AbiBHQXd (ORCPT + 99 others); Tue, 8 Feb 2022 11:23:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352165AbiBHQXc (ORCPT ); Tue, 8 Feb 2022 11:23:32 -0500 X-Greylist: delayed 2318 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 08 Feb 2022 08:23:31 PST Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 509BAC061576 for ; Tue, 8 Feb 2022 08:23:30 -0800 (PST) Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 218AXaZg001203; Tue, 8 Feb 2022 16:44:19 +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=ddNKQeBNsufwtCR82T3hW0VvpqNHVS9IOC40mmH+H4Y=; b=r7xz+kjguAgrfwFsWKvHgj8PszyLfubCiP0Sm9Ix80tW1MFjXbvTFgXLqOTb7v6CwgdB oCSg34AYk0aNVKnfP3wIlIM/vbiYxBTIcgevTazRr8y0P7jh7PskiqSjKQF6l8KlR0Ql kxt9VIzRQQ7jN3sKzPe7AUgjqcslVHx5lRerGl5Pxj8YS61QlE242zVsdyTSOss2myJT dtgjyEKvMhFwkjXAU1wgO9oVMLqUNPJ+trprw16r+NFf9dMrnoRu46SDsNsYIwQrXTMh c3gAdRYfYxom5aFLtg00gc4BeWUM9ZXD9CU3X82sAI1lDAI4UVzjr9PJTwK40GKW0vQo +g== 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 3e37nk5n3r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Feb 2022 16:44:19 +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 E317F10002A; Tue, 8 Feb 2022 16:44:17 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id D584E221778; Tue, 8 Feb 2022 16:44:17 +0100 (CET) Received: from [10.129.7.146] (10.75.127.51) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Tue, 8 Feb 2022 16:44:17 +0100 Message-ID: Date: Tue, 8 Feb 2022 16:44:16 +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] drm/stm: Avoid using val uninitialized in ltdc_set_ycbcr_config() Content-Language: en-US To: Nathan Chancellor , Philippe Cornu , Benjamin Gaignard CC: Nick Desaulniers , , , , , References: <20220207165304.1046867-1-nathan@kernel.org> From: yannick Fertre In-Reply-To: <20220207165304.1046867-1-nathan@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) 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.62.513 definitions=2022-02-08_05,2022-02-07_02,2021-12-02_01 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nathan, Thenks for the patch. Acked-by: Yannick Fertre Best regards On 2/7/22 17:53, 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 > Signed-off-by: Nathan Chancellor > --- > 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..447ddde1786c 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_err(plane->dev, "Unsupported pixel format: %u\n", drm_pix_fmt); > + return; > } > > /* Enable limited range */ > > base-commit: 542898c5aa5c6a3179dffb1d1606884a63f75fed