Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2752479pxb; Sun, 28 Feb 2021 12:03:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpOrcPfQVEbI3RZ90XzU++Tw4h4RCNu7E1imbgV0nM3zSkNOCvjDYy0pt/4HFW5pMOKzh7 X-Received: by 2002:aa7:cf90:: with SMTP id z16mr3842481edx.273.1614542587492; Sun, 28 Feb 2021 12:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614542587; cv=none; d=google.com; s=arc-20160816; b=Bqf3AN01+uBPT++JQfXbMCCnWCK6y6nPlcs+XvGx1D2ybVZ2flpYU+gWBZaNv55fyO MmwOnjyyuFugRhPj2xzmJeA5wIyLDOpQ9ulh+ZtaC3DvULr1jEM/cUkeeGW5HumXjiiW r6U3VoHGUz9C7OkC2Ix0qtwrGnhVUEl6tZZWpwPX39mT3enagwfE42rr9YMD/bknHSTg 95y3owZC4VMnivzWYfH0JBYZTgWDZLLFyG7RIPbAa0iXDgnExIq0JXRE2QKOJAp2wI4V UUWdwevwwpUDmi/eod5dos+kSP+b3foYKX3eu8bliSC2ONILNgpz2rgllV/3JbtLjP4S kZaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ppGDpTFzSXWWlGE51pox82buiuX04gD9pOg1/3MREt0=; b=Cz36tr62d8CZIwzCenw3NzAZAKANenPNK6TtJT99sa+6wzXDfOUlryFhfLKPEmcbLV Ri63tb8WZINsNoRDVKMVYKTof1QbAiz1S0i32EqRujcBChXiujIcS1I3DOGBqLhCep8F Ybn+PlTuYN8Al8gVKhFvgcR/bqhHqEovJlZqkKFh8vC13TdnE4Bu+Vw4GdVMShYdZFgH 4N37p6af1FY4ilzWlBY/SJ0iBEHuDCZevbtZTTbsJEddpYz41wzja6I/IkgLxMfNzY/4 m1N8FmylQ91FsZKKNh450DY3nT7+EHxd1edcLjJKktb83oukT5mdkRiBTgNu6H6OYIYV iqXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=fzIMkkwc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si10565565ejx.485.2021.02.28.12.02.43; Sun, 28 Feb 2021 12:03:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=fzIMkkwc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230460AbhB1Sif (ORCPT + 99 others); Sun, 28 Feb 2021 13:38:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230222AbhB1Sie (ORCPT ); Sun, 28 Feb 2021 13:38:34 -0500 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B849DC061756 for ; Sun, 28 Feb 2021 10:37:53 -0800 (PST) Received: by mail-ed1-x533.google.com with SMTP id b13so8579372edx.1 for ; Sun, 28 Feb 2021 10:37:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ppGDpTFzSXWWlGE51pox82buiuX04gD9pOg1/3MREt0=; b=fzIMkkwc6VXyZF+e5HqKudARIH8IhkbVBJP3UmfsNZH67f1544pHFaGHfwP/FO36aI eTSEfVcBj+15O4ZH9c65NPAXPNS3HPUC/Lm6ORbep6aFgY9jZXo9hKM0YDEubl3+QEEZ CTINTi3RBSFnHKFgHzTHtKafez9J1PpeLBJgvLAMNYRdB+n/LXfvrTkSGFjkKSvOOACN lQ+pJPOjN0mQW6ezEaU7zEYzzEYj97uZ8TZJy1kw/65Ggsci3ud9bVJe2aGxqI+x28ZU XhGu8leiG3yJ2v35aoyo/GnuI1DqaQTUDEY1OwvcWuHmN18TQj7bw84yqAETo1MoFfPz ZqbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ppGDpTFzSXWWlGE51pox82buiuX04gD9pOg1/3MREt0=; b=U2yeqO6PnYHRjee5O8X8/a7GEASUp9PFjWVz1pkn5vBmREv3Lyjt6O7GOKmUSxa96W sNSqvEqHuBY2eIitmthimk4Ro/O8FtFrnEEReOUjZLQYDce8V60n2Ufwk7PpJ+LJedN4 JcaYQSmrWil/pPB4TjEGW6TEuQi3ZFYzPVg/bsGB5fwyz+y46KYxK1Q/gpMmbYKQlEQy 43MfS5zliwcD23Srls6y0EXQTZGg1iKx3EQZggmeqpS8rHujApmAMof/OZRiacwY2bQg IQOElSJf2GLLJK1uwEdvZrdbwoZXtYXMLht74f/MdUC5vo6EvpFErBdoBf38ECdsoVdz O91Q== X-Gm-Message-State: AOAM533a/zNVQsedH9HAWNJyRR02+S0sBDDlbf0Z7YBbdxCVDncxsBIO WzWN38ABIHm9YWuB492P5MqgxZCCVSHa0YCG/c19 X-Received: by 2002:a05:6402:c96:: with SMTP id cm22mr13096764edb.128.1614537472148; Sun, 28 Feb 2021 10:37:52 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Paul Moore Date: Sun, 28 Feb 2021 13:37:41 -0500 Message-ID: Subject: Re: [PATCH 09/11] pragma once: convert scripts/selinux/genheaders/genheaders.c To: Alexey Dobriyan Cc: Linus Torvalds , linux-kernel@vger.kernel.org, akpm@linux-foundation.org, Stephen Smalley , Eric Paris , selinux@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 28, 2021 at 12:04 PM Alexey Dobriyan wrote: > > From 097f2c8b2af7d9e88cff59376ea0ad51b95341cb Mon Sep 17 00:00:00 2001 > From: Alexey Dobriyan > Date: Tue, 9 Feb 2021 00:39:23 +0300 > Subject: [PATCH 09/11] pragma once: convert scripts/selinux/genheaders/genheaders.c > > Generate security/selinux/flask.h and security/selinux/av_permissions.h > without include guards. > > Signed-off-by: Alexey Dobriyan > --- > scripts/selinux/genheaders/genheaders.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) My LKML subscription must have died at some point due to mail bounces, or maybe I dopped it (?), because I'm not seeing the rest of this patchset for context. However, unless the rest of the kernel transitions to this, or there is some other big win that I'm missing, I don't see much of a reason for this; can you provide some compelling reason for why we should make this change? A quick search on "#pragma once" seems to indicate it is non-standard, so why replace the simple #ifdef/#define solution for this? > diff --git a/scripts/selinux/genheaders/genheaders.c b/scripts/selinux/genheaders/genheaders.c > index f355b3e0e968..e13ee4221993 100644 > --- a/scripts/selinux/genheaders/genheaders.c > +++ b/scripts/selinux/genheaders/genheaders.c > @@ -74,8 +74,8 @@ int main(int argc, char *argv[]) > initial_sid_to_string[i] = stoupperx(s); > } > > + fprintf(fout, "#pragma once\n"); > fprintf(fout, "/* This file is automatically generated. Do not edit. */\n"); > - fprintf(fout, "#ifndef _SELINUX_FLASK_H_\n#define _SELINUX_FLASK_H_\n\n"); > > for (i = 0; secclass_map[i].name; i++) { > struct security_class_mapping *map = &secclass_map[i]; > @@ -109,7 +109,6 @@ int main(int argc, char *argv[]) > fprintf(fout, "\treturn sock;\n"); > fprintf(fout, "}\n"); > > - fprintf(fout, "\n#endif\n"); > fclose(fout); > > fout = fopen(argv[2], "w"); > @@ -119,8 +118,8 @@ int main(int argc, char *argv[]) > exit(4); > } > > + fprintf(fout, "#pragma once\n"); > fprintf(fout, "/* This file is automatically generated. Do not edit. */\n"); > - fprintf(fout, "#ifndef _SELINUX_AV_PERMISSIONS_H_\n#define _SELINUX_AV_PERMISSIONS_H_\n\n"); > > for (i = 0; secclass_map[i].name; i++) { > struct security_class_mapping *map = &secclass_map[i]; > @@ -136,7 +135,6 @@ int main(int argc, char *argv[]) > } > } > > - fprintf(fout, "\n#endif\n"); > fclose(fout); > exit(0); > } > -- > 2.29.2 -- paul moore www.paul-moore.com