From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kees Cook Date: Fri, 29 May 2020 01:23:19 -0700 Subject: [Ocfs2-devel] [PATCH 06/13] ocfs2: use new sysctl subdir helper register_sysctl_subdir() In-Reply-To: <20200529074108.16928-7-mcgrof@kernel.org> References: <20200529074108.16928-1-mcgrof@kernel.org> <20200529074108.16928-7-mcgrof@kernel.org> Message-ID: <202005290121.C78B4AC@keescook> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Luis Chamberlain Cc: jack@suse.cz, rafael@kernel.org, airlied@linux.ie, amir73il@gmail.com, clemens@ladisch.de, dri-devel@lists.freedesktop.org, joseph.qi@linux.alibaba.com, sfr@canb.auug.org.au, mark@fasheh.com, rdna@fb.com, yzaikin@google.com, arnd@arndb.de, intel-gfx@lists.freedesktop.org, julia.lawall@lip6.fr, jlbec@evilplan.org, rodrigo.vivi@intel.com, nixiaoming@huawei.com, vbabka@suse.cz, axboe@kernel.dk, tytso@mit.edu, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, ebiederm@xmission.com, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, ocfs2-devel@oss.oracle.com, viro@zeniv.linux.org.uk On Fri, May 29, 2020 at 07:41:01AM +0000, Luis Chamberlain wrote: > This simplifies the code considerably. The following coccinelle > SmPL grammar rule was used to transform this code. > > // pycocci sysctl-subdir.cocci fs/ocfs2/stackglue.c > > @c1@ > expression E1; > identifier subdir, sysctls; > @@ > > static struct ctl_table subdir[] = { > { > .procname = E1, > .maxlen = 0, > .mode = 0555, > .child = sysctls, > }, > { } > }; > > @c2@ > identifier c1.subdir; > > expression E2; > identifier base; > @@ > > static struct ctl_table base[] = { > { > .procname = E2, > .maxlen = 0, > .mode = 0555, > .child = subdir, > }, > { } > }; > > @c3@ > identifier c2.base; > identifier header; > @@ > > header = register_sysctl_table(base); > > @r1 depends on c1 && c2 && c3@ > expression c1.E1; > identifier c1.subdir, c1.sysctls; > @@ > > -static struct ctl_table subdir[] = { > - { > - .procname = E1, > - .maxlen = 0, > - .mode = 0555, > - .child = sysctls, > - }, > - { } > -}; > > @r2 depends on c1 && c2 && c3@ > identifier c1.subdir; > > expression c2.E2; > identifier c2.base; > @@ > -static struct ctl_table base[] = { > - { > - .procname = E2, > - .maxlen = 0, > - .mode = 0555, > - .child = subdir, > - }, > - { } > -}; > > @r3 depends on c1 && c2 && c3@ > expression c1.E1; > identifier c1.sysctls; > expression c2.E2; > identifier c2.base; > identifier c3.header; > @@ > > header = > -register_sysctl_table(base); > +register_sysctl_subdir(E2, E1, sysctls); > > Generated-by: Coccinelle SmPL > > Signed-off-by: Luis Chamberlain > --- > fs/ocfs2/stackglue.c | 27 ++++----------------------- > 1 file changed, 4 insertions(+), 23 deletions(-) > > diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c > index a191094694c6..addafced7f59 100644 > --- a/fs/ocfs2/stackglue.c > +++ b/fs/ocfs2/stackglue.c > @@ -677,28 +677,8 @@ static struct ctl_table ocfs2_mod_table[] = { > }, > { } > }; > - > -static struct ctl_table ocfs2_kern_table[] = { > - { > - .procname = "ocfs2", > - .data = NULL, > - .maxlen = 0, > - .mode = 0555, > - .child = ocfs2_mod_table > - }, > - { } > -}; > - > -static struct ctl_table ocfs2_root_table[] = { > - { > - .procname = "fs", > - .data = NULL, > - .maxlen = 0, > - .mode = 0555, > - .child = ocfs2_kern_table > - }, > - { } > -}; > + .data = NULL, > + .data = NULL, The conversion script doesn't like the .data field assignments. ;) Was this series built with allmodconfig? I would have expected this to blow up very badly. :) -- Kees Cook 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 X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A995C433E0 for ; Fri, 29 May 2020 08:25:08 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48CC82075A for ; Fri, 29 May 2020 08:25:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="V5cw7BLL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48CC82075A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 49YHgQ1wZqzDqd2 for ; Fri, 29 May 2020 18:25:06 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::1044; helo=mail-pj1-x1044.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=V5cw7BLL; dkim-atps=neutral Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49YHdT5WwPzDqbW for ; Fri, 29 May 2020 18:23:24 +1000 (AEST) Received: by mail-pj1-x1044.google.com with SMTP id fs4so917249pjb.5 for ; Fri, 29 May 2020 01:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AIdQINovPOSOTJO7LcbhlxJUhgtHjantuh4CQ+iWOIk=; b=V5cw7BLL23TyvF7XSXItctQqYMbZHnd3YzoANtt528V7qq7xu1e8i/d5BPhYuuzcJA S4SZfsMhz56qz6LHdqb9P3YxO98X4/nyW5suGrtljbQRKiFaxDCQddMjE6qySAsDecYm 59mGjrKtcG0wLlb2EG+x0AmjGyZj6GcSpchSs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AIdQINovPOSOTJO7LcbhlxJUhgtHjantuh4CQ+iWOIk=; b=AtITElXN6pQYv2IrSHZRMokJGG5/6R6l049inp1kawxN65ZgAmRAH66rKeQkgWt3u4 jhzodW4fkGzvYiLjTB/UgMOHaIxxqx6vhNLv0Zg3Zo/OONZxTgtvi3vy6jFT7YIEIxwn hbWD8xm4KGVLlLp94iny1/1I4ivG7/0Wh/+zNi8XkO/VSF3ioAktlfoDjf8jgw2Jnr6t xamRjY0UzXevfqWnYO4t3qPkU/fM2n5Cu7tWh0nFco8K+M+LNP1ZMgkAwij+zDH49rSS vev1N1ehmzXeYi4KYvHB0crgOmQcGpav465QH/Fanx1T9yAI0zj0+ZoDc6ZwXqNykW4x U8lA== X-Gm-Message-State: AOAM5323KrOLu+7CaBVFm4ntKIS8C2Vm4GhNHdkMxUA5cw1zD1OTG9dj s3D3+6ghvQuc3Hd8LfeBG89t2w== X-Google-Smtp-Source: ABdhPJxhe+HLIcubMtL5eQGoTBqj0FU4LjvgWIjKqizFmhGngk4G6mh/yk/MZlVlYeZObWjd5EoKaQ== X-Received: by 2002:a17:90a:2e8a:: with SMTP id r10mr8137536pjd.33.1590740601487; Fri, 29 May 2020 01:23:21 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id gd1sm7532180pjb.14.2020.05.29.01.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 01:23:20 -0700 (PDT) Date: Fri, 29 May 2020 01:23:19 -0700 From: Kees Cook To: Luis Chamberlain Subject: Re: [PATCH 06/13] ocfs2: use new sysctl subdir helper register_sysctl_subdir() Message-ID: <202005290121.C78B4AC@keescook> References: <20200529074108.16928-1-mcgrof@kernel.org> <20200529074108.16928-7-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200529074108.16928-7-mcgrof@kernel.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jack@suse.cz, rafael@kernel.org, airlied@linux.ie, amir73il@gmail.com, clemens@ladisch.de, dri-devel@lists.freedesktop.org, joseph.qi@linux.alibaba.com, sfr@canb.auug.org.au, mark@fasheh.com, rdna@fb.com, yzaikin@google.com, joonas.lahtinen@linux.intel.com, arnd@arndb.de, intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com, julia.lawall@lip6.fr, jlbec@evilplan.org, rodrigo.vivi@intel.com, nixiaoming@huawei.com, vbabka@suse.cz, axboe@kernel.dk, tytso@mit.edu, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, ebiederm@xmission.com, daniel@ffwll.ch, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, ocfs2-devel@oss.oracle.com, viro@zeniv.linux.org.uk Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, May 29, 2020 at 07:41:01AM +0000, Luis Chamberlain wrote: > This simplifies the code considerably. The following coccinelle > SmPL grammar rule was used to transform this code. > > // pycocci sysctl-subdir.cocci fs/ocfs2/stackglue.c > > @c1@ > expression E1; > identifier subdir, sysctls; > @@ > > static struct ctl_table subdir[] = { > { > .procname = E1, > .maxlen = 0, > .mode = 0555, > .child = sysctls, > }, > { } > }; > > @c2@ > identifier c1.subdir; > > expression E2; > identifier base; > @@ > > static struct ctl_table base[] = { > { > .procname = E2, > .maxlen = 0, > .mode = 0555, > .child = subdir, > }, > { } > }; > > @c3@ > identifier c2.base; > identifier header; > @@ > > header = register_sysctl_table(base); > > @r1 depends on c1 && c2 && c3@ > expression c1.E1; > identifier c1.subdir, c1.sysctls; > @@ > > -static struct ctl_table subdir[] = { > - { > - .procname = E1, > - .maxlen = 0, > - .mode = 0555, > - .child = sysctls, > - }, > - { } > -}; > > @r2 depends on c1 && c2 && c3@ > identifier c1.subdir; > > expression c2.E2; > identifier c2.base; > @@ > -static struct ctl_table base[] = { > - { > - .procname = E2, > - .maxlen = 0, > - .mode = 0555, > - .child = subdir, > - }, > - { } > -}; > > @r3 depends on c1 && c2 && c3@ > expression c1.E1; > identifier c1.sysctls; > expression c2.E2; > identifier c2.base; > identifier c3.header; > @@ > > header = > -register_sysctl_table(base); > +register_sysctl_subdir(E2, E1, sysctls); > > Generated-by: Coccinelle SmPL > > Signed-off-by: Luis Chamberlain > --- > fs/ocfs2/stackglue.c | 27 ++++----------------------- > 1 file changed, 4 insertions(+), 23 deletions(-) > > diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c > index a191094694c6..addafced7f59 100644 > --- a/fs/ocfs2/stackglue.c > +++ b/fs/ocfs2/stackglue.c > @@ -677,28 +677,8 @@ static struct ctl_table ocfs2_mod_table[] = { > }, > { } > }; > - > -static struct ctl_table ocfs2_kern_table[] = { > - { > - .procname = "ocfs2", > - .data = NULL, > - .maxlen = 0, > - .mode = 0555, > - .child = ocfs2_mod_table > - }, > - { } > -}; > - > -static struct ctl_table ocfs2_root_table[] = { > - { > - .procname = "fs", > - .data = NULL, > - .maxlen = 0, > - .mode = 0555, > - .child = ocfs2_kern_table > - }, > - { } > -}; > + .data = NULL, > + .data = NULL, The conversion script doesn't like the .data field assignments. ;) Was this series built with allmodconfig? I would have expected this to blow up very badly. :) -- Kees Cook 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 X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85EAAC433DF for ; Fri, 29 May 2020 08:23:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5B77F20810 for ; Fri, 29 May 2020 08:23:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="V5cw7BLL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B77F20810 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 89CB26E8A7; Fri, 29 May 2020 08:23:23 +0000 (UTC) Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by gabe.freedesktop.org (Postfix) with ESMTPS id D4DF56E8A1 for ; Fri, 29 May 2020 08:23:21 +0000 (UTC) Received: by mail-pj1-x1041.google.com with SMTP id k2so920397pjs.2 for ; Fri, 29 May 2020 01:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AIdQINovPOSOTJO7LcbhlxJUhgtHjantuh4CQ+iWOIk=; b=V5cw7BLL23TyvF7XSXItctQqYMbZHnd3YzoANtt528V7qq7xu1e8i/d5BPhYuuzcJA S4SZfsMhz56qz6LHdqb9P3YxO98X4/nyW5suGrtljbQRKiFaxDCQddMjE6qySAsDecYm 59mGjrKtcG0wLlb2EG+x0AmjGyZj6GcSpchSs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AIdQINovPOSOTJO7LcbhlxJUhgtHjantuh4CQ+iWOIk=; b=s86BE34WIso0wEBPJ+d5/nYEfY/BvYKEWbr6C3sviLSAjWY90XKehrDdI+qLkp5I/H F8ajnnAVzOyMga+xFk9tIAq7AxEViUHjYYCf8p3PxYA3euPYsmq9lt0tH4DhkXuOZ7+f 1K13ATwcAtGitUnaqnUId3kjx/D+NMe85Xyif8jb8o34WuZ2sPnLZcBlUo1ZaQJ6KraN m97rcdwjJczLBgtxapq1Q0eEMA/JY+caF8AFpFtyl3MGkwOq49jlrGh9xX4UyXCMGtDq DDPFvH4Uuz0toIGK3nQuCN/pEedAm8uoXV7OE8gqEoDhzglPOOX1WmVVpuzbaInfTeQk mmoA== X-Gm-Message-State: AOAM532bU1NEwe7qRcsfWLlzHKs47R4yInib4nmvCYQxbBTLF464n9yJ ASo4IgNfGFvcyofCv48d5/Nl1g== X-Google-Smtp-Source: ABdhPJxhe+HLIcubMtL5eQGoTBqj0FU4LjvgWIjKqizFmhGngk4G6mh/yk/MZlVlYeZObWjd5EoKaQ== X-Received: by 2002:a17:90a:2e8a:: with SMTP id r10mr8137536pjd.33.1590740601487; Fri, 29 May 2020 01:23:21 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id gd1sm7532180pjb.14.2020.05.29.01.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 01:23:20 -0700 (PDT) Date: Fri, 29 May 2020 01:23:19 -0700 From: Kees Cook To: Luis Chamberlain Subject: Re: [PATCH 06/13] ocfs2: use new sysctl subdir helper register_sysctl_subdir() Message-ID: <202005290121.C78B4AC@keescook> References: <20200529074108.16928-1-mcgrof@kernel.org> <20200529074108.16928-7-mcgrof@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200529074108.16928-7-mcgrof@kernel.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jack@suse.cz, rafael@kernel.org, airlied@linux.ie, amir73il@gmail.com, clemens@ladisch.de, dri-devel@lists.freedesktop.org, joseph.qi@linux.alibaba.com, sfr@canb.auug.org.au, mark@fasheh.com, rdna@fb.com, yzaikin@google.com, arnd@arndb.de, intel-gfx@lists.freedesktop.org, julia.lawall@lip6.fr, jlbec@evilplan.org, rodrigo.vivi@intel.com, nixiaoming@huawei.com, vbabka@suse.cz, axboe@kernel.dk, tytso@mit.edu, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, ebiederm@xmission.com, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, ocfs2-devel@oss.oracle.com, viro@zeniv.linux.org.uk Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, May 29, 2020 at 07:41:01AM +0000, Luis Chamberlain wrote: > This simplifies the code considerably. The following coccinelle > SmPL grammar rule was used to transform this code. > > // pycocci sysctl-subdir.cocci fs/ocfs2/stackglue.c > > @c1@ > expression E1; > identifier subdir, sysctls; > @@ > > static struct ctl_table subdir[] = { > { > .procname = E1, > .maxlen = 0, > .mode = 0555, > .child = sysctls, > }, > { } > }; > > @c2@ > identifier c1.subdir; > > expression E2; > identifier base; > @@ > > static struct ctl_table base[] = { > { > .procname = E2, > .maxlen = 0, > .mode = 0555, > .child = subdir, > }, > { } > }; > > @c3@ > identifier c2.base; > identifier header; > @@ > > header = register_sysctl_table(base); > > @r1 depends on c1 && c2 && c3@ > expression c1.E1; > identifier c1.subdir, c1.sysctls; > @@ > > -static struct ctl_table subdir[] = { > - { > - .procname = E1, > - .maxlen = 0, > - .mode = 0555, > - .child = sysctls, > - }, > - { } > -}; > > @r2 depends on c1 && c2 && c3@ > identifier c1.subdir; > > expression c2.E2; > identifier c2.base; > @@ > -static struct ctl_table base[] = { > - { > - .procname = E2, > - .maxlen = 0, > - .mode = 0555, > - .child = subdir, > - }, > - { } > -}; > > @r3 depends on c1 && c2 && c3@ > expression c1.E1; > identifier c1.sysctls; > expression c2.E2; > identifier c2.base; > identifier c3.header; > @@ > > header = > -register_sysctl_table(base); > +register_sysctl_subdir(E2, E1, sysctls); > > Generated-by: Coccinelle SmPL > > Signed-off-by: Luis Chamberlain > --- > fs/ocfs2/stackglue.c | 27 ++++----------------------- > 1 file changed, 4 insertions(+), 23 deletions(-) > > diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c > index a191094694c6..addafced7f59 100644 > --- a/fs/ocfs2/stackglue.c > +++ b/fs/ocfs2/stackglue.c > @@ -677,28 +677,8 @@ static struct ctl_table ocfs2_mod_table[] = { > }, > { } > }; > - > -static struct ctl_table ocfs2_kern_table[] = { > - { > - .procname = "ocfs2", > - .data = NULL, > - .maxlen = 0, > - .mode = 0555, > - .child = ocfs2_mod_table > - }, > - { } > -}; > - > -static struct ctl_table ocfs2_root_table[] = { > - { > - .procname = "fs", > - .data = NULL, > - .maxlen = 0, > - .mode = 0555, > - .child = ocfs2_kern_table > - }, > - { } > -}; > + .data = NULL, > + .data = NULL, The conversion script doesn't like the .data field assignments. ;) Was this series built with allmodconfig? I would have expected this to blow up very badly. :) -- Kees Cook _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel 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 X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82A2CC433E0 for ; Fri, 29 May 2020 08:23:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 539392075A for ; Fri, 29 May 2020 08:23:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="V5cw7BLL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 539392075A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 04B7A6E8A1; Fri, 29 May 2020 08:23:23 +0000 (UTC) Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by gabe.freedesktop.org (Postfix) with ESMTPS id DF5166E8A4 for ; Fri, 29 May 2020 08:23:21 +0000 (UTC) Received: by mail-pl1-x641.google.com with SMTP id q16so837714plr.2 for ; Fri, 29 May 2020 01:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AIdQINovPOSOTJO7LcbhlxJUhgtHjantuh4CQ+iWOIk=; b=V5cw7BLL23TyvF7XSXItctQqYMbZHnd3YzoANtt528V7qq7xu1e8i/d5BPhYuuzcJA S4SZfsMhz56qz6LHdqb9P3YxO98X4/nyW5suGrtljbQRKiFaxDCQddMjE6qySAsDecYm 59mGjrKtcG0wLlb2EG+x0AmjGyZj6GcSpchSs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AIdQINovPOSOTJO7LcbhlxJUhgtHjantuh4CQ+iWOIk=; b=rinkSg0D++YSR+sen5jnLqhZZaLLPaZWhNSBHkI94uR0M/Wluq80SW84da81XutLy0 UbSdWg+nK3IRJj08T4dYziIOoG0zdd17qPIzjBdHizx3AujPiyeEC0owKijoj21doPIv y0ZfpcjV0pJnWmcOjTpBd6Pl0EWKD+M2GX0ZeSd485dAModpntYCpsi6O3FJr2ihDJ0P EdfeyrSmxBJBfes14DQWCjBmyJi4mqcC4aUQ/PypX/d3gcq5BnYDAusgu/KsvnHqHFlM iw2InwB3uB0Xvcvg/NtKQlzzOxEbIysrBybdBzBCOnacXL9g3JJw6qrGWMhVsIDy9dFs 32rA== X-Gm-Message-State: AOAM533UMjmUYGminAa5h8UCeT6U8TKnK4Gokz8maI9aHq15+b4RRxGn xA2UsHtEEBIjMR/t+Ky5Io2h8w== X-Google-Smtp-Source: ABdhPJxhe+HLIcubMtL5eQGoTBqj0FU4LjvgWIjKqizFmhGngk4G6mh/yk/MZlVlYeZObWjd5EoKaQ== X-Received: by 2002:a17:90a:2e8a:: with SMTP id r10mr8137536pjd.33.1590740601487; Fri, 29 May 2020 01:23:21 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id gd1sm7532180pjb.14.2020.05.29.01.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 01:23:20 -0700 (PDT) Date: Fri, 29 May 2020 01:23:19 -0700 From: Kees Cook To: Luis Chamberlain Message-ID: <202005290121.C78B4AC@keescook> References: <20200529074108.16928-1-mcgrof@kernel.org> <20200529074108.16928-7-mcgrof@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200529074108.16928-7-mcgrof@kernel.org> Subject: Re: [Intel-gfx] [PATCH 06/13] ocfs2: use new sysctl subdir helper register_sysctl_subdir() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jack@suse.cz, rafael@kernel.org, airlied@linux.ie, benh@kernel.crashing.org, amir73il@gmail.com, clemens@ladisch.de, dri-devel@lists.freedesktop.org, joseph.qi@linux.alibaba.com, sfr@canb.auug.org.au, mark@fasheh.com, rdna@fb.com, yzaikin@google.com, arnd@arndb.de, intel-gfx@lists.freedesktop.org, julia.lawall@lip6.fr, jlbec@evilplan.org, nixiaoming@huawei.com, vbabka@suse.cz, axboe@kernel.dk, tytso@mit.edu, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, ebiederm@xmission.com, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, ocfs2-devel@oss.oracle.com, viro@zeniv.linux.org.uk Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, May 29, 2020 at 07:41:01AM +0000, Luis Chamberlain wrote: > This simplifies the code considerably. The following coccinelle > SmPL grammar rule was used to transform this code. > > // pycocci sysctl-subdir.cocci fs/ocfs2/stackglue.c > > @c1@ > expression E1; > identifier subdir, sysctls; > @@ > > static struct ctl_table subdir[] = { > { > .procname = E1, > .maxlen = 0, > .mode = 0555, > .child = sysctls, > }, > { } > }; > > @c2@ > identifier c1.subdir; > > expression E2; > identifier base; > @@ > > static struct ctl_table base[] = { > { > .procname = E2, > .maxlen = 0, > .mode = 0555, > .child = subdir, > }, > { } > }; > > @c3@ > identifier c2.base; > identifier header; > @@ > > header = register_sysctl_table(base); > > @r1 depends on c1 && c2 && c3@ > expression c1.E1; > identifier c1.subdir, c1.sysctls; > @@ > > -static struct ctl_table subdir[] = { > - { > - .procname = E1, > - .maxlen = 0, > - .mode = 0555, > - .child = sysctls, > - }, > - { } > -}; > > @r2 depends on c1 && c2 && c3@ > identifier c1.subdir; > > expression c2.E2; > identifier c2.base; > @@ > -static struct ctl_table base[] = { > - { > - .procname = E2, > - .maxlen = 0, > - .mode = 0555, > - .child = subdir, > - }, > - { } > -}; > > @r3 depends on c1 && c2 && c3@ > expression c1.E1; > identifier c1.sysctls; > expression c2.E2; > identifier c2.base; > identifier c3.header; > @@ > > header = > -register_sysctl_table(base); > +register_sysctl_subdir(E2, E1, sysctls); > > Generated-by: Coccinelle SmPL > > Signed-off-by: Luis Chamberlain > --- > fs/ocfs2/stackglue.c | 27 ++++----------------------- > 1 file changed, 4 insertions(+), 23 deletions(-) > > diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c > index a191094694c6..addafced7f59 100644 > --- a/fs/ocfs2/stackglue.c > +++ b/fs/ocfs2/stackglue.c > @@ -677,28 +677,8 @@ static struct ctl_table ocfs2_mod_table[] = { > }, > { } > }; > - > -static struct ctl_table ocfs2_kern_table[] = { > - { > - .procname = "ocfs2", > - .data = NULL, > - .maxlen = 0, > - .mode = 0555, > - .child = ocfs2_mod_table > - }, > - { } > -}; > - > -static struct ctl_table ocfs2_root_table[] = { > - { > - .procname = "fs", > - .data = NULL, > - .maxlen = 0, > - .mode = 0555, > - .child = ocfs2_kern_table > - }, > - { } > -}; > + .data = NULL, > + .data = NULL, The conversion script doesn't like the .data field assignments. ;) Was this series built with allmodconfig? I would have expected this to blow up very badly. :) -- Kees Cook _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx 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 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3D2AC433E1 for ; Fri, 29 May 2020 08:23:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B21262075A for ; Fri, 29 May 2020 08:23:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="V5cw7BLL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726805AbgE2IXX (ORCPT ); Fri, 29 May 2020 04:23:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbgE2IXW (ORCPT ); Fri, 29 May 2020 04:23:22 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0AE0C03E969 for ; Fri, 29 May 2020 01:23:21 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id fs4so917250pjb.5 for ; Fri, 29 May 2020 01:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AIdQINovPOSOTJO7LcbhlxJUhgtHjantuh4CQ+iWOIk=; b=V5cw7BLL23TyvF7XSXItctQqYMbZHnd3YzoANtt528V7qq7xu1e8i/d5BPhYuuzcJA S4SZfsMhz56qz6LHdqb9P3YxO98X4/nyW5suGrtljbQRKiFaxDCQddMjE6qySAsDecYm 59mGjrKtcG0wLlb2EG+x0AmjGyZj6GcSpchSs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AIdQINovPOSOTJO7LcbhlxJUhgtHjantuh4CQ+iWOIk=; b=a9c19waSG9UQOrAZ5Pd9xhB5/4s3bAKWtV0hkzIJozXmJua3zroH+fjPDM4gbtBMO/ VV4wmi1Dw9QLH82JNU2vK76Sd7bKrpGWYc7bZemNTXxbk7yUWZ7Hortyys2IU+rvyG5W 3dLYfkbHwexSfSh7Nxq3yFezH79qvOxxcS5VCBc7Cj4VN6KT757sQqGeOSfT7JQ4MWPT E/nG0W+laKe/gPVMbjJpWR2pbUlZ714qZVGPebqaDw3vEe4ytep/dW155nMJ9RzZCVO4 YBjSEdrbkutbJ56k8f6JG+E2pfez69y1DOuF+JO0WPQqs1DeZfpXGYwW2XgtYkDF1Zzp 4qOw== X-Gm-Message-State: AOAM530V/thLK4C1Be7bNKpNBvw/dRJVst5wj0VAXjFaEMPNiUTfMb29 UV97GaB5GMKsGhMSlNgkMGQdqQ== X-Google-Smtp-Source: ABdhPJxhe+HLIcubMtL5eQGoTBqj0FU4LjvgWIjKqizFmhGngk4G6mh/yk/MZlVlYeZObWjd5EoKaQ== X-Received: by 2002:a17:90a:2e8a:: with SMTP id r10mr8137536pjd.33.1590740601487; Fri, 29 May 2020 01:23:21 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id gd1sm7532180pjb.14.2020.05.29.01.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 01:23:20 -0700 (PDT) Date: Fri, 29 May 2020 01:23:19 -0700 From: Kees Cook To: Luis Chamberlain Cc: yzaikin@google.com, nixiaoming@huawei.com, ebiederm@xmission.com, axboe@kernel.dk, clemens@ladisch.de, arnd@arndb.de, gregkh@linuxfoundation.org, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, airlied@linux.ie, daniel@ffwll.ch, benh@kernel.crashing.org, rdna@fb.com, viro@zeniv.linux.org.uk, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, vbabka@suse.cz, sfr@canb.auug.org.au, jack@suse.cz, amir73il@gmail.com, rafael@kernel.org, tytso@mit.edu, julia.lawall@lip6.fr, akpm@linux-foundation.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linuxppc-dev@lists.ozlabs.org, ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/13] ocfs2: use new sysctl subdir helper register_sysctl_subdir() Message-ID: <202005290121.C78B4AC@keescook> References: <20200529074108.16928-1-mcgrof@kernel.org> <20200529074108.16928-7-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200529074108.16928-7-mcgrof@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 29, 2020 at 07:41:01AM +0000, Luis Chamberlain wrote: > This simplifies the code considerably. The following coccinelle > SmPL grammar rule was used to transform this code. > > // pycocci sysctl-subdir.cocci fs/ocfs2/stackglue.c > > @c1@ > expression E1; > identifier subdir, sysctls; > @@ > > static struct ctl_table subdir[] = { > { > .procname = E1, > .maxlen = 0, > .mode = 0555, > .child = sysctls, > }, > { } > }; > > @c2@ > identifier c1.subdir; > > expression E2; > identifier base; > @@ > > static struct ctl_table base[] = { > { > .procname = E2, > .maxlen = 0, > .mode = 0555, > .child = subdir, > }, > { } > }; > > @c3@ > identifier c2.base; > identifier header; > @@ > > header = register_sysctl_table(base); > > @r1 depends on c1 && c2 && c3@ > expression c1.E1; > identifier c1.subdir, c1.sysctls; > @@ > > -static struct ctl_table subdir[] = { > - { > - .procname = E1, > - .maxlen = 0, > - .mode = 0555, > - .child = sysctls, > - }, > - { } > -}; > > @r2 depends on c1 && c2 && c3@ > identifier c1.subdir; > > expression c2.E2; > identifier c2.base; > @@ > -static struct ctl_table base[] = { > - { > - .procname = E2, > - .maxlen = 0, > - .mode = 0555, > - .child = subdir, > - }, > - { } > -}; > > @r3 depends on c1 && c2 && c3@ > expression c1.E1; > identifier c1.sysctls; > expression c2.E2; > identifier c2.base; > identifier c3.header; > @@ > > header = > -register_sysctl_table(base); > +register_sysctl_subdir(E2, E1, sysctls); > > Generated-by: Coccinelle SmPL > > Signed-off-by: Luis Chamberlain > --- > fs/ocfs2/stackglue.c | 27 ++++----------------------- > 1 file changed, 4 insertions(+), 23 deletions(-) > > diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c > index a191094694c6..addafced7f59 100644 > --- a/fs/ocfs2/stackglue.c > +++ b/fs/ocfs2/stackglue.c > @@ -677,28 +677,8 @@ static struct ctl_table ocfs2_mod_table[] = { > }, > { } > }; > - > -static struct ctl_table ocfs2_kern_table[] = { > - { > - .procname = "ocfs2", > - .data = NULL, > - .maxlen = 0, > - .mode = 0555, > - .child = ocfs2_mod_table > - }, > - { } > -}; > - > -static struct ctl_table ocfs2_root_table[] = { > - { > - .procname = "fs", > - .data = NULL, > - .maxlen = 0, > - .mode = 0555, > - .child = ocfs2_kern_table > - }, > - { } > -}; > + .data = NULL, > + .data = NULL, The conversion script doesn't like the .data field assignments. ;) Was this series built with allmodconfig? I would have expected this to blow up very badly. :) -- Kees Cook