Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5425902rwd; Mon, 12 Jun 2023 05:07:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7A9YORWS70S/GDA1Txxc5OFwGCwOzP0p0GaO2P7Zr2zE+Be4Q1kxn+uk/M6ScmjJCfvstb X-Received: by 2002:a92:de10:0:b0:33a:56d6:d9a7 with SMTP id x16-20020a92de10000000b0033a56d6d9a7mr7251479ilm.19.1686571674045; Mon, 12 Jun 2023 05:07:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686571674; cv=pass; d=google.com; s=arc-20160816; b=Yf3zkurtKGCjVhL1e3Ane/6SjwLkeBBjli3GEKWa58mC707OyyfQs5ifOijX8YOeQD B9yRG2e+3TzyKuv0UCdGMPG6z2HnKYGblRHWPLjAPyQ9KGEgEunv6BXeEogoc85rTfNc 3bmdPf6DCxidOpDsIwCj3SH/zyGmwmHl0RZlxaTmvg06o8Su7jCubos5wYVKWL83xwpI XrM2UXtzwyYcFRzZFUKMtLrCglwKu8GxCWB6/rF3jjk1M9BnVRsnom8SO1FLTTuLx+jN edU27mHgtx3TLuS1/hOqzdUO5/Mj9OJQ3iD1V6445E3XNJ8LhYgv6k7qnEQ8scOEa5O8 11qg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=QlUKyOggtSIaeAHVd7ZMPIfXcPXaRQ7R1DMi4Xu8CvI=; b=tVFJT4Zpc5Jb39MsXZWFBfFcydOFKFQR2XcCVLbnOJbjcouQIywGLNO7GZESLjEhX+ C3zIHL4X4Voymi7iwFP/5RBKKV2z7xPrYtdgU4o1FNbUMdtW9INPbcd+emuBGUWQNMOF OHHm6lkVMbrjVMR1Ezjv9LKJue0ijfyek5mlp68De6Jo2U+NBD8NIsbSJ34xjbw4jwoC xpHfSxhKVuQpfGMLMNC8m3Xq0J0B6iOk+bF6VFYLkkm36SUrzdvJDyIfvHVbAQWmSu/3 /szUdWZ5HcLwS/z1DNc+fQ7L1MFZ2QK5cFMkQzvv1c/34Z+huCRza28pQWaN1aC3gQat h6zQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=VJoeMmKB; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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=vivo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u63-20020a17090a51c500b002569b9b4397si8729433pjh.47.2023.06.12.05.07.12; Mon, 12 Jun 2023 05:07:53 -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=@vivo.com header.s=selector2 header.b=VJoeMmKB; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229937AbjFLL7K (ORCPT + 99 others); Mon, 12 Jun 2023 07:59:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbjFLL7H (ORCPT ); Mon, 12 Jun 2023 07:59:07 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2136.outbound.protection.outlook.com [40.107.215.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44D34AC for ; Mon, 12 Jun 2023 04:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g4upBKEgE8N+Zg3EubxxdoGCFwUTxCRdAIrAyA7yHulXL/ckrNl8VdZSV6kD2I5JfjHmAqiZhknuzC31D3JtPrralT0PTjnn49PSTMOzRFhqyvVXfRrOiwX/VKPXz5EQXewi3zeJJvH6ohdhEJnJrIwdctC4q+wd/O496s1fYvfxvQ42Cr1LmeuDft3JJGO19w4OLGnxk00uzcDN6Fauj96rpTQQXRjsLE6+CUHqXe6iThlkE3uY0244qPSwK/GXAmpQnDh9WYvZske6Fgyvl7gE7iQOLeo2xMge7cLGYwI4mqQj77/FAIHA7ITkhlSCSSYUxBdkSugIGNnEARCJyg== 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=QlUKyOggtSIaeAHVd7ZMPIfXcPXaRQ7R1DMi4Xu8CvI=; b=nPkv/KrSc85YFS5uQs7MeN7CvGFQswKsml/7fcDxApH/x699IprdxC4Z64E1WBgXgtZt/xp6PFc3yyfEa1WsFFOwRaoQh/CN+lTtY56YwHCCalowe/WTmevMTR+IzWXVqX1VWKQqI8VHkhT0R14P8dGd0z0cbUa9YEG/9uvBTRR+DqpTYQEw+GKexIWf1tPG4LaWfMyurt1GBHJD64IpYPO1nYJZ7P4TGjtcFMCE5LLN/otlmT7TsdfyMXDetWvLZARSim4d31sIDAQWVOMYi+61y/1s+n83AXFoTq/ftdZCznJMA0s0gQ0wjbrzXXNHDG0grO6eeHAsY3nrsxAAkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QlUKyOggtSIaeAHVd7ZMPIfXcPXaRQ7R1DMi4Xu8CvI=; b=VJoeMmKBCWD5nCZJ2oDokarrXEuOfujlTwU3cjqsCSuAF37TzWewCSV+xHM+r9+3U5eo1LYuBc2Gu17Ub9jTSe90VCnpi7+qRyxOKEjeAGdBWctUXYcUa7bSSbQUqmO+vc8R4SS+Vhh0Ls53pLUm2tP23a3BARWVvFCtb3KcfJpgJcMeOlDS/HNAXzsVizyzYKUCOm1mNUPgedhafmiA73z88GNkD7O9X+zpAWP2JVcCj+WO+OGuG12Besbp0aef92RFvZYzK0WYznIZqiYrMCeD6X1EQiEH9ibwLqD0Uo+it80LiNyoPq2WoZ9z0gsUH7yjGBKXZrDog20x8z9o0g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB6697.apcprd06.prod.outlook.com (2603:1096:400:451::6) by SG2PR06MB5129.apcprd06.prod.outlook.com (2603:1096:4:1cc::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.44; Mon, 12 Jun 2023 11:58:59 +0000 Received: from TYZPR06MB6697.apcprd06.prod.outlook.com ([fe80::f652:a96b:482:409e]) by TYZPR06MB6697.apcprd06.prod.outlook.com ([fe80::f652:a96b:482:409e%5]) with mapi id 15.20.6455.030; Mon, 12 Jun 2023 11:58:59 +0000 From: Lu Hongfei To: Felix Kuehling , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org (open list:AMD KFD), dri-devel@lists.freedesktop.org (open list:DRM DRIVERS), linux-kernel@vger.kernel.org (open list) Cc: opensource.kernel@vivo.com, luhongfei@vivo.com Subject: [PATCH v2] gpu: drm/amd: Remove the redundant null pointer check in list_for_each_entry() loops Date: Mon, 12 Jun 2023 19:58:48 +0800 Message-Id: <20230612115848.8739-1-luhongfei@vivo.com> X-Mailer: git-send-email 2.39.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYAPR01CA0176.jpnprd01.prod.outlook.com (2603:1096:404:ba::20) To TYZPR06MB6697.apcprd06.prod.outlook.com (2603:1096:400:451::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB6697:EE_|SG2PR06MB5129:EE_ X-MS-Office365-Filtering-Correlation-Id: df9f21f8-187b-4910-74cb-08db6b3c67f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /aiJVAQhc6dJAVMXcOPM3bcVsXW2iX1nEm1N+6l1BTboHObGiNjRpOhKPuBM+0I6r0a/mUVPBzRPhwAdI+1YrqTi/JgUMJIqJD+iNPOFr7UXZB79ysiL5FGOa1pGnufwlJzJLe7gBy5BvMrVHbcY4HIPEHSVe1clYP53NfKdZk1P0u5D2IK09jtbNqf89zj6sRyB/SdKDup9yAiafOcWICppDlW3dv7r2fZx4s80A1zU60nul4TSd1/ISTxSAni/GfKMBUT7hpyY1E4ZaY/5mNgco9tqBnaRfKxgIodyzWz7x5EgZIKV+GAwSK6JDUcBeOHTSny4E3zqmHeUO0sDA7LwrocKbzO735b77sx/gFTeBV9kds1s8rEFkxmEaT4wottvauiYJspq3EwsdsFQO01zkTYjj+6UtL5WjGygiLkmxz7svPdz7IGWC6KcwwOt8j01nrB1XD6ekReB+FAmVRpKRDI4xrZhcGE0Cxm+A+++AECy8Ox+SymtUXeI7+D83/DalvwCYzeHbkFr30UxycubHGUt2//rokD/fCd4DewvCwi/j7vZAxawRGYAQgSJKQGJmc84UM8R25h/4qxn/68HuCt+GfvJANeoUYIw//k0IWNPQEGapgHfRV5P639M X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB6697.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(39860400002)(366004)(136003)(376002)(451199021)(83380400001)(2906002)(2616005)(36756003)(86362001)(38350700002)(38100700002)(921005)(6486002)(316002)(52116002)(41300700001)(5660300002)(6666004)(107886003)(110136005)(8936002)(8676002)(478600001)(66476007)(4326008)(66946007)(26005)(1076003)(6512007)(66556008)(6506007)(186003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?zeJl8jHf+lau8aBsrV13Zr5C+/PL4oJMzh+l3OlOCSOk1K3r2WdAWA0eylUO?= =?us-ascii?Q?5syKp+NMf8DdaudFzZJh7u9W9rD/xpZihKzIi6e451QD8Wa3JoKrNksDcnjT?= =?us-ascii?Q?RLyV7EwDv/VTGLtULdOgkZRFHx4QAo7oo+tO+C0qKqip8ggFPx1bnSl1Zhqa?= =?us-ascii?Q?AwAf2gNvWNko2lvS3/HZCzgE9OvZR/Dyi7mCp7X/HIY19TRmW9vPMHcJSupC?= =?us-ascii?Q?ivLHkaRzVpjPllGM6KlVlOS4qeJNu0Mfol7HStPGLCr9hS8A3GWhUS6MiUmW?= =?us-ascii?Q?Acd696k3Wd8RtwHthLoRQKPYqq7WKSFWrTLxI61WH3+/Gwz9N+p4y8zqTKvF?= =?us-ascii?Q?sQTBE7ZilTi3iFz26u58MGrkYMykU9Rtpycoquz788gYVMfmoaomMo+XF7+a?= =?us-ascii?Q?plcV9b/O+Gv8WIlHpFSnGGPYQzGrfTM0l4M45vPO9oJcVZYfU2/mF0oWEX9a?= =?us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7/FSvoxRLaBrK5p2dN9Igspvqc?= =?us-ascii?Q?UfVYw9hJ3p4k1aX2sTJvUnASHqnM1OpOK0ZTReMmIPzjv/uzvPt0jO3jjHaV?= =?us-ascii?Q?W3JE/Mjbtjidqx6G9VbGeLnjHBC10axeqN3RLwIHqQXD8PF9bIFDD4rtuZaB?= =?us-ascii?Q?7BIZQC0sGA3fW5lKipQKwazr6F2hXizoFRpcVmTy4CMK9XKCm1nvQwWGr1Xz?= =?us-ascii?Q?VldfhscljPCcdLcaUaMbGqLOPrqEDqC664D1mM6O?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: df9f21f8-187b-4910-74cb-08db6b3c67f5 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB6697.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2023 11:58:59.4578 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: d2eyIV1FkFlw+9jW2Dd47KnPki/InRjecMNA52Qhk6RUFDblDB9OE8Wvi4KAf3xAi2Hk19jmzZTOZc/a0Afflw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5129 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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) - continue; - found_mask |= pqn->q->properties.exception_status; } -- 2.39.0