Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp119252lqe; Fri, 5 Apr 2024 14:59:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDspTBpmGmcwduLJJFnNlTAnaqziPHpCQXQiHVy3TVcj5/GdZL8dWeusX8hA/OrbZwI3v+ofDpwoX4JA2m+FbeIdjH02yxL/M6UeopVg== X-Google-Smtp-Source: AGHT+IGJPXCiM78LGVXFHdIEgZWy+ChDt3lwn1TAE5KXoVAGC42n1QsmkynyKWPeocy8VqUwhgSB X-Received: by 2002:ac8:5f48:0:b0:432:ec21:ad4 with SMTP id y8-20020ac85f48000000b00432ec210ad4mr2397291qta.27.1712354399069; Fri, 05 Apr 2024 14:59:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712354399; cv=pass; d=google.com; s=arc-20160816; b=Hy/FZxAnC62Fs9C8clmxzcZifjAULN1NaeKKzTfPh3mXuFuCF7E1AcPw8nkvfZPEGO MdNwqdsLlhchD6PfjE3k/EuDgORHNRvGnkQWvAKojTWOXGaZGw0NxZ/BewGFGCFqDTqi y9KicqdD0Pq4P/rX8xZC5HfLBucpEsvRz9ijFv5/01C5OmXvHY8F5+xjXDBYbAt2DbZ/ kk/32WiE+p7MaODiqCnGGSnPzs4oa5o6Ug2bk/Pm/JjoxhVKfnwNOmKwCSsDOV+uFmlI WgdBTTX3zYN80tskRISNaqxufzxBCaVktk+DBEEnQ7sRX1NIu+Tr6GxKaAFPG4roEj/p MxZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Xbd0ewn5oeu56kYYL5RJDjYhgsk2f08lNhWKZaOdWFo=; fh=ksNuo8+acEYrHBjNW9Qa0MSNLo9gipGR3QTU2LWJ0ig=; b=K509lYh8chGinAyt5QUlfrZH/F9ktLVQ5qxIAfKRtnaxQojBi1EtinX51nekOP9tNv TGY3cOM+7K2YIkfmlxk83CGAgrnxvmlrypaehqNRPwQye3xQ9SnvhG9ZQxxUCe8LFTvo mr8ElYez1lcAZ+VZyyCrHII2hjSxTMK1km6AUeZ7zG2QlJl4Zquju+tuLGy/eRZsrw/w r98qfhMiSzcMwtAuTnKIgsRVo+SUO8GbjY6TpOErBNSLOZ1JsDVCS0/JxoTblzOHLukr Q79CF0aExtDZ2JyJGDItGnEZ+6eWCtxUaanK8OthBLLqnz5/UKAIwVmuAEhwFczzJ2Bk x3qA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=uqMYqJ64; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-133659-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133659-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h11-20020ac85e0b000000b0042f2127fa75si2684833qtx.683.2024.04.05.14.59.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 14:59:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133659-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=uqMYqJ64; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-133659-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133659-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C85471C21393 for ; Fri, 5 Apr 2024 21:59:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6B4A179652; Fri, 5 Apr 2024 21:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="uqMYqJ64" Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38145176FD7 for ; Fri, 5 Apr 2024 21:55:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712354116; cv=none; b=i3WiJn2nH0Y3ILrjVmqFYqh1hSUwK3r9RS7T5J21HyryH0kErsWwVhoDq2WVT7JGtgix6DNMq7I2fufE6RGAVNMqqKGP1H9Ug+C8Z3j3ig+3SGral0v3QkxH/ZRyglwSi+uMoFtYevKv1sxe4WnCfH7JKFesfrRi67I9/DRfLNc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712354116; c=relaxed/simple; bh=fx5yqGZ4qGVFjioJ4n68AJdEgTCdOHtWI5LNomOb0zc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=uZ2Kwci5rW3MueGasidYMxRu/DeLa61qHXoTdgHQTrg7W+t7eEDRThDA3ujAgjS67jVycZ0816wK7WbdwojAwlQKvIjHg2FgNqkydIMw2gP0v5auWyh4Fz6SahNZkaxXM6BVA2M7INSk01h2HL2whJ0dBF87sbG6NYCnF4c7SP4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=uqMYqJ64; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-56e2e09fc27so2206161a12.0 for ; Fri, 05 Apr 2024 14:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712354113; x=1712958913; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Xbd0ewn5oeu56kYYL5RJDjYhgsk2f08lNhWKZaOdWFo=; b=uqMYqJ645PRkQGcaItGtnvBkpJb5WQSt2X53g6rRi2WXSub/1pQVNXbAvZo5Ha6bDw yKlUWOg6PdyUhuhYwXSA25g+CMDREmo03YoSpfYf4I5foSFBYd3Sasf6I3J6uxlqittU zTHDWwjPUm9kvD40tKrbnDcwHpFz2FWw1zfaebL3UAaoNO0I+8jVWykKc/4oudqsHSLE N2HLj7kTuSVCM/anXntVv+69tpd3xeil34ZLpFXIZ9XQq3E4HGdqAHIhzTxw4cUYH89r Tj9D/US3tpmXRFu8JkiSA0KyftTlOy9iXQI6SxlwBSqYcVfoVJoHozTJxSPS0s88/f8P lHgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712354113; x=1712958913; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xbd0ewn5oeu56kYYL5RJDjYhgsk2f08lNhWKZaOdWFo=; b=L5ABvive05qT9mlpH1dsMoBHBCWlEw9G5c8t8RJyNT8PI1rpCkat76B7edCsFH9bgR pnXCmpqEUQV5OcHuPzpM7KJMl1c7R5OI208D9CdrKJTUPXlnADsmZaP8XinSyZ5rqbQ1 cHwiFOr/zGs7Yt778zkQcpCZ3c4N6wOgZIJSw0OTzhzLRbhY83s58/pCQ1n1yea0IkNS hk2EnuQ2iaqKjRLPh3TrIFOYnx9RafTMvozvFhWCebmzZSrE3ZrTQ6gI95QQFqY9RfQo fuud67P9f5Su75r/z+W6SkKbQSdFDj3WNaI7Y1AAnQkxcGuvq5ilX+jfBw+naej5W5nJ a6oA== X-Forwarded-Encrypted: i=1; AJvYcCUjVYbw/XJ2xGQ6D2mntisDfsWCB45bPzJc1t2Q2oFNz33dG22OmVTM8j++B6CCp+y3cGM1cKCUAdEMyzhvw0vdfVOc91AH3wrTCDpQ X-Gm-Message-State: AOJu0YxDa5XKBHtAt+50+6ceZH8sl14jYQs5orWJTGqhPj9Cy2cKwcve Y4JRb+D/7wbR60R5qy5CiWrug+ymUvqznM5E+6Kzrdug5qnL4t4tMoYyVtJ4JEG9AUw3InFPF20 yluinxc1g+Mtyd9G8Pu3dESTmRLwaqyPF2sSWTjjQ2y4qkZ6g1M3A X-Received: by 2002:a50:8e5d:0:b0:56e:2c34:cff2 with SMTP id 29-20020a508e5d000000b0056e2c34cff2mr2337858edx.19.1712354113455; Fri, 05 Apr 2024 14:55:13 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240405204919.1003409-1-arnd@kernel.org> In-Reply-To: <20240405204919.1003409-1-arnd@kernel.org> From: Justin Stitt Date: Fri, 5 Apr 2024 14:55:01 -0700 Message-ID: Subject: Re: [PATCH] x86: microcode: avoid -Wformat warning with clang-15 To: Arnd Bergmann Cc: Borislav Petkov , Arnd Bergmann , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Ashok Raj , Nathan Fontenot , Paolo Bonzini , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 5, 2024 at 1:49=E2=80=AFPM Arnd Bergmann wrot= e: > > 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') [-We= rror,-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 accordin= g > to the range of the passed data and the format string. > > Fixes: 2e9064faccd1 ("x86/microcode/amd: Fix snprintf() format string war= ning in W=3D1 build") > Signed-off-by: Arnd Bergmann Yeah the family only needs a byte so this is OK. Reviewed-by: Justin Stitt > --- > 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/mi= crocode/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, u3= 2 old_rev, void *ucode, siz > return !__apply_microcode_amd(mc); > } > > -static bool get_builtin_microcode(struct cpio_data *cp, unsigned int fam= ily) > +static bool get_builtin_microcode(struct cpio_data *cp, u8 family) > { > char fw_name[36] =3D "amd-ucode/microcode_amd.bin"; > struct firmware fw; > -- > 2.39.2 >