Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1134315iol; Fri, 10 Jun 2022 00:34:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxp6t1sAtgCNWwnM7u3aVM8AOpOhHzwe/+UYLz+QZ11V4Oo4xlgsOhK7myUOay5RhZnZ5lP X-Received: by 2002:a17:902:bf45:b0:15c:df47:3d6 with SMTP id u5-20020a170902bf4500b0015cdf4703d6mr42778292pls.58.1654846485354; Fri, 10 Jun 2022 00:34:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654846485; cv=pass; d=google.com; s=arc-20160816; b=SHCoy82EE3wcBvtq9yckYCRtz9wdtZed5DlXFYapYPnnk3SgvAaKzH/Q1FLs9jAdLJ FTCwymYOAYlXbIH9OQGKfxuOph6QcpToi4vNL+nRykzD+QxHluks9oTrSqvz9kVbLUOD c6b7rQiL22QGbQF9ys0blGCmET3CzfLBHSWCsYEwORSHWbqY7vZJMyS4WTV+ewgU/88u +AXrWmVndgX225S3kIFEZ1sRV94yCsUgdRSfi0IVUCAy9H7onnVVSS+x6FQmMtEek5ul E+0r3afiXMC4PyMtkZsKF/gXyqyimUVVOqOvfroEzdMNTf1GH5qh1CQhXxGSXGVt/LV6 Gxcw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:to:content-language:subject:user-agent :date:message-id:dkim-signature; bh=/LxTsjea6D5Hp/AQRsBDnDWiiCJ4WxEoD8x8UqArK2Q=; b=DBNz90FYaY/ewJG47ER/kDxmciSeb3o5CidFkpnV2RFfSpEfrEJM2bRMrxajUNAxJU OjxvDEiX4Mb4birdgBecwbUCBg1BHbbvEGu7D4sdjuev3uTuYzOIZ6RR55CXqD4pOq1W eRSPTsUAsFF5pgdpZNnSnN+IjtokN81BI01OC9CGKMeI6870V7bBSI1ZRIBIizUp8FIP dO1sgx2n5pj1u8LlkUQdSDSB/KygfJoJCKgV80UeqCVWl9y3r86Itu1l1D5dO6IRxYsH qaDoLX8UT5i5elrSRRoOPEN/K4x7b5E5PTuLgaeLbY6QuXloe4WRvlkV5O/oEbJXiNi8 GGXg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=hfLHMVXn; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x14-20020a170902820e00b0016227beec46si31805091pln.143.2022.06.10.00.34.29; Fri, 10 Jun 2022 00:34:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=hfLHMVXn; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346852AbiFJHZR (ORCPT + 99 others); Fri, 10 Jun 2022 03:25:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346914AbiFJHYc (ORCPT ); Fri, 10 Jun 2022 03:24:32 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2057.outbound.protection.outlook.com [40.107.95.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB1931B9A7A; Fri, 10 Jun 2022 00:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RzB0rCFsgQxp1C1X8oiPhA7i17vnSflGF30SSrUDzp3/Jgi8j2T+YcGY+nZvAgolSAgMUv4RE6NSjcY/ouT87/MHyf8qSJCD6cUa9EsJDrQ5X+TQpzzGIbwPkd4CY/Qb8/3/3BJGjIGmHTqAIqAtOnhc2HD7w4/fM1LtUVZYi+kLHFdNBqT3G82BIoqcQGMWhhQ/9sKWYq1GlfrsbHDMUV+UwGqNOHAvS1IE28HLdPfy/+0TU/L5+6DIcTGuOuZVyFXni6J5iahkHQsVNyFqynlD2GzagKf57NXi/Edf5uBxM6O/kb4KyjSnFm1a58uawnJ+H5plIGXfASxNhz8x6g== 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=/LxTsjea6D5Hp/AQRsBDnDWiiCJ4WxEoD8x8UqArK2Q=; b=GTJ3ujuBe952LQSnVKyfAA4SRaJRYMMbplZxEU5m/3w69NRGch17lyksqqmPGhuNN8XVjpIu/lSL4RBmU8OhHiKEQSWU2kI90pVS09WKEwWCDbR2qxIIgWYXijBoRhbZsepfwOgOoTJq0qC8PswqaFnq4u2qNaV0zSqOZ5PQ3lTBf+WHsceCpy/FpR6ghHwdbzI0bIQ7p9YxipsEhZE5fvEJxHFfQTryrDRt5T2Phmplb/pSmVAo9D7eFP0bviAswvS916liLcPV7TLrRWzL+3/sL18jfdWLIxlEQahnSTHljdZ7KDTZG9gFFLF+1V6iBxuQdKwQtgpohhoJfGp8EA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/LxTsjea6D5Hp/AQRsBDnDWiiCJ4WxEoD8x8UqArK2Q=; b=hfLHMVXn8FfvKIJDj1GsxbnzGoYsirAALjTtGLNXtmxKR7aDJpZhTminqAKiUzFp6xqMby//gCzTNPqw0dfxNvpfNBj1N0uDj8Zw3gUTJwMnHdjd51VRRhax6lgz0w7pKdYK2OVF1Bjn9IVL6RZ4jvVroaYAOyDoFPjA9tarpmY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) by BL1PR12MB5189.namprd12.prod.outlook.com (2603:10b6:208:308::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Fri, 10 Jun 2022 07:24:26 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::e0fd:45cf:c701:2731]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::e0fd:45cf:c701:2731%6]) with mapi id 15.20.5332.013; Fri, 10 Jun 2022 07:24:25 +0000 Message-ID: Date: Fri, 10 Jun 2022 09:24:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] dma-buf: Don't use typeof in va_arg Content-Language: en-US To: Wan Jiabing , Sumit Semwal , Daniel Vetter , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org References: <20220610072019.3075023-1-wanjiabing@vivo.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <20220610072019.3075023-1-wanjiabing@vivo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: VI1PR09CA0104.eurprd09.prod.outlook.com (2603:10a6:803:78::27) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 09589f81-332b-47df-a058-08da4ab23f7b X-MS-TrafficTypeDiagnostic: BL1PR12MB5189:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Dic+jkue90w0Lkvgw+GEhd5R3x2KGeOXyKvdSgE78Mb6YGTp8XDawBiKGlLQkl90x1UbijZ41P77sJnLELU1eiNke6UjMpTwDIAacrJQ+RmtgtWps09J5VJlAVh+P0Xfs/bmm+CMaQmqSAG+3xmaI0v15LMscIIVgCljY2qgkZ7PYEXhEj1vj33G/Q0OFBb77gtkjzPTXvBqb+Pvw6jEpMyhQqUzo3iWJ2H0yLb3TpPIWDNWTqRttTwrF4Y/NhRu2leRJQVcJbiYoI6azAHuHdJXhkOKv/TSJMMBlIEi1PSsgnh3n/E+JIaSu87uNMROS6MRhNWt1il7n5Tm5D264UWmC8B0Xm8PbYBIwSKhPL/DM/jp+f0YpxL+95afGL7WqLDYkU20rz3oshX9QJ7Kvxj54a8JxFIIWrvo4rsmDfZJzzkTrp75NICUw/PJ1mHofHYxuQ/7cWDj/v2gShfAOwmk/ROv9kA05tj7QuJq9wRlIxrn16qmrVfvKOLBn8MzGRt5JvmF+ib/MlO7Ngi75C8mWvQGLmRd4fmMRrrsMmh74MD/Tqz8V0Q5bOcZFTd/ppCVCSnmWTpNYbQFouAl3Kyw61IQtGJP0zFcaNKEQF2WehR703GJIeQvkjmlakhpwRd0vJeGRZ1I2rp82zYV8QysaMy3Htb6yb5D3nqkyKdsETjTiU98sFsWvBp6s+k7IjSSMzvmUj1Fb3KBqnylAtjkJ94qzI+muyjfpw/aPIJl5qogjRBl26e44Vdksbwn X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR12MB3587.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(2616005)(86362001)(83380400001)(31696002)(110136005)(6506007)(6486002)(36756003)(5660300002)(316002)(8936002)(31686004)(66946007)(6512007)(2906002)(508600001)(38100700002)(186003)(26005)(8676002)(66556008)(66476007)(6666004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?R2k1WGZSakM0aGRBQWRPY0x2MDlNdnp4M0NLUDVkNFV6YU1RN0pyTnJISDBv?= =?utf-8?B?aDYvYVB1S2pRTWZKQWI3N1ZPeFJ6aUcrWVh2UjBEYmsybU4zdDJWVitvZ2FT?= =?utf-8?B?STZnT1FHd0ZlVmY4YXRreVRrcUgxUTY4eG9EcFJIQ2thcHUxVnYvVTZBMTVj?= =?utf-8?B?WGVDdGhhK2U0Zm1DZ2lUM25wUXkyTnBtMWttL056K0NPb0FHMFRTbGx2TkhS?= =?utf-8?B?bVBCQzQ1WXMvd0JNRWRRbWJFdEFHL2Y3MDFFcEFJWVYyc0t1UGNjUHRHcGdn?= =?utf-8?B?dEx3R29XeTVnZXF4MGdFSGZHckpZQzFUdHJhckRIcHhpSENYWllkZ1ptbzlL?= =?utf-8?B?N3k0M3dwVTFSRVREQW8vOVc0QmlRem1vS3NDTVQ1YllEcjlETEtjWDgvd3VQ?= =?utf-8?B?bjk4UlRiNi84N3pDRWN5dzhueFJjMzFqc21ITy9yOFhzZUNxZTdGUktHZ3pj?= =?utf-8?B?SmZkaURveEJjVWh1V0JmeFlTcmVycGRDVzNEdlB1Z1puMzZwaD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a0dWNEZodWNJbTdOWUhrbytGUWlsOGZqOFVzZz09?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09589f81-332b-47df-a058-08da4ab23f7b X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 07:24:25.8234 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PcooZvNhIYs3zT25cJ4Q9WkUGRuTsCGCjT3oOpnxi18eqrdvgXIuZAlX26iW/xgy X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5189 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham 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 Am 10.06.22 um 09:20 schrieb Wan Jiabing: > Fix following coccicheck warning: > ./drivers/dma-buf/st-dma-fence-unwrap.c:75:39-45: ERROR: reference preceded by free on line 70 > > Use 'struct dma_fence *' instead of 'typeof(*fences)' to avoid this > warning and also fix other 'typeof(*fences)' to make them consistent. Well that doesn't looks correct to me. *fence should be valid at this point, why does coccicheck things it is freed? Regards, Christian. > > Fixes: 0c5064fa8d5a ("dma-buf: cleanup dma_fence_unwrap selftest v2") > Signed-off-by: Wan Jiabing > --- > drivers/dma-buf/st-dma-fence-unwrap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/dma-buf/st-dma-fence-unwrap.c b/drivers/dma-buf/st-dma-fence-unwrap.c > index 4105d5ea8dde..1137a6d90b32 100644 > --- a/drivers/dma-buf/st-dma-fence-unwrap.c > +++ b/drivers/dma-buf/st-dma-fence-unwrap.c > @@ -56,7 +56,7 @@ static struct dma_fence *mock_array(unsigned int num_fences, ...) > > va_start(valist, num_fences); > for (i = 0; i < num_fences; ++i) > - fences[i] = va_arg(valist, typeof(*fences)); > + fences[i] = va_arg(valist, struct dma_fence *); > va_end(valist); > > array = dma_fence_array_create(num_fences, fences, > @@ -72,7 +72,7 @@ static struct dma_fence *mock_array(unsigned int num_fences, ...) > error_put: > va_start(valist, num_fences); > for (i = 0; i < num_fences; ++i) > - dma_fence_put(va_arg(valist, typeof(*fences))); > + dma_fence_put(va_arg(valist, struct dma_fence *)); > va_end(valist); > return NULL; > }