Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2773153rwb; Mon, 5 Sep 2022 00:52:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR6tHSMXq551qqVEPlG9QSxLk0cdCnOIdcWqrQSf955/0dNtHPMmI0Dxob1AgYMzV2zsYVor X-Received: by 2002:a05:6402:51c6:b0:43d:dd3a:196e with SMTP id r6-20020a05640251c600b0043ddd3a196emr42656874edd.213.1662364353837; Mon, 05 Sep 2022 00:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662364353; cv=none; d=google.com; s=arc-20160816; b=k38qbxACnJMU+hHlORx3UQHlhoi/UtjuBw94pvQq+O6+gXDrz3yMP6EODOoNagy2qb 4zPZaOpdfvTxnqISq5HDDrIudIFowwZAfEl0AmWjtrn1bBcEslPqARQuBztxmRpWsX0Z zmvyZm20DW6A5bR8kAVLCkIvBgEJTyh7jtS57+IYqWf+2w/mlFO51+ZZg9DzU4prSlc+ k1BMHfk35kES1nYOvHEZauKPVC4JxwzLg0dFEOt87fvqA26U0kuiL/svGWqMMdx76iCb RFsK2BOeT4QiI5kFRrTIf13BcpQjcB0Y0c26IrswL1QEnLMWtnbbUPoNvvJy8nnJOF26 qxPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=EMi/Zgj9wd3UokgHoYhHpcxMljDXWLwRjVfKKXNyK5s=; b=O6JcOAs86W5nX2kO0W2oMjASgsWMbd5ciPVTXCYmg3z76UwccRLGH+nVeW3peF22Kl 8x8yYkZE0lbH7aV90JCZHdw4esYbkUlWilGhOn2mFGmvHKaBbqfg3f7VPoZHAcmUTT4T naT1CJri7TRZ+KEwSyuKXpi81w4nwDHB3sYThYZa1fBJNBdQlKNWg+DaZWd0QSDunqcS AHyX9GWzzPuUv7CXd5xUfdQ+7iooHvmiuXKIBToUk0dQLAEi4IODMTxPblTa17UqjKio rx+RJ7e13JYNHzG9Iqtd6xIzZsviXFDZSw6O72TDjn+bfzUNxN6o9QpI9cpRb/8ezhK3 tdtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=oJYVB6zE; 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=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s21-20020a056402521500b0044786c2c5casi7262112edd.15.2022.09.05.00.52.08; Mon, 05 Sep 2022 00:52:33 -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=@163.com header.s=s110527 header.b=oJYVB6zE; 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=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235793AbiIEHkP (ORCPT + 99 others); Mon, 5 Sep 2022 03:40:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229598AbiIEHkN (ORCPT ); Mon, 5 Sep 2022 03:40:13 -0400 Received: from m12-17.163.com (m12-17.163.com [220.181.12.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1EA7217AB4 for ; Mon, 5 Sep 2022 00:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=EMi/Z gj9wd3UokgHoYhHpcxMljDXWLwRjVfKKXNyK5s=; b=oJYVB6zEjq6n/zMRqvrNO fo0T/l2Aa8VtEAM1PbND93ajzc13kl9hgahDn/mXxgNwzr5vnyWM88kzcLYhu6GB YrRs0AOghQIX0VOBwJKgXs95WiXBAhQmhsTFTNslKEE5k1BkHiI0zdhsRmN5rmnQ DzV+xmhDdDrELet9Wh6cHk= Received: from f00160-VMware-Virtual-Platform.localdomain (unknown [1.203.67.201]) by smtp13 (Coremail) with SMTP id EcCowADXupuspxVjn6FyaA--.43620S4; Mon, 05 Sep 2022 15:39:35 +0800 (CST) From: Jingyu Wang To: alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@linux.ie, daniel@ffwll.ch, andrey.grodzovsky@amd.com, ray.huang@amd.com, Hawking.Zhang@amd.com, Likun.Gao@amd.com, Jack.Xiao@amd.com, len.brown@intel.com Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jingyu Wang Subject: [PATCH] drm/amdgpu: recleanup coding style in amdgpu_fence.c Date: Mon, 5 Sep 2022 15:39:22 +0800 Message-Id: <20220905073922.22738-1-jingyuwang_vip@163.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: EcCowADXupuspxVjn6FyaA--.43620S4 X-Coremail-Antispam: 1Uf129KBjvJXoWxCr17KFyDWFWxCw1xGw1xXwb_yoW5Zr1kpF 4fKry5KrWDZF1UWrW8AF1vvFnxKw10qF10grW7A34Sgwn8ZF15K3WIyrWjqrWDCF4kur4a kFW7Za45ZF1jqF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zMzuAUUUUUU= X-Originating-IP: [1.203.67.201] X-CM-SenderInfo: 5mlqw5xxzd0whbyl1qqrwthudrp/1tbishhzF1UMWQynIQAAsE X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, 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 Fix everything checkpatch.pl complained about in amdgpu_fence.c, modified use "} else {", sent it again, thx. Signed-off-by: Jingyu Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index 8adeb7469f1e..0759d86d92da 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT /* * Copyright 2009 Jerome Glisse. * All Rights Reserved. @@ -42,7 +43,6 @@ #include "amdgpu_reset.h" /* - * Fences * Fences mark an event in the GPUs pipeline and are used * for GPU/CPU synchronization. When the fence is written, * it is expected that all buffers associated with that fence @@ -139,7 +139,7 @@ static u32 amdgpu_fence_read(struct amdgpu_ring *ring) * Returns 0 on success, -ENOMEM on failure. */ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct dma_fence **f, struct amdgpu_job *job, - unsigned flags) + unsigned int flags) { struct amdgpu_device *adev = ring->adev; struct dma_fence *fence; @@ -173,11 +173,11 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct dma_fence **f, struct amd adev->fence_context + ring->idx, seq); /* Against remove in amdgpu_job_{free, free_cb} */ dma_fence_get(fence); - } - else + } else { dma_fence_init(fence, &amdgpu_fence_ops, &ring->fence_drv.lock, adev->fence_context + ring->idx, seq); + } } amdgpu_ring_emit_fence(ring, ring->fence_drv.gpu_addr, @@ -393,7 +393,7 @@ signed long amdgpu_fence_wait_polling(struct amdgpu_ring *ring, * Returns the number of emitted fences on the ring. Used by the * dynpm code to ring track activity. */ -unsigned amdgpu_fence_count_emitted(struct amdgpu_ring *ring) +unsigned int amdgpu_fence_count_emitted(struct amdgpu_ring *ring) { uint64_t emitted; @@ -422,7 +422,7 @@ unsigned amdgpu_fence_count_emitted(struct amdgpu_ring *ring) */ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring, struct amdgpu_irq_src *irq_src, - unsigned irq_type) + unsigned int irq_type) { struct amdgpu_device *adev = ring->adev; uint64_t index; @@ -594,6 +594,7 @@ void amdgpu_fence_driver_hw_init(struct amdgpu_device *adev) for (i = 0; i < AMDGPU_MAX_RINGS; i++) { struct amdgpu_ring *ring = adev->rings[i]; + if (!ring || !ring->fence_drv.initialized) continue; @@ -772,6 +773,7 @@ static int amdgpu_debugfs_fence_info_show(struct seq_file *m, void *unused) for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { struct amdgpu_ring *ring = adev->rings[i]; + if (!ring || !ring->fence_drv.initialized) continue; @@ -845,6 +847,7 @@ static void amdgpu_debugfs_reset_work(struct work_struct *work) reset_work); struct amdgpu_reset_context reset_context; + memset(&reset_context, 0, sizeof(reset_context)); reset_context.method = AMD_RESET_METHOD_NONE; base-commit: e47eb90a0a9ae20b82635b9b99a8d0979b757ad8 -- 2.34.1