From patchwork Mon Jul 4 10:55:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12905678 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 3F1E0C433EF for ; Mon, 4 Jul 2022 16:24:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B53810E364; Mon, 4 Jul 2022 16:16:45 +0000 (UTC) Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by gabe.freedesktop.org (Postfix) with ESMTPS id 99A5F10E02D for ; Mon, 4 Jul 2022 10:56:15 +0000 (UTC) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2648f0lN018982; Mon, 4 Jul 2022 10:56:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2021-07-09; bh=5o8oYsiQIt7uK3ajLsYbYs98N9JZzHU7KjI5z8hHtCc=; b=wWS6clINKB1s6WjTLA2J0xIWHcTnVIue8pUE8rZUPEA5U47SaEM5dmXiu6rdXj6E5I+T PuMaGKNIRXxczXAoqLWUe7cbNFjhgCtKXvqplksJQWtdZ8ZqK4hekM/hnpUudtyKJzgO F5vz9DPvmPJ9Q8ffbh1dtf4bvolqSgLFPfrhQBNoL60UFx+al0sVC2/NGMF2CL4F+Cb4 fmTO6dXeLxwTUeFGGpy6N+Ebcpu92b8lB2ozFeEhlNUtK0jXxp0TbIeda08Vz8FEIkCB CkoBejHSVc1rzvR522hb4JqQceLocwC0xroYoqM0Vb4eLE+3RCEKAvhd0vcGfCV20I4a Fw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3h2dmsu5he-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Jul 2022 10:56:00 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 264AtAYZ016998; Mon, 4 Jul 2022 10:55:59 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2173.outbound.protection.outlook.com [104.47.57.173]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3h2cf1h1mw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Jul 2022 10:55:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=csv4sYzONKnrdKoDmZ6AYqyCHu2lXT/2HHq7dJ/zOayQQ8FwEDhB83CWxvJ7BGcaDkSmHXVrOKkIxHmzE65sf1+fqr7o5f3ADFf9Ie8KvjAOLoL6PrazPXgmNiDyfhLON2mH62TwR+f+hlU5rYe56DKY/+j38At7a/0FjSJjCLiccRGvIkpHeu9pn58NEAzD4ILY+LN7G7xTja8R8ytm54hLTZKfyKZS7IPYXg7uunYBpU/5QKI04fAGmPkGpCw3ITxioYh7meZzmyssaCjiiGFwX1Igfl5oausm9gmnpwB38JPYslW3NGr3SV1Vu6YgjoN6JfF6PVaR9oCnfBg6pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5o8oYsiQIt7uK3ajLsYbYs98N9JZzHU7KjI5z8hHtCc=; b=jl0xbZNW3Glu3p4ewRbID9z+6EGD2eoVaisTfHvzJ+7cYGBELs7XGuUaEtUwql7fZFSizCXu6e1S4jvcPYFR9ODSVZp1jR3fEvh3rNuSFXcBmnLloHk7a2SvhcWnGq6kGg+M/tDgjtroRdHjOLeP9rVJMXjncIGqVRlLniSIyqiuHfrE5maImIElD+0j3h6q+yk1liUz+LZBPGGlc8G+W706YuZ5hSKmUPYFimu/lKPDiCEwy3m3OyYCjmKzsXQ9RzAkuj2UDiw+yK7fSH0ns/IRclzs+C1BgljM/HMzpol2kdaJ6KuCyJa4PosnFUig0sk3kEQujiFyDs+m0qj1uw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5o8oYsiQIt7uK3ajLsYbYs98N9JZzHU7KjI5z8hHtCc=; b=aEbs1gUgPxDJUEcujHZeh/EZTi6I9wVCRUf0Wqq+zi2xbpUZNE6gC1QW6dKhIsYQ2ofGVgNvYQXf+dbHpc8PxU+2DhTHtq97RGo3CnUGmJRG1Jqfm+Icr+TzCel4+eftVDpQlskpSsVEZaHjY5I2hyNcxTcbkvBrKrvgsP2aVbk= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by DM6PR10MB3563.namprd10.prod.outlook.com (2603:10b6:5:154::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Mon, 4 Jul 2022 10:55:57 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5020:9b82:5917:40b]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5020:9b82:5917:40b%6]) with mapi id 15.20.5395.021; Mon, 4 Jul 2022 10:55:57 +0000 Date: Mon, 4 Jul 2022 13:55:40 +0300 From: Dan Carpenter To: Maarten Lankhorst , Boris Brezillon Subject: [PATCH v2] drm/bridge: Avoid uninitialized variable warning Message-ID: Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: ZR0P278CA0012.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:16::22) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fb756850-b75d-4fed-81d1-08da5dabc649 X-MS-TrafficTypeDiagnostic: DM6PR10MB3563:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2J8dYMmMaqPYy5VbT0TAVTE4dbf/+eeibATsyAoJtJw2WBnix36+lHYgNS6beaMTsNCsE6PGuYu/Nx+id2uILI+FTGj056whwcV3UgRz0oe8bJnSsY8nRnpQIxFnrz3BmM/3OmscbrC4VLTnu71jcERizjGPFD1hGQo1ycTadsDNH6rHzChAMCUvspZkEYGMHHq5na6IG5ketYNgg+GSZB8DXn1yBGeOVUrwgv5J8WkrDPFSKaNIfCo+MdmTmBmOcZcSHB0M/iInCh95u5elLqhmOkHdKkO0MhXKv9w1L3VPh2qtcTpMQ1kDbWSDPJA5Xy6sFd+UBSEwxWXq3sX+Q8ALlcSgd7DxmgzZagZ0jDBmz4Y7SyUllFOWEk/HaQbYKtmfqSZgvZ/UmK4YCCB/vUARfPe6JxR27ipsOV2dIDiS6UiNiGnMuenHwGwwEemvjMMJ1vb4YKI01i6Fsp+GHxi8OMg8OrJvIGPnjb/jEVaSp6RX3GGQKl7DRxWiSl9Rg/uQnRHT9HqI5Qjbb51JVenVA1f0dDhE67PCopT9j8LjwhZVXkvwpeUXonNdLqrvCaTDrDLtkKW6mQ+S4VkIE0Nx+m4He8mXp3OGXqLoleS6wpvvp8fX/a9H8qYdmnif52DusB3z263vwZNhLVXfC517uZ8oCb1KIJdQMV+HdCL+8SGvLfQvMyAIAssiIMgo+a817Y4K+j6tmBp1F/OPznay1CIuHvQM8xy9FTEyZBCwEiR2FwCdHnOxpfKguODg0S0OrkGymQKXyNo7xQhcjgfaCGADiGgNfSZRcXAq5O+f6UWKUFfTOHcx5S1Xq0KB X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1001MB2365.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(7916004)(346002)(366004)(376002)(136003)(396003)(39860400002)(110136005)(66556008)(478600001)(6486002)(38350700002)(86362001)(66946007)(6666004)(41300700001)(66476007)(26005)(9686003)(52116002)(186003)(54906003)(6506007)(38100700002)(4326008)(316002)(8676002)(33716001)(6512007)(2906002)(44832011)(5660300002)(8936002)(7416002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WplHoXY5dAsyEwbPy+Uoajpr2wNdfpen5dZv21KDu/Jqm8ScF1kz+g1NWMO4eMVbPkJxf47jW0iqL5qSzdMW54IcrjVfZXqnAbMzz6hGOeLzujFjdSiH1EtOQuNfATKf0Fk/pxpbtEahVTVRH79ri2uTDBLw3JPgSXmfUzzVsEw48IeWwgCb8vVkNAF6YobKurEPfzAUeZp1S/P68UEp68KcR65v5VdtOq57gQlymTlz1S/xnibMXu/+o2Qv/Refo6HY2XcKikX7q/jLgaNeCR/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F428bKMQZ4nOgKvoI9rShU1Ypg8km3sRZTONfkxpjA9kJcM3CBaokFHA1WxzeO1LVGwiJcN8c7Ya6rzlxkVj80rMNhrAcEpLMrdbB0ZbZ6cFQGE+INFqexhdqZbNNnZagMUDWVC5eiRrYBqSifgxn4kInqE2PRq10D7+MiSpIKYB5iO5JXwA4C1S92PB0RluOWn4/BFwmNZXHnx9XqJpt/wTJcoZbwUdofQjtwvoVyc7taRw6FTROut2dqWPiswYv9NzNcDwsa5trYA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb756850-b75d-4fed-81d1-08da5dabc649 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2022 10:55:57.6030 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HpIu/0tznUV9PTZghOb3UAsOcRk58RAQWh+lviTBaEVKDv0ILYJwpE0HpAP+AdMO0Sq5TjJFEI1lw3UqgqB61YW0LL6q1MS9Bd0GJ4IWFAA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB3563 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517, 18.0.883 definitions=2022-07-04_09:2022-06-28, 2022-07-04 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2207040047 X-Proofpoint-GUID: zbgy3Qxed9OK66Jog1jfQAruGnX8O6tq X-Proofpoint-ORIG-GUID: zbgy3Qxed9OK66Jog1jfQAruGnX8O6tq X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , Neil Armstrong , David Airlie , dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org, Jernej Skrabec Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This code works, but technically it uses "num_in_bus_fmts" before it has been initialized so it leads to static checker warnings and probably KMEMsan warnings at run time. Initialize the variable to zero to silence the warning. Fixes: f32df58acc68 ("drm/bridge: Add the necessary bits to support bus format negotiation") Signed-off-by: Dan Carpenter --- v2: initialize the variable instead, this keeps the original error codes. drivers/gpu/drm/drm_bridge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index e275b4ca344b..d4601201f31d 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -846,8 +846,8 @@ static int select_bus_fmt_recursive(struct drm_bridge *first_bridge, struct drm_connector_state *conn_state, u32 out_bus_fmt) { + unsigned int i, num_in_bus_fmts = 0; struct drm_bridge_state *cur_state; - unsigned int num_in_bus_fmts, i; struct drm_bridge *prev_bridge; u32 *in_bus_fmts; int ret; @@ -968,7 +968,7 @@ drm_atomic_bridge_chain_select_bus_fmts(struct drm_bridge *bridge, struct drm_connector *conn = conn_state->connector; struct drm_encoder *encoder = bridge->encoder; struct drm_bridge_state *last_bridge_state; - unsigned int i, num_out_bus_fmts; + unsigned int i, num_out_bus_fmts = 0; struct drm_bridge *last_bridge; u32 *out_bus_fmts; int ret = 0;