From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (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 D5A013E3176 for ; Tue, 24 Mar 2026 10:37:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774348682; cv=none; b=DpuDwMkfFuykaQQHa12DaDA+N+yjXcwLyRVygj3mUJ+1cSEOchxLECzMzR5cxfzf6e+7es3yD/Ap5GsL8TuVtIyHx6GTOUI7f9J6C7hzKYlvZ/0GNB8VutNw9qutBtMXX8tHbKnrgx9BYuEER89rFHRNvG7QHk9jPr4Mob2+vNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774348682; c=relaxed/simple; bh=7hKPAkTc8gkuKOQeOc2hw2B+zsm8HxW7BXmCLFr4IFs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=kw6eALFaS7wIibZbloivJGvPoMPCK73jvpx2sWlD/kY7DjKkMOnSb7yquZ9zxmPzhLAOHk05UI+L9ktA6EWId7Lth6q33+hVINcwWQRv1v5UxI4RGqr7rk2+GYnhMNhtktcN4M6OamZ4MfrXSkNym9ly1bxqO8Wt0MNHyHLWG2s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=dY3tPkUm; arc=none smtp.client-ip=209.85.221.73 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=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="dY3tPkUm" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-43b3a675316so967307f8f.0 for ; Tue, 24 Mar 2026 03:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774348678; x=1774953478; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ame1i2/P4uZZyXa5AdsReLRcEu535+ZYZ78TZbZKy1c=; b=dY3tPkUmc+SKsTQLblxW9evfl7IKrdBR8qhG5H6QLNM+0uw5TYmcODklYzuEVpNGqQ DAZNtBvnZOE+w0z2cv0PziM93H7UuddWQvP0D0zalPyu9YOsx8ScektTEODEC5RtTF24 +HXHjeuDhFHmi0kgCAZ7kwD/RsXb/TG8xPSK+Ynd091fvRufGG4JCKxHzgXzdT3x8vXO mbYNLe0lGp+/4M60MHifTXDFd5qj8MSvHDGotaSxm9MHjl6DD/nYk/3ZJc3DLl2srw9k ByCUUdcAUFvlOl50Em9i09wY9cXjMpWkD0zRiu0nW5WEJPtrHkgKysf4craLBaLnXLX0 GeTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774348678; x=1774953478; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ame1i2/P4uZZyXa5AdsReLRcEu535+ZYZ78TZbZKy1c=; b=Ch73xTpTEgGMQvvz86Q3vMJgcl+YWB2GFz6Z67QvAWlwf6tNWdunZMuf6sor8+IvJ7 O2bh2lf45YQWZNDtTlfCzFhmQlqqEAYa6QON94vS8L40wHcY4+fiBgQhwYtqkFX5A8Jc 5F/3UY1r5qxd2LXMDrzdtJFamCLM7ZItxrW0/MvTJafnsQPWv1PrgyzUCDW3HUz21sWS UZpfIG0eRbLGszNCuzRT24BNtrCNuZ4umL5f3D0Glik9SVBmKXL2fV3z1EVN3LqFOVMu /nTfIorvJf1dkdCEvrexmYnnXOfZt8u2OiJyDwCuXrZsZOb1BB5BxyC4d//aEVX1WurH h/vw== X-Forwarded-Encrypted: i=1; AJvYcCVqJNrHZhKozJghhibna5IFU6PqqR926e1Qa52g/gIJ1Y58WTxasdz0zMNlKYyZKYkoNLuzkQq83H79vn4=@vger.kernel.org X-Gm-Message-State: AOJu0YzbYGMXejiSy7p4QV7ZouOYbZgpba+8awilHprno6F03AY6CVCQ sbfNeYc8Yv+V6C4qziVjLaH66c54n/aLa7F2+oOYqOARzkSYdtaBGKYNhCtaf0AdMonfaAPlOmQ tYOSlOpZLHffhZQ== X-Received: from wrwj1.prod.google.com ([2002:a5d:5641:0:b0:439:c0d7:17ff]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:2383:b0:43b:445f:3177 with SMTP id ffacd0b85a97d-43b6427db29mr24920980f8f.31.1774348677529; Tue, 24 Mar 2026 03:37:57 -0700 (PDT) Date: Tue, 24 Mar 2026 10:37:56 +0000 In-Reply-To: <20260323205534.1284284-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260323205534.1284284-1-arnd@kernel.org> X-Mailer: aerc 0.21.0 Message-ID: Subject: Re: [PATCH] [v2] bug: avoid format attribute warning for clang as well From: Brendan Jackman To: Arnd Bergmann , Andrew Morton , Nathan Chancellor , Brendan Jackman , Ingo Molnar , "Peter Zijlstra (Intel)" Cc: Arnd Bergmann , Andy Shevchenko , Nick Desaulniers , Bill Wendling , Justin Stitt , , Content-Type: text/plain; charset="UTF-8" On Mon Mar 23, 2026 at 8:55 PM UTC, Arnd Bergmann wrote: > From: Arnd Bergmann > > Like gcc, clang-22 now also warns about a function that it > incorrectly identifies as a printf-style format: > > lib/bug.c:190:22: error: diagnostic behavior may be improved by adding the 'format(printf, 1, 0)' attribute to the declaration of '__warn_printf' [-Werror,-Wmissing-format-attribute] > 179 | static void __warn_printf(const char *fmt, struct pt_regs *regs) > | __attribute__((format(printf, 1, 0))) > 180 | { > 181 | if (!fmt) > 182 | return; > 183 | > 184 | #ifdef HAVE_ARCH_BUG_FORMAT_ARGS > 185 | if (regs) { > 186 | struct arch_va_list _args; > 187 | va_list *args = __warn_args(&_args, regs); > 188 | > 189 | if (args) { > 190 | vprintk(fmt, *args); > | ^ > > Revert the change that added a gcc-specific workaround, and instead add > the generic annotation that avoid the warning. > > Fixes: d36067d6ea00 ("bug: Hush suggest-attribute=format for __warn_printf()") > Suggested-by: Andy Shevchenko > Suggested-by: Brendan Jackman > Link: https://lore.kernel.org/all/20251208141618.2805983-1-andriy.shevchenko@linux.intel.com/T/#u > Signed-off-by: Arnd Bergmann Thank you, Reviewed-by: Brendan Jackman