From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Fri, 29 May 2020 12:26:44 +0200 Subject: [Ocfs2-devel] [PATCH 11/13] random: simplify sysctl declaration with register_sysctl_subdir() In-Reply-To: <20200529074108.16928-12-mcgrof@kernel.org> References: <20200529074108.16928-1-mcgrof@kernel.org> <20200529074108.16928-12-mcgrof@kernel.org> Message-ID: <20200529102644.GB1345939@kroah.com> 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, keescook@chromium.org, 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, 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:06AM +0000, Luis Chamberlain wrote: > From: Xiaoming Ni > > Move random_table sysctl from kernel/sysctl.c to drivers/char/random.c > and use register_sysctl_subdir() to help remove the clutter out of > kernel/sysctl.c. > > Signed-off-by: Xiaoming Ni > Signed-off-by: Luis Chamberlain > --- > drivers/char/random.c | 14 ++++++++++++-- > include/linux/sysctl.h | 1 - > kernel/sysctl.c | 5 ----- > 3 files changed, 12 insertions(+), 8 deletions(-) > > diff --git a/drivers/char/random.c b/drivers/char/random.c > index a7cf6aa65908..73fd4b6e9c18 100644 > --- a/drivers/char/random.c > +++ b/drivers/char/random.c > @@ -2101,8 +2101,7 @@ static int proc_do_entropy(struct ctl_table *table, int write, > } > > static int sysctl_poolsize = INPUT_POOL_WORDS * 32; > -extern struct ctl_table random_table[]; > -struct ctl_table random_table[] = { > +static struct ctl_table random_table[] = { > { > .procname = "poolsize", > .data = &sysctl_poolsize, > @@ -2164,6 +2163,17 @@ struct ctl_table random_table[] = { > #endif > { } > }; > + > +/* > + * rand_initialize() is called before sysctl_init(), > + * so we cannot call register_sysctl_init() in rand_initialize() > + */ > +static int __init random_sysctls_init(void) > +{ > + register_sysctl_subdir("kernel", "random", random_table); No error checking? :( 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 6F232C433DF for ; Fri, 29 May 2020 10:29:46 +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 1DAB82074B for ; Fri, 29 May 2020 10:29:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="faxcz92s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DAB82074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.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 49YLRD1qyLzDqjv for ; Fri, 29 May 2020 20:29:44 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=faxcz92s; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49YLMr3d06zDqg9 for ; Fri, 29 May 2020 20:26:48 +1000 (AEST) Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C26F9206A4; Fri, 29 May 2020 10:26:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590748006; bh=8bEWlZvRJTJSN5EFbE7fd2XRTFiSJ+Enlo+N8agFquw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=faxcz92sMN7eOu8oBUxaAuviQDXXeCuF2ty48gOQVoG5HKyRtgx+1j3jYaEufgT4v ps9TDuc6AUOCKrsn9WS7bIWuM8CHQAcMiGCY1kLVP1M2yVXU9+iLCJ5JPtqGZK78wI pz+6O4DU0xL3evrZoQJnm3ddwYf+9VKFG7x8HgYY= Date: Fri, 29 May 2020 12:26:44 +0200 From: Greg KH To: Luis Chamberlain Subject: Re: [PATCH 11/13] random: simplify sysctl declaration with register_sysctl_subdir() Message-ID: <20200529102644.GB1345939@kroah.com> References: <20200529074108.16928-1-mcgrof@kernel.org> <20200529074108.16928-12-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200529074108.16928-12-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, keescook@chromium.org, 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, 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:06AM +0000, Luis Chamberlain wrote: > From: Xiaoming Ni > > Move random_table sysctl from kernel/sysctl.c to drivers/char/random.c > and use register_sysctl_subdir() to help remove the clutter out of > kernel/sysctl.c. > > Signed-off-by: Xiaoming Ni > Signed-off-by: Luis Chamberlain > --- > drivers/char/random.c | 14 ++++++++++++-- > include/linux/sysctl.h | 1 - > kernel/sysctl.c | 5 ----- > 3 files changed, 12 insertions(+), 8 deletions(-) > > diff --git a/drivers/char/random.c b/drivers/char/random.c > index a7cf6aa65908..73fd4b6e9c18 100644 > --- a/drivers/char/random.c > +++ b/drivers/char/random.c > @@ -2101,8 +2101,7 @@ static int proc_do_entropy(struct ctl_table *table, int write, > } > > static int sysctl_poolsize = INPUT_POOL_WORDS * 32; > -extern struct ctl_table random_table[]; > -struct ctl_table random_table[] = { > +static struct ctl_table random_table[] = { > { > .procname = "poolsize", > .data = &sysctl_poolsize, > @@ -2164,6 +2163,17 @@ struct ctl_table random_table[] = { > #endif > { } > }; > + > +/* > + * rand_initialize() is called before sysctl_init(), > + * so we cannot call register_sysctl_init() in rand_initialize() > + */ > +static int __init random_sysctls_init(void) > +{ > + register_sysctl_subdir("kernel", "random", random_table); No error checking? :( 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=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 60A8BC433E0 for ; Fri, 29 May 2020 10:26:48 +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 32DD9207BC for ; Fri, 29 May 2020 10:26:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="faxcz92s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32DD9207BC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.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 8E9A36E8BB; Fri, 29 May 2020 10:26:47 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5BFE26E8BA; Fri, 29 May 2020 10:26:46 +0000 (UTC) Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C26F9206A4; Fri, 29 May 2020 10:26:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590748006; bh=8bEWlZvRJTJSN5EFbE7fd2XRTFiSJ+Enlo+N8agFquw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=faxcz92sMN7eOu8oBUxaAuviQDXXeCuF2ty48gOQVoG5HKyRtgx+1j3jYaEufgT4v ps9TDuc6AUOCKrsn9WS7bIWuM8CHQAcMiGCY1kLVP1M2yVXU9+iLCJ5JPtqGZK78wI pz+6O4DU0xL3evrZoQJnm3ddwYf+9VKFG7x8HgYY= Date: Fri, 29 May 2020 12:26:44 +0200 From: Greg KH To: Luis Chamberlain Subject: Re: [PATCH 11/13] random: simplify sysctl declaration with register_sysctl_subdir() Message-ID: <20200529102644.GB1345939@kroah.com> References: <20200529074108.16928-1-mcgrof@kernel.org> <20200529074108.16928-12-mcgrof@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200529074108.16928-12-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, keescook@chromium.org, 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, 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:06AM +0000, Luis Chamberlain wrote: > From: Xiaoming Ni > > Move random_table sysctl from kernel/sysctl.c to drivers/char/random.c > and use register_sysctl_subdir() to help remove the clutter out of > kernel/sysctl.c. > > Signed-off-by: Xiaoming Ni > Signed-off-by: Luis Chamberlain > --- > drivers/char/random.c | 14 ++++++++++++-- > include/linux/sysctl.h | 1 - > kernel/sysctl.c | 5 ----- > 3 files changed, 12 insertions(+), 8 deletions(-) > > diff --git a/drivers/char/random.c b/drivers/char/random.c > index a7cf6aa65908..73fd4b6e9c18 100644 > --- a/drivers/char/random.c > +++ b/drivers/char/random.c > @@ -2101,8 +2101,7 @@ static int proc_do_entropy(struct ctl_table *table, int write, > } > > static int sysctl_poolsize = INPUT_POOL_WORDS * 32; > -extern struct ctl_table random_table[]; > -struct ctl_table random_table[] = { > +static struct ctl_table random_table[] = { > { > .procname = "poolsize", > .data = &sysctl_poolsize, > @@ -2164,6 +2163,17 @@ struct ctl_table random_table[] = { > #endif > { } > }; > + > +/* > + * rand_initialize() is called before sysctl_init(), > + * so we cannot call register_sysctl_init() in rand_initialize() > + */ > +static int __init random_sysctls_init(void) > +{ > + register_sysctl_subdir("kernel", "random", random_table); No error checking? :( _______________________________________________ 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 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 E8012C433E0 for ; Fri, 29 May 2020 10:26:49 +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 BC6B2207BC for ; Fri, 29 May 2020 10:26:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="faxcz92s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC6B2207BC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.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 11C6A6E8BD; Fri, 29 May 2020 10:26:48 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5BFE26E8BA; Fri, 29 May 2020 10:26:46 +0000 (UTC) Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C26F9206A4; Fri, 29 May 2020 10:26:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590748006; bh=8bEWlZvRJTJSN5EFbE7fd2XRTFiSJ+Enlo+N8agFquw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=faxcz92sMN7eOu8oBUxaAuviQDXXeCuF2ty48gOQVoG5HKyRtgx+1j3jYaEufgT4v ps9TDuc6AUOCKrsn9WS7bIWuM8CHQAcMiGCY1kLVP1M2yVXU9+iLCJ5JPtqGZK78wI pz+6O4DU0xL3evrZoQJnm3ddwYf+9VKFG7x8HgYY= Date: Fri, 29 May 2020 12:26:44 +0200 From: Greg KH To: Luis Chamberlain Message-ID: <20200529102644.GB1345939@kroah.com> References: <20200529074108.16928-1-mcgrof@kernel.org> <20200529074108.16928-12-mcgrof@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200529074108.16928-12-mcgrof@kernel.org> Subject: Re: [Intel-gfx] [PATCH 11/13] random: simplify sysctl declaration with 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, keescook@chromium.org, 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, 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:06AM +0000, Luis Chamberlain wrote: > From: Xiaoming Ni > > Move random_table sysctl from kernel/sysctl.c to drivers/char/random.c > and use register_sysctl_subdir() to help remove the clutter out of > kernel/sysctl.c. > > Signed-off-by: Xiaoming Ni > Signed-off-by: Luis Chamberlain > --- > drivers/char/random.c | 14 ++++++++++++-- > include/linux/sysctl.h | 1 - > kernel/sysctl.c | 5 ----- > 3 files changed, 12 insertions(+), 8 deletions(-) > > diff --git a/drivers/char/random.c b/drivers/char/random.c > index a7cf6aa65908..73fd4b6e9c18 100644 > --- a/drivers/char/random.c > +++ b/drivers/char/random.c > @@ -2101,8 +2101,7 @@ static int proc_do_entropy(struct ctl_table *table, int write, > } > > static int sysctl_poolsize = INPUT_POOL_WORDS * 32; > -extern struct ctl_table random_table[]; > -struct ctl_table random_table[] = { > +static struct ctl_table random_table[] = { > { > .procname = "poolsize", > .data = &sysctl_poolsize, > @@ -2164,6 +2163,17 @@ struct ctl_table random_table[] = { > #endif > { } > }; > + > +/* > + * rand_initialize() is called before sysctl_init(), > + * so we cannot call register_sysctl_init() in rand_initialize() > + */ > +static int __init random_sysctls_init(void) > +{ > + register_sysctl_subdir("kernel", "random", random_table); No error checking? :( _______________________________________________ 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.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 9B750C433DF for ; Fri, 29 May 2020 10:26:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 791B620810 for ; Fri, 29 May 2020 10:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590748008; bh=8bEWlZvRJTJSN5EFbE7fd2XRTFiSJ+Enlo+N8agFquw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=ZU4Q//u2+HbxxELoWMbzbJSC87yzs0AYFGK4EY88vg1fXwvjWevmkPZK8hEuqGKdv M7cZuf0IgTHeirJVgySWilPb17mYesgR0e2tSAywwV0t52P5lGtyqHNhZwUIbafdv+ t01+XMzALELfBE6yom01OWpJzI25M3j2SmMJQLWM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726568AbgE2K0r (ORCPT ); Fri, 29 May 2020 06:26:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:58100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbgE2K0q (ORCPT ); Fri, 29 May 2020 06:26:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C26F9206A4; Fri, 29 May 2020 10:26:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590748006; bh=8bEWlZvRJTJSN5EFbE7fd2XRTFiSJ+Enlo+N8agFquw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=faxcz92sMN7eOu8oBUxaAuviQDXXeCuF2ty48gOQVoG5HKyRtgx+1j3jYaEufgT4v ps9TDuc6AUOCKrsn9WS7bIWuM8CHQAcMiGCY1kLVP1M2yVXU9+iLCJ5JPtqGZK78wI pz+6O4DU0xL3evrZoQJnm3ddwYf+9VKFG7x8HgYY= Date: Fri, 29 May 2020 12:26:44 +0200 From: Greg KH To: Luis Chamberlain Cc: keescook@chromium.org, yzaikin@google.com, nixiaoming@huawei.com, ebiederm@xmission.com, axboe@kernel.dk, clemens@ladisch.de, arnd@arndb.de, 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 11/13] random: simplify sysctl declaration with register_sysctl_subdir() Message-ID: <20200529102644.GB1345939@kroah.com> References: <20200529074108.16928-1-mcgrof@kernel.org> <20200529074108.16928-12-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200529074108.16928-12-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:06AM +0000, Luis Chamberlain wrote: > From: Xiaoming Ni > > Move random_table sysctl from kernel/sysctl.c to drivers/char/random.c > and use register_sysctl_subdir() to help remove the clutter out of > kernel/sysctl.c. > > Signed-off-by: Xiaoming Ni > Signed-off-by: Luis Chamberlain > --- > drivers/char/random.c | 14 ++++++++++++-- > include/linux/sysctl.h | 1 - > kernel/sysctl.c | 5 ----- > 3 files changed, 12 insertions(+), 8 deletions(-) > > diff --git a/drivers/char/random.c b/drivers/char/random.c > index a7cf6aa65908..73fd4b6e9c18 100644 > --- a/drivers/char/random.c > +++ b/drivers/char/random.c > @@ -2101,8 +2101,7 @@ static int proc_do_entropy(struct ctl_table *table, int write, > } > > static int sysctl_poolsize = INPUT_POOL_WORDS * 32; > -extern struct ctl_table random_table[]; > -struct ctl_table random_table[] = { > +static struct ctl_table random_table[] = { > { > .procname = "poolsize", > .data = &sysctl_poolsize, > @@ -2164,6 +2163,17 @@ struct ctl_table random_table[] = { > #endif > { } > }; > + > +/* > + * rand_initialize() is called before sysctl_init(), > + * so we cannot call register_sysctl_init() in rand_initialize() > + */ > +static int __init random_sysctls_init(void) > +{ > + register_sysctl_subdir("kernel", "random", random_table); No error checking? :(