From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF421C43334 for ; Fri, 10 Jun 2022 01:19:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0D5378D006E; Thu, 9 Jun 2022 21:19:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0847A8D0064; Thu, 9 Jun 2022 21:19:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E8DB28D006E; Thu, 9 Jun 2022 21:19:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D9E308D0064 for ; Thu, 9 Jun 2022 21:19:22 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id B76ED35BA8 for ; Fri, 10 Jun 2022 01:19:22 +0000 (UTC) X-FDA: 79560568164.13.FBA657D Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf16.hostedemail.com (Postfix) with ESMTP id 19348180038 for ; Fri, 10 Jun 2022 01:19:21 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8753DB830E0; Fri, 10 Jun 2022 01:19:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 107EEC34114; Fri, 10 Jun 2022 01:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1654823959; bh=NUfNzI+Lzqk+ZMoLBcXdIunumPdQxiKPTgtDE7N0Sgk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=k2K3VAI6SDQeixfuxmPLxZgpiSqDGd0SM+Ll9mgkEIzO4uveLGhDNJt0+TSFK+7Dy zU2YexZB9zyyJafX9UAhTSLsmxBgnx4E4qwGlBqJCxclBsikRqriCf9H277tXNvHi5 35QHlBHe+SBvbWDdRMsPbHvFhnkfmzsajDvPN4sk= Date: Thu, 9 Jun 2022 18:19:17 -0700 From: Andrew Morton To: Bill Wendling Cc: Jan Engelhardt , Bill Wendling , Tony Luck , Borislav Petkov , Thomas Gleixner , Ingo Molnar , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Phillip Potter , Arnd Bergmann , Greg Kroah-Hartman , "Rafael J. Wysocki" , Jan Kara , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jaroslav Kysela , Takashi Iwai , Nathan Chancellor , Nick Desaulniers , Tom Rix , Ross Philipson , Daniel Kiper , linux-edac@vger.kernel.org, LKML , ACPI Devel Maling List , linux-mm@kvack.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, Networking , alsa-devel@alsa-project.org, clang-built-linux Subject: Re: [PATCH 00/12] Clang -Wformat warning fixes Message-Id: <20220609181917.32e0169b3d33e42b8eb8dcac@linux-foundation.org> In-Reply-To: References: <20220609221702.347522-1-morbo@google.com> <20220609152527.4ad7862d4126e276e6f76315@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654823962; a=rsa-sha256; cv=none; b=dgLElUsogtSFc+/600pRC+sUtwX554ZqGhUpI7NFYV5dOqWvxfPJ1r7PJUjjNXysqnvqhZ JCw2g6jQWWcanuXrqrY49dJDoE+FOYEhh0v/b7cuIRm5XzjrgaDpiBXyJxHvXv2V8TmTl1 ZKMsZMUCClGIwiO1zy9YC+/fYo8O4HY= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=k2K3VAI6; dmarc=none; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654823962; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tr2XBxA4AopM6uJItb6SOeZO393dYRCTfA7nhtmk9ZY=; b=AhHSmqT1DKxl3e1gKqhxK86zoGOJtVcKrBVDG78PXxBxiBnxIIfBieeoVbQA3P0n07OySp TFUG+eTP+DnYw9ZuY2FJfRKag3JJJeKUJATXba9oaSU+2YMiTPihAB7l3Q8jpPUQ27VKk+ 5L5XgeaJUeYO8qDwkKUUHai31/FSnyk= X-Rspamd-Queue-Id: 19348180038 X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=k2K3VAI6; dmarc=none; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: dhkyagh7w9aue7rkg3sq3799b4pezbss X-Rspamd-Server: rspam02 X-HE-Tag: 1654823961-780961 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 9 Jun 2022 16:16:16 -0700 Bill Wendling wrote: > On Thu, Jun 9, 2022 at 4:03 PM Jan Engelhardt wrote: > > On Friday 2022-06-10 00:49, Bill Wendling wrote: > > >On Thu, Jun 9, 2022 at 3:25 PM Andrew Morton wrote: > > >> On Thu, 9 Jun 2022 22:16:19 +0000 Bill Wendling wrote: > > >> > > >> > This patch set fixes some clang warnings when -Wformat is enabled. > > >> > > >> tldr: > > >> > > >> - printk(msg); > > >> + printk("%s", msg); > > >> > > >> Otherwise these changes are a > > >> useless consumer of runtime resources. > > > > > >Calling a "printf" style function is already insanely expensive. > > >[...] > > >The "printk" and similar functions all have the "__printf" attribute. > > >I don't know of a modification to that attribute which can turn off > > >this type of check. > > > > Perhaps you can split vprintk_store in the middle (after the call to > > vsnprintf), and offer the second half as a function of its own (e.g. > > "puts"). Then the tldr could be > > > > - printk(msg); > > + puts(msg); > > That might be a nice compromise. Andrew, what do you think? > Sure. It's surprising that we don't already have a puts().