From patchwork Tue Jul 23 16:23:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13740207 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 66981C3DA63 for ; Tue, 23 Jul 2024 16:24:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B272610E5CD; Tue, 23 Jul 2024 16:24:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=web.de header.i=markus.elfring@web.de header.b="SVz+ftKM"; dkim-atps=neutral Received: from mout.web.de (mout.web.de [212.227.17.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id F40BC10E5CD; Tue, 23 Jul 2024 16:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1721751834; x=1722356634; i=markus.elfring@web.de; bh=qymtKMtz222jAh8w4pdYipiKugHqbVrcpK6zWOslD9o=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=SVz+ftKMA1p/t+X22mO6CGdbI5mgddVSIvF9SlSHynOpQYipuB3WN7xgJJ3LwrJp McAPbA/86ZFD0wdneJ4JpYAc4d3O16PnMq58ux7074XjgdTfcPoOj7wFWG+Yz51a9 +nV36WTO/XxBDjfXjw4VvklWpaRlbBqWfDrbUSMg4KA6YJX1OkLUXV5ojMe7/fK2j H+i8dhgscbdV9rqS0f9E58kvJen/cXdhpwWK7L4Fx0cIpMhVFq27W2y3hwNaTvCdk tp39M4ABxPkPLZ7lp03RcXGZyIKh2YBzNYVgdKhsvKdqC3XG1iuAGb8BbL9kbyGne o9gf90jpYdPsdG/gTg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.89.95]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M6HFy-1sPfWc1Oa8-006swF; Tue, 23 Jul 2024 18:23:54 +0200 Message-ID: <6636ae61-c112-48bb-acbd-89cc972cd282@web.de> Date: Tue, 23 Jul 2024 18:23:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2] drm/nouveau/debugfs: Optimise data output in nouveau_debugfs_vbios_image() To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org, Christophe Jaillet , Daniel Vetter , Danilo Krummrich , David Airlie , Ilia Mirkin , Karol Herbst , Lyude Paul Cc: LKML References: Content-Language: en-GB From: Markus Elfring In-Reply-To: X-Provags-ID: V03:K1:D5gHgzHG2snm2BneY/9rLIoyvAfRyLG0YCgE7dLY6aEjYK/sCWV BAJoEkOLPp0iEK/s/ispbissMxojf+heWcDa3/WiFzxH322ODTJ8Xvpf//OiysvviRJjbkD iO7nIhjEYBCiSFKPG7Jf6p+JgGRoOf3X6FKVum6FdoGrOmOH3zdL/qLEq3M8Fbhrr9/T6wN CW5piHriygaQ8l97JcAUw== UI-OutboundReport: notjunk:1;M01:P0:gKS3DF7q8Ws=;R7HXf9nAL7DNpFKsU/CZ+krqeZW BnGcqW5XayKOACBusGleO+x5tXpL4fjtGOzuYAMSmlqrtnqyEpcbHP45H7eoKB3szdllx8ZK7 P4GZQ+Y5Rkcg6vN6TULBEQgfPYJvJ8x74s3vKSz/mAXcpdmR/kMIFE1wjY+vFFDSiRMBlm/1N Wl0dgqfJh6kexe2NEwFVz9A5CzAIuL4xrYXA4BeUY4mqi5UUgAqMTgNYCjKF1lJGFeiBVvP9X xpiMyhkz7UxvLnVqoHdOPBXTKAzzO4LswfHYsn075IbmvTLl73Qm2mc0kVjijfw0L1EK2A6zW 1lhfT3Bh7tQoTs28jkuDtFl7PGl4U3s5INPVuygDxAi/hhH/8uBC0HdjIUKYIWC93VH15i0Da 6pGU3rJDvG+kmQHTR9hZGAei8/7hhgRBnnrrv+3OvEuZCrcDyHMaWvXsbpKpj14xl+JbgpnPv g02GjaF+1K9Gq02f0ZRZzhWdWtPbYiMMJqkfp622/29/nwtyMIG55uz9QjA7LESd/C7NhXEUu ueATWwVsMsO8/IHFaLn8l9DT6MZbnjE9fU4KkcDFZ2s4QhCpCVTY2q/RLEg81+7iGp2LEPOoc uwhlzPsY1UqgevV8WyraS2ebg03JrwxuTEwLybrhls4T76VKiIujkjuxvoaE1YToE02ul1BqY Ram54Ygwm2VOUJ823QhYhi1n1+FdKxqdwGk8ijrqPozbMvLxK9Gqm0713b2T3W+Srpz/abdGK DLOrXQPhpab+rGPe2esuuBDXOe4Xrv95IK+H9sYnywMy1unUCjzF0jaJ2l+3keiEm9qzdMhsX 8280gCybOWCHtArAdFqLqrMA== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" From: Markus Elfring Date: Tue, 23 Jul 2024 18:08:15 +0200 Some characters should be put into a sequence. * Thus print all data by the corresponding function “seq_write” at once. * Return also the value from this function call. * Omit a local variable which became redundant with this refactoring. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- V2: A patch review suggestion from Ilia Mirkin was integrated. drivers/gpu/drm/nouveau/nouveau_debugfs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.45.2 diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c index e83db051e851..980cff265060 100644 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c @@ -39,11 +39,8 @@ nouveau_debugfs_vbios_image(struct seq_file *m, void *data) { struct drm_info_node *node = (struct drm_info_node *) m->private; struct nouveau_drm *drm = nouveau_drm(node->minor->dev); - int i; - for (i = 0; i < drm->vbios.length; i++) - seq_printf(m, "%c", drm->vbios.data[i]); - return 0; + return seq_write(m, drm->vbios.data, drm->vbios.length); } static int