Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1206407iol; Fri, 10 Jun 2022 02:33:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWM3EP1lo2eQGIYy6EQLEaY1aJWj5gDkvdfm/9z9sujkIk0eSOlupvGfJaJ6RntYOlxpsJ X-Received: by 2002:a17:902:db0a:b0:165:1299:29ea with SMTP id m10-20020a170902db0a00b00165129929eamr44291130plx.15.1654853621799; Fri, 10 Jun 2022 02:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654853621; cv=none; d=google.com; s=arc-20160816; b=SlWlBRP//lVx3qz12L3ik9IksZt9gxs2BxnGV8uqX/En9mjKvx3+bvAX0faD+0ece8 5zEuZ7p50UCX4YAHiCFWVU8wvt0wCLpYDcgH/4NfiUW/bYnPhPeeuQ6hUcWLh2bJbR6z 3RjC/SACx7U+jpZpUa2sOtgkRdQMD6PhYrfAj0k/4Bfd5RgPjSUuBwE3d/frNUvtelme 6kbmSHqhQKOIau6OXpRFcJDe78fLgvxS9tHJYpYVExZIe5whkdswH0Vdfilwc9m7R4q8 nsTlHG1cy4QDcxAgUZGpLDvNFFnD1pz8j9C+se796U42I8IEyk02gaTmTGbzUglWFGsz UpAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date; bh=WZjj1Of6WPSX5FyLjQvJ+YXcFxWE/AFSY85ZlhirO9s=; b=owUA6zCcaNRlUPN3HN9p/g35yEmsZeiUr0oxw01GU44QeJwXGoPAEEQ6bp/zk83TzD Eoj4yqqTOk6pdrTyZ3KgLWG8ZNeHwRzmKTDPNhsgPnDobdx05GV6v11t4TvWZ/pk/mCR uoJsytapkaqsFQnboXgthduSgLNWnPMculWvWmgIs3xhOV90pQERd+SPf4WUjhC6AIUy 8NU7LWnOnznOsiMqJ1sz3qLuCHKn9jYoDnEHa6mKibOzIjgsOP/Kh0TiiOrYf5f1KPPT 6iPy5+mhxTIEWfuUJLvVole1Eb4hBKno+KcOnm9aIPR0sYmaypshAgC/XkjI56F28O5i 3ObA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a637a4d000000b003c5e1a93396si7654116pgn.289.2022.06.10.02.33.28; Fri, 10 Jun 2022 02:33:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347386AbiFJJZr (ORCPT + 99 others); Fri, 10 Jun 2022 05:25:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349762AbiFJJYX (ORCPT ); Fri, 10 Jun 2022 05:24:23 -0400 Received: from a3.inai.de (a3.inai.de [IPv6:2a01:4f8:10b:45d8::f5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD513158744; Fri, 10 Jun 2022 02:22:47 -0700 (PDT) Received: by a3.inai.de (Postfix, from userid 25121) id 7182C5872870F; Fri, 10 Jun 2022 11:22:46 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by a3.inai.de (Postfix) with ESMTP id 70A0760C247D5; Fri, 10 Jun 2022 11:22:46 +0200 (CEST) Date: Fri, 10 Jun 2022 11:22:46 +0200 (CEST) From: Jan Engelhardt To: David Laight cc: 'Bill Wendling' , Andrew Morton , 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 In-Reply-To: <724889aa6a8d4d41b8557733610c7657@AcuMS.aculab.com> Message-ID: References: <20220609221702.347522-1-morbo@google.com> <20220609152527.4ad7862d4126e276e6f76315@linux-foundation.org> <01da36bfd13e421aadb2eff661e7a959@AcuMS.aculab.com> <724889aa6a8d4d41b8557733610c7657@AcuMS.aculab.com> User-Agent: Alpine 2.25 (LSU 592 2021-09-18) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 2022-06-10 11:14, David Laight wrote: >> >Yep, IMHO definitely should be fixed. >> >It is even possible that using "%s" is faster because the printf >> >code doesn't have to scan the string for format effectors. >> >> I see no special handling; the vsnprintf function just loops >> over fmt as usual and I see no special casing of fmt by >> e.g. strcmp(fmt, "%s") == 0 to take a shortcut. > >Consider the difference between: > printf("fubar"); >and > printf("%s", "fubar"); >In the former all of "fubar" is checked for '%'. >In the latter only the length of "fubar" has to be counted. To check the length of "fubar", printf first needs to know that there even is an argument to be pulled from the stack, which it does by evaluating the format string. So, in fairness, it's more like: >> In the latter, all of "%s" is checked for '%'.