From patchwork Sun May 8 22:38:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucian Adrian Grijincu X-Patchwork-Id: 94684 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AC78CB7005 for ; Mon, 9 May 2011 09:02:07 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932437Ab1EHW6G (ORCPT ); Sun, 8 May 2011 18:58:06 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:40833 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932374Ab1EHWlO (ORCPT ); Sun, 8 May 2011 18:41:14 -0400 Received: by mail-ww0-f44.google.com with SMTP id 36so5166890wwa.1 for ; Sun, 08 May 2011 15:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=tyi9VnP3H5Bau6ETRLR6liMrpqDx8W7DGK1H6XhFiaI=; b=AAmXu7+p/p/CMWVlIOErD1v9IJAFpyGXxgHA4GPMHldpBybyvJ0clhSwKxsBgU8JMd 5x35lzjP4lihjkPPdNHeYrKSbMQYC9kEaSorAiouDR2rPDgTBpZAhmPi5E4FKyxrh8x3 dhLMkUK+aknt/lrA946DSA2izQgB3KoXRSIu0= 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=I2rBrR6G/Xw9F+TNyhrIugr4VLMe/5yg8zeKqgHUf3WXoUnYajSVYGUwk1YKxct670 Z+fUTcmStSvQrH2uq7i36nrpJh9bsF2siGabU43hzQcxLenM2zrNh3cqHyiJJ4Lca9G1 bdfoYKpPs1GnXDsmyyLC1BM8wC9SolHiRhtBA= Received: by 10.227.184.66 with SMTP id cj2mr5031943wbb.90.1304894473096; Sun, 08 May 2011 15:41:13 -0700 (PDT) Received: from localhost.localdomain (aut75-5-82-239-182-128.fbx.proxad.net [82.239.182.128]) by mx.google.com with ESMTPS id ed10sm3390518wbb.66.2011.05.08.15.41.11 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 May 2011 15:41:11 -0700 (PDT) From: Lucian Adrian Grijincu To: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org, Lucian Adrian Grijincu Subject: [v2 040/115] sysctl: remove .child from appldata/ (s390) Date: Mon, 9 May 2011 00:38:52 +0200 Message-Id: <1304894407-32201-41-git-send-email-lucian.grijincu@gmail.com> X-Mailer: git-send-email 1.7.5.134.g1c08b In-Reply-To: <1304894407-32201-1-git-send-email-lucian.grijincu@gmail.com> References: <1304894407-32201-1-git-send-email-lucian.grijincu@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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: