Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1206235rdg; Fri, 11 Aug 2023 13:23:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEST7/Wr7c3k5pYXrx0TrhlpEA8FlD+V7BsNAuUIw6iSyj74SwKewZNdmfcP+5G21i0YuFm X-Received: by 2002:a19:4f58:0:b0:4fc:6e21:ff53 with SMTP id a24-20020a194f58000000b004fc6e21ff53mr2092082lfk.11.1691785421658; Fri, 11 Aug 2023 13:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691785421; cv=none; d=google.com; s=arc-20160816; b=RuWnYHxzroScQpjT0knL97cr6BgK9XSy8m/rfFHP3mG+c8NGxlDFghmGPp7v1PMZKR c8TEgLyI66jeMYhagxy7tAQPveM7JOc8i/gV0iGV3qDMWY6gC6jn6ZRg9MJnWc66F2s6 2LMHmsKlPmrgKvIG1YV8BXTcOyzl0zsIeeG7hExW2Kh4vFgojLJDFiAt+l//KwU8p0Qd N/KRuqf1Uxi34bqj0baxNxQcPcp766YvcUA5wQqNPe1pOnzj7giJVX4y1zZ5xAyFz+2A Jq87KFwI9S2+gI83lITsa3SMCBPoya8rDo3HNvc/akRapYBjtxNUwsWGJ2GLCtzRi6tp NBIw== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=VB1SsgP/eWMfrWQCoLT7rmh3vb+lh0Mjm7Mxw7P3lcA=; fh=kvhjJTX8CmxQXKxxibIvQRB5+NAF6B/kynvRb4mt4WA=; b=lRQFcbobQLtLSl5dXauNA3r3wPZUvr+gkMa84PKcmhpRxRszQ2QkO0SyGRpLnPbOQl BMndCNFpKYlhS2TwdCXamW3KW9+MJquYgsi7SQANm77ueKtIy58kXeqji8OKTBq8rdtq FYkcxAuZLE6aX+xkjsWDzpSr2aW8BtFfv/fp3hXtJKbGFUk19wUxsCSaVz6SlJWEuqcs RV+OAAkMBE/w7RfRycp2W92mu7s+G6oZZwc0RibZ8XkagRgak6GXyFIKmLcP8DNeD0eE xp43p6Bf2GWNFnuwaD3CKAJlkAbeRcDZ/gwXLn7x+KrgraBOXFrKqixMCb69vRPMTbKm WYBQ== 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 y19-20020a50e613000000b00523b8072776si2907189edm.121.2023.08.11.13.23.17; Fri, 11 Aug 2023 13:23: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 S236771AbjHKT2W (ORCPT + 99 others); Fri, 11 Aug 2023 15:28:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231126AbjHKT2V (ORCPT ); Fri, 11 Aug 2023 15:28:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 702D130E6 for ; Fri, 11 Aug 2023 12:28:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0E3BC67961 for ; Fri, 11 Aug 2023 19:28:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21C71C433C7; Fri, 11 Aug 2023 19:28:19 +0000 (UTC) Date: Fri, 11 Aug 2023 15:28:17 -0400 From: Steven Rostedt To: Rasmus Villemoes Cc: Andy Shevchenko , Petr Mladek , Marco Elver , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, Sergey Senozhatsky , Alexander Potapenko , Dmitry Vyukov , Andrew Morton Subject: Re: [PATCH v2 2/3] lib/vsprintf: Split out sprintf() and friends Message-ID: <20230811152817.010e1da3@gandalf.local.home> In-Reply-To: <37faa9c7-94a3-3ea1-f116-6ff5cdf021cd@rasmusvillemoes.dk> References: <20230805175027.50029-1-andriy.shevchenko@linux.intel.com> <20230805175027.50029-3-andriy.shevchenko@linux.intel.com> <67ddbcec-b96f-582c-a38c-259234c3f301@rasmusvillemoes.dk> <37faa9c7-94a3-3ea1-f116-6ff5cdf021cd@rasmusvillemoes.dk> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS autolearn=no 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 Thu, 10 Aug 2023 16:17:57 +0200 Rasmus Villemoes wrote: > > Btw, it's easy to enforce IIUC, i.e. by dropping > > > > #ifndef _FOO_H > > #define _FOO_H > > #endif > > > > mantra from the headers. > > > > No, you can't do that, because some headers legitimately include other > headers, often for type definitions. Say some struct definition where > one of the members is another struct (struct list_head being an obvious > example). Or a static inline function. > > We _also_ don't want to force everybody who includes a.h to ensure that > they first include b.h because something in a.h needs stuff from b.h. > > So include guards must be used. They are a so well-known idiom that gcc > even has special code for handling them: If everything in a foo.h file > except comments is inside an ifndef/define/endif, gcc remembers that > that foo.h file has such an include guard, so when gcc then encounters > some #include directive that would again resolve to that same foo.h, and > the include guard hasn't been #undef'ed, it doesn't even do the syscalls > to open/read/close the file again. I hope Andy was just joking with that recommendation. -- Steve