Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp92754lqe; Fri, 5 Apr 2024 13:49:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUmpIzc2haCRXBjAgetzm0wKQoUEcNUFlSRg8t6jrqJGHqdLp/voM4nFvAyCDtVr0gNWBx+zqQxV8Yut5InSYkkxiLMTjB1OOQMDdAnbA== X-Google-Smtp-Source: AGHT+IGfDINJ6tbpRcYBZ/d8KQCdG4qQh82AISRbpM6jUXkeDObEcqiGaGXrpgCQxeg2HJ3/6EBl X-Received: by 2002:a05:6e02:16c8:b0:36a:1121:7358 with SMTP id 8-20020a056e0216c800b0036a11217358mr2329835ilx.8.1712350172686; Fri, 05 Apr 2024 13:49:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712350172; cv=pass; d=google.com; s=arc-20160816; b=vwXINhSwf7gnmB5JhbTp6F3MwXaUbSC3e9Rb48fCfcw6YXCAtOzLYpIoW+t5cABv0g XHMzPGfxH5K6hykDUWe1x3kSnUMfH9eW1CQQBP3A3diJZ5M6nswdVtP+6cl+TResxYuX R472b0r/hKQNLRmrHKy1+ycXc98RV6xvAT6kFDr29sQRZk62m2VMPk83C0n1FUlGZjKq 9PfRl8k2UqpUn3HxKsw0HypJ35VIU4nV8B9blOCLoRildCyHAusdqkQTqscgQ5aA4P+y JMKpwHNTpkZiMakzbM7BGSrJpkxWZBogbmb7u1bF73s9rK0YNwVmi7hF3whE2uX+ebdd 9zoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Db12TksZrecXdrb9oZ6ObgdxlCn2KFLLd+rrhg90Y0M=; fh=zSyS+C7E+CwreMdOrSb+cjibmX2miMdVFQQOrMgtOhk=; b=NVczDxGqbn8710KpXOhPlfbmAZV1plXa4/pgDs3ojd3hhnXPYwMaa2kM9ZISrd3g/X D64MdEib3fDS3IliD/UzyXnDEs/0+sGkX2CiOFmeNr6rRFymQGwX1grGGy+q1fyQOQg6 tdSu0bipKjLroO+DCE9MW/cRiDDa8bk1AdKDd2Fwf59EbSrJv9XxemmFbyjc4qKL0PYC jc3gL7MzH2Zdc0bw+jXJDZyQvvnXqsGssQrhwPXDb9gyBPXwyiSzrG3EZNZs4QjVq6Ge UcJtDUAUGUTXRM2gRcPhnT0uqGQ0KYEDFme1r35sHpr+neMtVrWLJrrvaz+H6aCh0Y2B fGvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="akS4L/ax"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g7-20020a631107000000b005dc6e684fd7si1892761pgl.451.2024.04.05.13.49.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 13:49:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="akS4L/ax"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D7EE828303A for ; Fri, 5 Apr 2024 20:49:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01EDF174EF2; Fri, 5 Apr 2024 20:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="akS4L/ax" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E5FB1C6A8; Fri, 5 Apr 2024 20:49:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712350166; cv=none; b=clUZKzkjY8oNywDEs5FxSrXo8uIehUxueYkY9Z8H8FGCY4N5mn2MNNYUVRNV8S8wvdbUtXV34vyDVuw7g/rPGO89HPf6BD3I59U6ptJHRbex4UeM7IHQURMOPKdJoDNWmxB2TTC+G4aeQAKRwakJPnQguF7zufcY2dfZth5yf0o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712350166; c=relaxed/simple; bh=Uj0xHs/QTrbiYnPbS02sV+ugvX08VA6WObmU7km1zXc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=meJoBK2FepwL9CnI2UnT5plagnT7uE6daxBiNJIOMICih0miMfb8g1ilG5R2lT0tjlq32vtWe9wyGorVEciZ5qBVfusr8gumi9vFWfwBCUuv/t202CqRa2W/79M3TEmzMnboufd+8ftABKBBkTc8CBVI2c8ziruC7DBteu/Q4r0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=akS4L/ax; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46CA2C433C7; Fri, 5 Apr 2024 20:49:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712350165; bh=Uj0xHs/QTrbiYnPbS02sV+ugvX08VA6WObmU7km1zXc=; h=From:To:Cc:Subject:Date:From; b=akS4L/axZhyEypj9uBgZX0ctrH5px85d87/hs5PD3DCE4fnvGTlsvagiyE7jqU2qd d7M82DW6EZ4lfKJh4g3diKiRwxdIHBRK5yKC8DdXcxOPDIRbtbs/Lz53lG74JBoKPj fRw9TOUjdccQD688WoLeFTYrHVwC9yHDip1n7tkfWscWBEjd86BlEB4oBu52v0es+o Ui0j0VgAxE44tIn1Y2CvU2HxEp9F4MLvt0Qx3XIR21JUVWOUxM71zs9ko5Hf+SMqiu c414Hn2VodLEmdLhGG5kt/f27ANT/8Ntjn5zhgDlPAxwzCAhuFqBkcK+9+fuP8sIf5 s9NwMMylHbrfA== From: Arnd Bergmann To: Borislav Petkov Cc: Arnd Bergmann , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Ashok Raj , Nathan Fontenot , Paolo Bonzini , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] x86: microcode: avoid -Wformat warning with clang-15 Date: Fri, 5 Apr 2024 22:49:07 +0200 Message-Id: <20240405204919.1003409-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann Older versions of clang show a warning for amd.c after a fix for a gcc warning: arch/x86/kernel/cpu/microcode/amd.c:478:47: error: format specifies type 'unsigned char' but the argument has type 'u16' (aka 'unsigned short') [-Werror,-Wformat] "amd-ucode/microcode_amd_fam%02hhxh.bin", family); ~~~~~~ ^~~~~~ %02hx In clang-16 and higher, this warning is disabled by default, but clang-15 is still supported, and it's trivial to avoid by adapting the types according to the range of the passed data and the format string. Fixes: 2e9064faccd1 ("x86/microcode/amd: Fix snprintf() format string warning in W=1 build") Signed-off-by: Arnd Bergmann --- arch/x86/kernel/cpu/microcode/amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index 13b45b9c806d..620f0af713ca 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -465,7 +465,7 @@ static bool early_apply_microcode(u32 cpuid_1_eax, u32 old_rev, void *ucode, siz return !__apply_microcode_amd(mc); } -static bool get_builtin_microcode(struct cpio_data *cp, unsigned int family) +static bool get_builtin_microcode(struct cpio_data *cp, u8 family) { char fw_name[36] = "amd-ucode/microcode_amd.bin"; struct firmware fw; -- 2.39.2