Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp166829rdb; Thu, 24 Aug 2023 02:23:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFuo1fj0/jVOrIAYgRnC+fO2Wg/ONDB4U8AUN/HqBvRal7YjpUxNCye40XBkpSqrF6gOOb0 X-Received: by 2002:a17:902:c38c:b0:1bd:f45e:b5cf with SMTP id g12-20020a170902c38c00b001bdf45eb5cfmr16364381plg.22.1692868997842; Thu, 24 Aug 2023 02:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692868997; cv=none; d=google.com; s=arc-20160816; b=BD5xjY4TDlQw0bFUOaErl/KQyWG5RgK6kOfLmKs0oisZKZ50aPvBa3ySpy8i66bN44 N09A+8IDlcOVgnzhW9ARgAk7C78B/TsLxUQqPihTUryVZDFVoWY9Pa81LRmWzy127dVg mI0O3RxQAHIsr1BW0Q1k9SPnb2NzU4a3ZqqSlOXfJuuaBUVj1j5Wsb3gBeRZj475/DNT RLbsQtWMqwm/vl700CfraTbFf/aTvPeTuk/f0krGbXuH3CV9KPLLjAZ7qw7/+KYfD/oQ 8p8b5qpaLUhl9t9ebwzwYVlMLtAL5NEAqP4KcJUzyB8Ed+JkIkxO0VTOUduy9SP5R6lB Vp0w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r20-20020a170903411400b001bee750a8aasi12095131pld.580.2023.08.24.02.23.05; Thu, 24 Aug 2023 02:23:17 -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 S235552AbjHXHix (ORCPT + 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 ); 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 ; 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 ; 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 To: lee@kernel.org Cc: linux-kernel@vger.kernel.org, Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter 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) -- 2.42.0.rc1.204.g551eb34607-goog