Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759202Ab1EABsl (ORCPT ); Sat, 30 Apr 2011 21:48:41 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:49864 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757942Ab1EABho (ORCPT ); Sat, 30 Apr 2011 21:37:44 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Sdmqzi2txZuc8vSM0KYaJnVe9rg//shz9rvIdDuc8txEvTHmh5ry/RT4MjExO7nCnX 1oX+5+2BRdwqnszCY5VV5cO18TqL/XYkPHzHsvojsaFzgjUY31wYfHCPht+WKWREiC+U Z791Uaf5rcNgu7x9DHw6SVACeq0qhp+bqEfH0= From: Lucian Adrian Grijincu To: linux-kernel@vger.kernel.org Cc: Lucian Adrian Grijincu Subject: [PATCH 40/69] sysctl: remove .child from appldata/ (s390) Date: Sun, 1 May 2011 03:36:10 +0200 Message-Id: <1304213799-10257-41-git-send-email-lucian.grijincu@gmail.com> X-Mailer: git-send-email 1.7.5.134.g1c08b In-Reply-To: <1304213799-10257-1-git-send-email-lucian.grijincu@gmail.com> References: <1304213799-10257-1-git-send-email-lucian.grijincu@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3240 Lines: 102 Signed-off-by: Lucian Adrian Grijincu --- arch/s390/appldata/appldata_base.c | 42 ++++++++++++++++++------------------ 1 files changed, 21 insertions(+), 21 deletions(-) diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index 5c91995..0f336a8 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -49,7 +49,6 @@ static struct platform_device *appldata_pdev; /* * /proc entries (sysctl) */ -static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata"; static int appldata_timer_handler(ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos); static int appldata_interval_handler(ctl_table *ctl, int write, @@ -71,14 +70,9 @@ static struct ctl_table appldata_table[] = { { }, }; -static struct ctl_table appldata_dir_table[] = { - { - .procname = appldata_proc_name, - .maxlen = 0, - .mode = S_IRUGO | S_IXUGO, - .child = appldata_table, - }, - { }, +static const struct ctl_path appldata_path[] = { + { .procname = "appldata" }, + { } }; /* @@ -424,6 +418,18 @@ out: /************************* module-ops management *****************************/ + +static const struct ctl_table appldata_ops_template[2] = { + { + .procname = NULL, /* ops->name */ + .data = NULL, /* ops */ + .maxlen = 0, + .mode = S_IRUGO | S_IWUSR, + .proc_handler = appldata_generic_handler, + }, + { } +}; + /* * appldata_register_ops() * @@ -434,7 +440,8 @@ int appldata_register_ops(struct appldata_ops *ops) if (ops->size > APPLDATA_MAX_REC_SIZE) return -EINVAL; - ops->ctl_table = kzalloc(4 * sizeof(struct ctl_table), GFP_KERNEL); + ops->ctl_table = kmemdup(&appldata_ops_template, + sizeof(appldata_ops_template), GFP_KERNEL); if (!ops->ctl_table) return -ENOMEM; @@ -442,17 +449,10 @@ int appldata_register_ops(struct appldata_ops *ops) list_add(&ops->list, &appldata_ops_list); mutex_unlock(&appldata_ops_mutex); - ops->ctl_table[0].procname = appldata_proc_name; - ops->ctl_table[0].maxlen = 0; - ops->ctl_table[0].mode = S_IRUGO | S_IXUGO; - ops->ctl_table[0].child = &ops->ctl_table[2]; - - ops->ctl_table[2].procname = ops->name; - ops->ctl_table[2].mode = S_IRUGO | S_IWUSR; - ops->ctl_table[2].proc_handler = appldata_generic_handler; - ops->ctl_table[2].data = ops; + ops->ctl_table[0].procname = ops->name; + ops->ctl_table[0].data = ops; - ops->sysctl_header = register_sysctl_table(ops->ctl_table); + ops->sysctl_header = register_sysctl_paths(appldata_path, ops->ctl_table); if (!ops->sysctl_header) goto out; return 0; @@ -649,7 +649,7 @@ static int __init appldata_init(void) /* Register cpu hotplug notifier */ register_hotcpu_notifier(&appldata_nb); - appldata_sysctl_header = register_sysctl_table(appldata_dir_table); + appldata_sysctl_header = register_sysctl_paths(appldata_path, appldata_table); return 0; out_device: -- 1.7.5.134.g1c08b -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/