Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5732110rwd; Mon, 12 Jun 2023 08:57:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7zo/S2FStJuERQ8oQR6R2x5agrsDgqUFoieR2mdTY67LPz8Sln+LnbntCX0R1B5z4FPfuk X-Received: by 2002:a05:6a21:99a4:b0:100:b137:3563 with SMTP id ve36-20020a056a2199a400b00100b1373563mr12760688pzb.32.1686585445001; Mon, 12 Jun 2023 08:57:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686585444; cv=pass; d=google.com; s=arc-20160816; b=EwUBdo5D/cseVwn6v+YDuGN9TkvMmMzh8beUWTlT1iABzTA6pHoLETKhMks3JGjjt0 cHWXRwDrGYbgiWX/Yeg76UXiDpn3Yacj3M3xoDekRxbuVh8B56VQ/QfWvdghuuYbceth +oxGRkLQ/aTdnyYt8kBEKmcClg77V05RwCCrpirBBj826FfERbcZkif43p/34sc3YOx5 b41Sl6e7rkhAXlHij/hi5u9urAiFZy2zssTfeNQtk1UlYjYsr89LM0zrLVjy+BOUMN0y DWBgp660xHfziBEHx7ahkV30EbAlQyo3KFgOTLjg6SzcIJjbxBVITMNPkg038MjYCfV7 GtuA== 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:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=ETnWu6WhKDYXFVtJI/sTBazn9LH79TpiDcs52asI7aI=; b=miWAeuMULaxMvJ+Y2eZVof7y0F0kQLYVbLdQMnLE0HIrklEOtUl2k3ZC5TZrkfDxkV Yzy15EIs4VgWIXa7jkHSMDJlHcLr8Sa8T9Uvl0Sw1K24oBbu3h7KwHPR621qzhfu77M7 9O5t/UAuL8BEoTA5LJaE293KV0eWmKbQG169DVM/HSQOiDzYBmPzckqhYSvmN89CkMqQ EkGCAk5SNu84V2053+PkjWDKBJby6pprXF4MJjTeLdcGGjkNsQuPqjbFh5FiQSoMmgF/ 9wcqmO8xYTcqgCHys2Yy8cXsQ/ZnRXxSErPqy7Ar/bRQ4g0goyuJqCNgd+qBs6DMZxn/ 5ccw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=YVr2kFCJ; 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 w29-20020a63935d000000b0053416d0b54dsi3938315pgm.518.2023.06.12.08.57.12; Mon, 12 Jun 2023 08:57:24 -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=YVr2kFCJ; 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 S236600AbjFLPZj (ORCPT + 99 others); Mon, 12 Jun 2023 11:25:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240681AbjFLPZ3 (ORCPT ); Mon, 12 Jun 2023 11:25:29 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2075.outbound.protection.outlook.com [40.107.244.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CD03E7E for ; Mon, 12 Jun 2023 08:25:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EE6VMxB3AqdsmsSF+IReo7xVyqhZJ1sKeT3spShfjhDPfCZSFiozYMrIKlecFDQ4KGFZKMWH7n8P3u4c/GyQCIkis6w8Xl35+tKS1nlMULcrfChv/Q9dtD0j/TnLp+yTccFvbBN7zTD4PXdijzLfMsuTqelkxCP66XRnDaazDKHIpbaub3djoviAqCg75GtZWl5IC3SPPzsnavM4QI5CYLSeQBiRjLq5chp8APXIK87WDpZ4SwYy7S+pDDzlsvmxKQ7gwS4wakIyLpSA9XNl/RiaLyxGI9MAZtT2jLylU7lWf6nKO87UiRAmr1BrGvMgRMIt9SjlsvsVbRUlto2W6w== 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=ETnWu6WhKDYXFVtJI/sTBazn9LH79TpiDcs52asI7aI=; b=PPFIChXsAUahdGgULflCpnctmtazB0Yr2TRZIeD0phce4N18DPG3B6vWWIGhSH9Nvdkq7uPqfHXDjQ1lPJUPymmF93MucC4AF5goAZ0Ro31RsNaCBhp/GZxWQljrUkgeCwyjDKE9j6j/5oxuggt9JMApYy4wMVLRCkMptgic7GM144QIBGfa9oiAcWI1KXYDHz3udfxq8mfeCBfzzYcOx4zPkuZI2JF2kgXGf+ixnPAMIl5Vu1yRiPLi4RuAM7eERAVcePZnWZG8t6jWc3DUr/uV2+cLrmpZEGiiv70i0eRluLz3K7ZTF8+q+N0aPPrdvke3cQ/cTh964zmZ3foHZA== 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=ETnWu6WhKDYXFVtJI/sTBazn9LH79TpiDcs52asI7aI=; b=YVr2kFCJvbjEz5Sk3e9y7n+U1biRNwi9QWKXe1DcdMeSEJPwE5bhajpAFF0bihv1aA9xBtzJwSdGvIbWMc+nXmPf+lCkBH2gn+Imf4fhsGJAr+ZFsG8rJXDAr/nxUEYiNEAKjcfP/bkUm4gcSlewmvZgyD7tA6sxiX7i7HErqdE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BN9PR12MB5115.namprd12.prod.outlook.com (2603:10b6:408:118::14) by PH7PR12MB6610.namprd12.prod.outlook.com (2603:10b6:510:212::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Mon, 12 Jun 2023 15:25:23 +0000 Received: from BN9PR12MB5115.namprd12.prod.outlook.com ([fe80::2dc3:c1:e72d:55bc]) by BN9PR12MB5115.namprd12.prod.outlook.com ([fe80::2dc3:c1:e72d:55bc%7]) with mapi id 15.20.6477.028; Mon, 12 Jun 2023 15:25:23 +0000 Message-ID: <19a8be24-0b5c-4232-d3ba-dc7f269bafd3@amd.com> Date: Mon, 12 Jun 2023 11:25:20 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2] gpu: drm/amd: Remove the redundant null pointer check in list_for_each_entry() loops To: Lu Hongfei , Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , "open list:AMD KFD" , "open list:DRM DRIVERS" , open list , "Kim, Jonathan" Cc: opensource.kernel@vivo.com References: <20230612115848.8739-1-luhongfei@vivo.com> Content-Language: en-US From: Felix Kuehling In-Reply-To: <20230612115848.8739-1-luhongfei@vivo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: YT2PR01CA0015.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:38::20) To BN9PR12MB5115.namprd12.prod.outlook.com (2603:10b6:408:118::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN9PR12MB5115:EE_|PH7PR12MB6610:EE_ X-MS-Office365-Filtering-Correlation-Id: 71fde0ed-e6b3-491c-e87d-08db6b593db5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c2jxGpbmLow+JIE7+jofckhLzo9g5JCSjRJJmHWBlzeEJF7Sxw2O6g4Dgg+7Fzj3mnM8E1cRvHoEyQ2NDfKYMmUXGC6+S62ZBXOfojBB7u9gPqEdijeBDKq5VQP0YNZ5A26zt7X3+0RbnCIeedEI5qSOwU7tPFqPQQz9vlIasE6qVlNUvFQSVnEhoDbkSXoYhl8Im0UpafaSNGQLzLjrUDsBImPSwT001uFw0GhrIqHt4U9iVygIxhtQjpGX0eOGzIhyrBQncoyS31HFBOeIBfYtDno383vEHQEckq/LziVhPcpRay3LH4b3cmcV82MqiKoniJABMQqJrIhEyzaYPdq1/dGXczVKIkYDTItwSrFazvYthZouf4QViwk4wn0fF6Litjr4Pez1e2+EnhJ99aZAAFlXqCDXL+4s+yaMCzPcINTsMCnzAuEJW+MyAt52z0Ofm/6IB8i4HpR98jG6QaMKBriR85OWLnrxIVZbs372KS/yA1nEXbR+5M8k4CuJubO6PyI/NRtb1gj8deUufQzX40yKTNYeyBxn701CrQNIn0WKlUAfYDpMJjbFIm9O8YEZ01tvJEyLU6H41fFP6/wgYKxo6M8oNdkZMkG1wNtEU16illuyUBQseqwycGU35lbEA0kVB4jZ2H2TsjrzSIhs52odxvelsR0pPJxVEkk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR12MB5115.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(376002)(366004)(451199021)(6486002)(26005)(31696002)(6512007)(83380400001)(6506007)(186003)(86362001)(36756003)(2616005)(38100700002)(921005)(41300700001)(110136005)(5660300002)(44832011)(316002)(8676002)(66476007)(66556008)(8936002)(478600001)(4326008)(66946007)(31686004)(6636002)(2906002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cGQ4cWlzdnpHcEtuUkpJMU43ZXZuLyt0RHpoZGk2cFlYaG0yS3NCRFFadHdi?= =?utf-8?B?ZVFhVjBHR0NLUi9BWmN5ZXpkL0krRzlYdXZ2WTlwU1JzSzlrZ2N5R2FXdmxY?= =?utf-8?B?b1c5TjdUQVBiNWtIRmF6TEt6RWE1dDlKckJsUldkUTJoYnVlN2ltYzlXZHR6?= =?utf-8?B?YzMrcEQzbFVENVhPOXBxR1BSQjVhTVdaZEpHN2YvZENJd3p4Z1RIWDlUVDl0?= =?utf-8?B?Tmd0RHJjYVFLYVNTQTZLZURtRTYzRlBabFBEd3RYc1pJbXBDWnZSOFc2NHhi?= =?utf-8?B?NHMzZEF3dklpNnJKOXE2Z0Y0aU5CSVVEbllGNnVZa0Y0Z2QyaGY2eTFEV1Mz?= =?utf-8?B?UXJPbG53T3VXWFRYSDBacHdVdDRTckpwYnJ3ZCtuUkpFdWQxSlMxV1BUNGlM?= =?utf-8?B?UnExbUk2TGJGbjJWcmdaR0kyR0ZpSlRNTUxhTml6WHdmQzJJMmpEQzcwTXh5?= =?utf-8?B?M2pRV3FubzJIV3d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utf-8?B?Y2RJQ3MvdFFXS1d5U0dzYkd6VWU2bWYwU2lpcDJJRnBaNkgvZkYyNkNLZmtJ?= =?utf-8?B?a1B1RlJvd1QySE9rVlNpRlMzTVZncU5QWmVCaUpRdGx0NDBhcWFYUDh5c0Fm?= =?utf-8?B?K1MvYnA2U3JMY2cxa0YwUWliUFM2bDFzVTQzT3NVM1hWZTNDVU93TStodnZt?= =?utf-8?B?enFJN3FkZmxBemdwQjg3enpHTVRvcjRvRzRNcVp6NVpZTnFOUmpxRHo3UHJ1?= =?utf-8?B?MzdFV09obzl4MXk3SHYrNm14NHRCT3lJK0J0NXQ3S0tFaElWdUxzQmNOTUg5?= =?utf-8?B?OFR0R2c3ckltc1lGekZkaVRjYzhwQUI5T3Frc3dXeFh2dlpZWlBVUldObTlm?= =?utf-8?B?aS9rVkJISG14WUY2d2Rta2tNL0V6WlRPY3dGeTdpTDJyNmtvcDlvN1Baa1dX?= =?utf-8?B?cENkTlNCRElRS1h6ZmFJU3pmUDcxN3ZOaFJ1WWFQSXRaZTcrcm5UU2NRWXNJ?= =?utf-8?B?V0VTOTBFSVA4NXk2aEtGZzV0NXpXNjloTTl5SGFUZFJGa0VCZ0d0M1BORXpX?= =?utf-8?B?S0VPNjEwcGRCTWFncWhTZGEwQ1lUZ09sUS9nY2RmUFd6NlIzK24xZC8xYkdH?= =?utf-8?B?c0ljQnZYaDFVZVNlVG1XaDN5WXlaeVh3MVd4SHFVSHNibUYvNG44WkFBT1FR?= =?utf-8?B?d1liNWhmeHdnWVBFMEYxSDMxWkIzTWFER1ZJUWNEQW81THAxMzYrUmRPVFVk?= =?utf-8?Q?rfqlH1+PrQa5bNHaqXjjMJobH?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71fde0ed-e6b3-491c-e87d-08db6b593db5 X-MS-Exchange-CrossTenant-AuthSource: BN9PR12MB5115.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2023 15:25:23.5966 (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: EUUZPUlO/86XpuxvZh6ZrrJuxL4yrtmaQ38dfNI+y1tYd89CKCNlVdNx7QpLWmMz5nJ2WXVHGpA4qn1jLFu6ZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6610 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_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 [+Jon] Am 2023-06-12 um 07:58 schrieb Lu Hongfei: > pqn bound in list_for_each_entry loop will not be null, so there is > no need to check whether pqn is NULL or not. > Thus remove a redundant null pointer check. > > Signed-off-by: Lu Hongfei > --- > The filename of the previous version was: > 0001-gpu-drm-amd-Fix-the-bug-in-list_for_each_entry-loops.patch > > The modifications made compared to the previous version are as follows: > 1. Modified the patch title > 2. "Thus remove a redundant null pointer check." is used instead of > "We could remove this check." > > drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c > index cd34e7aaead4..10d0cef844f0 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c > @@ -1097,9 +1097,6 @@ void kfd_dbg_set_enabled_debug_exception_mask(struct kfd_process *target, > > pqm = &target->pqm; > list_for_each_entry(pqn, &pqm->queues, process_queue_list) { > - if (!pqn) Right, this check doesn't make a lot of sense. Jon, was this meant to check pqn->q? Regards,   Felix > - continue; > - > found_mask |= pqn->q->properties.exception_status; > } >