[19/20] drm/amd/amdgpu/amdgpu_sdma: Increase buffer size to account for all possible values
Message ID | 20230824073710.2677348-20-lee@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp993169vqm; Thu, 24 Aug 2023 02:23:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELSS6Di+hB4T/cx6SSUVQsQcUVFK3Kb7t8aCgXMfmYnb0lYs/sjXVfvX0vE+oI5t/4oUfT X-Received: by 2002:a05:6a00:14d0:b0:68a:45a1:c0ee with SMTP id w16-20020a056a0014d000b0068a45a1c0eemr13646747pfu.15.1692868998887; Thu, 24 Aug 2023 02:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692868998; cv=none; d=google.com; s=arc-20160816; b=lzgScLTCXIeqCeZkPK2GEGfu38B/4WAbhLBqFPeVx6qtiaGcAXRwbH2EhMFkemMtep lu/3+EYdIIeCgH9JW+HXrvuI2e89PC91EE693b7uVRbLm2nexm5KHlsQ7qnxA22AZFji YV6yfctA+/W2yuznSG7tOxhbKNzyj3d5ayUuQcsbf/bE7Th4T47SrDN+OcQ7w/O+CGiH T90bD5HCIW1O0qCWN3xBJKFrzYUqPqDWoRclfGXO/oJc4u329bYwJh8RX4DNe4Un/kua Xa9sV6eVi7LSLvIGki3pokBC9yhLuUWgVanhAEcidjZPY2fBzTP6t4V9WPifHBGWVZMA GmBg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZdPbqVRKfPUGoJrwz9VnlfWt3oDnEwzNWdzcjsxYoo4=; fh=+hVJ5U5VXxv80W+DQ29JgCmCwGWr4+ebOy2iFDkYCEE=; b=nmpIEnSQ0Rr7C1wdM/tDkToB/c0OlP6tqve3kGUEdFFCR8b28OyzM6xJ+iNKx9g4Fb oRNMAbpdIGBzIRgMyCqPumEFPun05I/6BcIJrIdGA3p+7caVtK00VtUGhe/0U0JDFGve Y/2lAUZqy270bIMa2xXl9uTdk5EpGBjEdrdpW5SRZHWJaMqNEThZp6QzECgBSh6sy4jb iYoWfat45rriCL+cCKokaq/zZMX4NuJAgYmqRlnj9LxfhDAl7uxMqnBVoFBgOt4lv+Dn d//sW2dEqoPciOpPmC3r+CIQHP024iDx3gqhNOEoY/d/XuJ3F4bmhYofq/e47vuZIeHn 4qcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LfHCZhGI; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a635302000000b00564c513ead5si13160396pgb.445.2023.08.24.02.23.05; Thu, 24 Aug 2023 02:23:18 -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=@kernel.org header.s=k20201202 header.b=LfHCZhGI; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240387AbjHXHix (ORCPT <rfc822;kjyul0303@gmail.com> + 99 others); Thu, 24 Aug 2023 03:38:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240419AbjHXHi0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 24 Aug 2023 03:38:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 176AC173F for <linux-kernel@vger.kernel.org>; Thu, 24 Aug 2023 00:38:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A324465D8A for <linux-kernel@vger.kernel.org>; Thu, 24 Aug 2023 07:38:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06097C433CC; Thu, 24 Aug 2023 07:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692862701; bh=XMLhGP3gS/GA5ugfwBvBA9rFCKno1toIUnNgJ1XxmRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LfHCZhGIEbSono5ZPGTva+4svqck8IBZDnL/u9eLKYfW1VIZSZxjrA7vkzj4DvJ1m qJYJ4KNKn1Doi63djOyJ3wu3g4PRXvFX2o8vOw/+qRmmbMgLGnUFwG1nvAcgtRvJ5b e9oSsvjdTUwAQejOWe9yRaCNWjn3pAW2dNYz+5EIcEaJGO3g/07RkI0Q3VSFqaiRrZ qRz/wS4Z65fKN5ogo6pg0Vc4zsRvDrX8pYHWOwL4YzPHaAKEdNUqJ+ZUr3y7FKYdrd 0+Vfq9nkp0ps8vzcVR3p2bbMJ/ituWnRr28BsSrxh7L0PtNt+2KxaxC1Jz7w3vihxa raVHq0iG30JWQ== From: Lee Jones <lee@kernel.org> To: lee@kernel.org Cc: linux-kernel@vger.kernel.org, Alex Deucher <alexander.deucher@amd.com>, =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 19/20] drm/amd/amdgpu/amdgpu_sdma: Increase buffer size to account for all possible values Date: Thu, 24 Aug 2023 08:37:04 +0100 Message-ID: <20230824073710.2677348-20-lee@kernel.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230824073710.2677348-1-lee@kernel.org> References: <20230824073710.2677348-1-lee@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775101803168025547 X-GMAIL-MSGID: 1775101803168025547 |
Series |
Rid W=1 warnings from GPU
|
|
Commit Message
Lee Jones
Aug. 24, 2023, 7:37 a.m. UTC
Fixes the following W=1 kernel build warning(s):
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c: In function ‘amdgpu_sdma_init_microcode’:
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c:217:64: warning: ‘.bin’ directive output may be truncated writing 4 bytes into a region of size between 0 and 32 [-Wformat-truncation=]
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c:217:17: note: ‘snprintf’ output between 13 and 52 bytes into a destination of size 40
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c:215:66: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c:215:17: note: ‘snprintf’ output between 12 and 41 bytes into a destination of size 40
Signed-off-by: Lee Jones <lee@kernel.org>
---
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
---
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c index e2b9392d7f0de..572f861e3f706 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c @@ -208,7 +208,7 @@ int amdgpu_sdma_init_microcode(struct amdgpu_device *adev, const struct sdma_firmware_header_v2_0 *sdma_hdr; uint16_t version_major; char ucode_prefix[30]; - char fw_name[40]; + char fw_name[52]; amdgpu_ucode_ip_version_decode(adev, SDMA0_HWIP, ucode_prefix, sizeof(ucode_prefix)); if (instance == 0)