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 9EF03C433EF for ; Thu, 9 Jun 2022 22:49:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C5E768D005F; Thu, 9 Jun 2022 18:49:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE6AB8D0034; Thu, 9 Jun 2022 18:49:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A87428D005F; Thu, 9 Jun 2022 18:49:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9A07D8D0034 for ; Thu, 9 Jun 2022 18:49:35 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 6E63735AE7 for ; Thu, 9 Jun 2022 22:49:35 +0000 (UTC) X-FDA: 79560190710.04.EBC5E32 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by imf07.hostedemail.com (Postfix) with ESMTP id 116F640045 for ; Thu, 9 Jun 2022 22:49:34 +0000 (UTC) Received: by mail-lf1-f49.google.com with SMTP id w20so18531223lfa.11 for ; Thu, 09 Jun 2022 15:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OAj7kkMIiekJ9rTKt4JAtAfIGa2quITOg+UqYlGq1Vc=; b=h+XSjN/WVesJqDJFOPBbUOjCsElze90l5AUaZpaMfQE4BCHJP6262qTzyHWJva9Bl7 Ylea2b1VMRtuu3W6K04USb5N4DyE9/FJG1TJX23DJAAyMpmTkNe0IhcujfXyw2tL6Yzm 5AoAwHI63jQHxPEb7KgmYY7AsIWc/AhRsgnJ71aDa/ZsS0NcL3wur4vFJaN8UMyAklRE aEGCgipKXq1q5OQuT+b1/Z3ZAjDVwg+cOz821DhKZdc3CbTWkxewf2eBhHZ6cA8kCpl2 vQoxv4lOBXpPPrGtb7sLkscBoEWxzlYML194UCnlDBfFSziOT58BYv12MhyX6zYq7k9Z Vkrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OAj7kkMIiekJ9rTKt4JAtAfIGa2quITOg+UqYlGq1Vc=; b=Jl/C7gJ4C7zKfd+3WaBc0bvObLm7NICzOPG+I67py0TDPySU2kzpnRmIFW/3hiGDVP zDnqunxWcAjUjJmbDYjTCgGWRXpaDSD0E/1alM7CHA9ZyGho8t0OInmIshSp9byqBDRF n22kbg2axtR9wnBQnYjmddpOY9HuAPe1JlAmyp7I6th/F/haUpfYcXewLZ2ZfcF8CH/v EhJ3cEty+8jdKhQpJCib7sPLwtmS106dQAXIUaW9rzNr25GB5Nx7Xmxlx1NXALbJEH0r 1ILSmo4huvq3VBbXPlKdSUYo83/LvHnA+23juffaiFiWv3vpq2cjbgDv62LkbDRwqJuM UiQw== X-Gm-Message-State: AOAM533W0lvDEEvVAtCwxbe9lQIyFIT+F4dfXbqHs9MdFdWKswkheWRH TtGkst6H3Hbubb6sERUQbahYiGNBNIsfh2HvbvH/ X-Google-Smtp-Source: ABdhPJxZXTnzcCwuX2K8dXo0GsWxPjCKHZ8xLR+ukHeOsc32GB8PW2KE6FFGhS4Nls3KDQ2FUv5nfKYIhCIQyfCKYvU= X-Received: by 2002:a05:6512:114e:b0:479:1e02:9318 with SMTP id m14-20020a056512114e00b004791e029318mr20896704lfg.156.1654814973186; Thu, 09 Jun 2022 15:49:33 -0700 (PDT) MIME-Version: 1.0 References: <20220609221702.347522-1-morbo@google.com> <20220609152527.4ad7862d4126e276e6f76315@linux-foundation.org> In-Reply-To: <20220609152527.4ad7862d4126e276e6f76315@linux-foundation.org> From: Bill Wendling Date: Thu, 9 Jun 2022 15:49:21 -0700 Message-ID: Subject: Re: [PATCH 00/12] Clang -Wformat warning fixes To: Andrew Morton Cc: 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 Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654814975; a=rsa-sha256; cv=none; b=4u0Uy3jVE/shMPipV286iNZbb5H4CpaxDlrw16pYBljwFFI1GeAX47Jsq8Msab/7FOYy6v jGbT15Nz+8aNwd+ml0qBNQHJxRcFn06jmwxKG/vhMYNny0h8FxDv9JgBPbtQtnj2/XfdGm RF9SQXPKX0RlNy8DyIeqPqsiSByI3e8= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="h+XSjN/W"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf07.hostedemail.com: domain of morbo@google.com designates 209.85.167.49 as permitted sender) smtp.mailfrom=morbo@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654814975; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=OAj7kkMIiekJ9rTKt4JAtAfIGa2quITOg+UqYlGq1Vc=; b=XjEWM3TEJq4SlgZNnZYCmD2C8l0+BNNHzE1lTZR6qIm72EuxdCy0oUZt7YLtE5qTFwQpX3 CLcVTJ5XjnGzwtL9EBtK2QCwzjEgxyMHiPp0hRGqQwKvlHNHp4K5B+IDRMd+/zvUcVQ4w2 2YPq+asvfPDQ842FAeNgzfDz1BVHtHs= X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 116F640045 Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="h+XSjN/W"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf07.hostedemail.com: domain of morbo@google.com designates 209.85.167.49 as permitted sender) smtp.mailfrom=morbo@google.com X-Stat-Signature: o1rq83b5ogrzaid1ooi56mytxux4fhmm X-HE-Tag: 1654814974-252590 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, 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); > > the only reason to make this change is where `msg' could contain a `%'. > Generally, it came from userspace. It helps kernel developers not accidentally to insert an unescaped '%' in their messages, potentially exposing their code to an attack vector. > Otherwise these changes are a > useless consumer of runtime resources. Calling a "printf" style function is already insanely expensive. :-) I understand that it's not okay blithely to increase runtime resources simply because it's already slow, but in this case it's worthwhile. > I think it would be better to quieten clang in some fashion. 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. -bw