From patchwork Fri Jan 12 21:22:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10161733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 77D5F602A7 for ; Fri, 12 Jan 2018 21:28:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6821D28A93 for ; Fri, 12 Jan 2018 21:28:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C7F528ABA; Fri, 12 Jan 2018 21:28:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E782028A93 for ; Fri, 12 Jan 2018 21:28:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A4BB76E55F; Fri, 12 Jan 2018 21:28:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 309 seconds by postgrey-1.36 at gabe; Fri, 12 Jan 2018 21:28:09 UTC Received: from mout.web.de (mout.web.de [212.227.15.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id C9E776E55F; Fri, 12 Jan 2018 21:28:09 +0000 (UTC) Received: from [192.168.1.3] ([78.49.171.196]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Ls6JT-1ezr6216SN-013xEX; Fri, 12 Jan 2018 22:22:53 +0100 To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Alex Deucher , Alex Xie , =?UTF-8?Q?Christian_K=c3=b6nig?= , Chunming Zhou , David Airlie , Junwei Zhang , =?UTF-8?Q?Michel_D=c3=a4nzer?= , =?UTF-8?Q?Nicolai_H=c3=a4hnle?= , Yong Zhao From: SF Markus Elfring Subject: [PATCH] drm/amdgpu: Use seq_putc() in two functions Message-ID: Date: Fri, 12 Jan 2018 22:22:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:uiyWM1/Id26/0bdm0JsaNx3cUsskEKuwPD/TVspuxnj+Ws+b74+ UZpmCZNkIxgWRa+tx2bkokcrxoGba79OnIl/hH7VUfOA6hmUPGvk/bz8IJJzWw0ohkuU+SP 8f0uNGMTmKIpS/8PY63aA0nWgzm1jr6Y6lymFH9fO85xU3l+Df0lupZdJUxVyO1JrIkvUWd oOkGp3RoWjuCQg8v90OLQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:I7OU+KFDq/s=:hsrhdpLhk6bmqnsAr2ikwe rqCo659cwL6yxH3BFK+dlwLIue2CmlQBJ8tQgfTsL/+RR206BYJkYseT0NDohzBFyL+5zc5vL ltD+Z6ZgZGBU3ZxfOx2xG07dYN9Y+BbVAYTgJljqeNDQaoAZzvr2u5V5VXhuyf0w/fgz1ECV3 ZnX9EXuj1r/Sj5Mavt4lPdK+70U9V6MboQrPMNNNlcXyeISH0x5ObL2yYlDMf7BbINTR/ClSh GJ5tMAX3QchuuXHwpeIGO1Tgmg/ruoHFWq15Zxi3G/4iXtaN1Od2yfXBT81R1CUBZBzfi9TfB oJKbeZThRuuaJkqdTIlfWjrSTEY76AFQ77Q2rtENa5l2SqBYl5u2RxftnmkvQ14Tx0cMooLc7 suj2mY02YH7mp2bCfBVA/S81WJZWQv40aZ6ScASnd/LVbRwoHrKDGPDACBXgyVwQVDiiywi6P IqfMGsnFSaSo814ek4V8+rNwoNmI8SjCMKdTb3luWioyiLUrb8/m70DoPOD1fwvMaEMF/1XFB XlC2se0e5nN1LvanC1+swtD5c5rqaGmp4f9AZJipp/jmsYHDgQs7YgvF781UHkYZl1uULAX51 zfockyxK8Re4SO6gldT7qLRaYcs1nRd8WEQH271rEKccFV+hJW7nA13cq3hkBwCRiNHHcRgdR 7botlhwzlsBTcpA7L6jVT2CI1J5CZYwuPfgJuaJ5t8Yq2bmLzOJwsNSU+wnNySThEOwCDLO/o 153mdK25jNLu/88LN0fSd9tbkEoRW8E1+PXFDoKSb3Wcch8A/COP/nKZ6Eqr7pfz1lDMyT2Xc /4Cq2zdk2KCPk38cgM4snwM0p5ILBY8LFIhDC9XXGOjpFwyxRo= Cc: kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 12 Jan 2018 22:08:50 +0100 A few single characters should be put into a sequence. Thus use the corresponding function "seq_putc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 10805edcf964..7ac233f5abe2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -806,8 +806,8 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data) pin_count = READ_ONCE(bo->pin_count); if (pin_count) seq_printf(m, " pin count %d", pin_count); - seq_printf(m, "\n"); + seq_putc(m, '\n'); return 0; } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c index 3144400435b7..57ce42d960ae 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c @@ -419,11 +419,8 @@ void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager, list_for_each_entry(i, &sa_manager->olist, olist) { uint64_t soffset = i->soffset + sa_manager->gpu_addr; uint64_t eoffset = i->eoffset + sa_manager->gpu_addr; - if (&i->olist == sa_manager->hole) { - seq_printf(m, ">"); - } else { - seq_printf(m, " "); - } + + seq_putc(m, (&i->olist == sa_manager->hole) ? '>' : ' '); seq_printf(m, "[0x%010llx 0x%010llx] size %8lld", soffset, eoffset, eoffset - soffset); @@ -431,7 +428,7 @@ void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager, seq_printf(m, " protected by 0x%08x on context %llu", i->fence->seqno, i->fence->context); - seq_printf(m, "\n"); + seq_putc(m, '\n'); } spin_unlock(&sa_manager->wq.lock); }