From patchwork Fri May 13 21:12:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Dobriyan X-Patchwork-Id: 784012 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4DLCu45000996 for ; Fri, 13 May 2011 21:12:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759129Ab1EMVMy (ORCPT ); Fri, 13 May 2011 17:12:54 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]:35358 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756836Ab1EMVMy (ORCPT ); Fri, 13 May 2011 17:12:54 -0400 Received: by ewy4 with SMTP id 4so812543ewy.19 for ; Fri, 13 May 2011 14:12:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=v4cXQmC7XxhiGhEhv6MFJFpdATpMm3adxQM1/EMf0UQ=; b=DHRAGuT55Rt0fpK64SXhiT7ijvkFvZx39AoE4T5uMl0lfmvb25XcaBA2Y51lzOZs1v OocjAHAaj3nIuAlhdsjXI3oHqeN86Yt1cy41eOoStczh6MlBmi1jp9VSXUetXYCtFy8H /rNBE4cy2FwdWbpG306v38sRkNyjeETJn7xrQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=lNpbBd4iJGiAzfUmpJU2j05yaEeYGIMHMNey72owovQWgyBkFwJE8uYR3QXIfiQytO 2dHOdCcywx9Y56YiwU8dcMCVZgg6Xnhs5F7kg9bgUWnXDBu4P3vNdVgddu8YnZ+Ee9vZ CJgoc139J6FHpafgd55aE67AJWhJvdgC52jqc= Received: by 10.14.127.4 with SMTP id c4mr830923eei.131.1305321172597; Fri, 13 May 2011 14:12:52 -0700 (PDT) Received: from p183 (vulture-nat-37.telecom.by [213.184.224.37]) by mx.google.com with ESMTPS id y3sm1679265eeh.6.2011.05.13.14.12.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 May 2011 14:12:51 -0700 (PDT) Date: Sat, 14 May 2011 00:12:48 +0300 From: Alexey Dobriyan To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org Subject: [PATCH] airo: correct proc entry creation interfaces Message-ID: <20110513211248.GE29261@p183> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 13 May 2011 21:12:56 +0000 (UTC) * use proc_mkdir_mode() instead of create_proc_entry(S_IFDIR|...), export proc_mkdir_mode() for that, oh well. * don't supply S_IFREG to proc_create_data(), it's unnecessary Signed-off-by: Alexey Dobriyan --- drivers/net/wireless/airo.c | 33 +++++++++++---------------------- fs/proc/generic.c | 1 + 2 files changed, 12 insertions(+), 22 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c @@ -4500,17 +4500,15 @@ static int setup_proc_entry( struct net_device *dev, struct proc_dir_entry *entry; /* First setup the device directory */ strcpy(apriv->proc_name,dev->name); - apriv->proc_entry = create_proc_entry(apriv->proc_name, - S_IFDIR|airo_perm, - airo_entry); + apriv->proc_entry = proc_mkdir_mode(apriv->proc_name, airo_perm, + airo_entry); if (!apriv->proc_entry) goto fail; apriv->proc_entry->uid = proc_uid; apriv->proc_entry->gid = proc_gid; /* Setup the StatsDelta */ - entry = proc_create_data("StatsDelta", - S_IFREG | (S_IRUGO&proc_perm), + entry = proc_create_data("StatsDelta", S_IRUGO & proc_perm, apriv->proc_entry, &proc_statsdelta_ops, dev); if (!entry) goto fail_stats_delta; @@ -4518,8 +4516,7 @@ static int setup_proc_entry( struct net_device *dev, entry->gid = proc_gid; /* Setup the Stats */ - entry = proc_create_data("Stats", - S_IFREG | (S_IRUGO&proc_perm), + entry = proc_create_data("Stats", S_IRUGO & proc_perm, apriv->proc_entry, &proc_stats_ops, dev); if (!entry) goto fail_stats; @@ -4527,8 +4524,7 @@ static int setup_proc_entry( struct net_device *dev, entry->gid = proc_gid; /* Setup the Status */ - entry = proc_create_data("Status", - S_IFREG | (S_IRUGO&proc_perm), + entry = proc_create_data("Status", S_IRUGO & proc_perm, apriv->proc_entry, &proc_status_ops, dev); if (!entry) goto fail_status; @@ -4536,8 +4532,7 @@ static int setup_proc_entry( struct net_device *dev, entry->gid = proc_gid; /* Setup the Config */ - entry = proc_create_data("Config", - S_IFREG | proc_perm, + entry = proc_create_data("Config", proc_perm, apriv->proc_entry, &proc_config_ops, dev); if (!entry) goto fail_config; @@ -4545,8 +4540,7 @@ static int setup_proc_entry( struct net_device *dev, entry->gid = proc_gid; /* Setup the SSID */ - entry = proc_create_data("SSID", - S_IFREG | proc_perm, + entry = proc_create_data("SSID", proc_perm, apriv->proc_entry, &proc_SSID_ops, dev); if (!entry) goto fail_ssid; @@ -4554,8 +4548,7 @@ static int setup_proc_entry( struct net_device *dev, entry->gid = proc_gid; /* Setup the APList */ - entry = proc_create_data("APList", - S_IFREG | proc_perm, + entry = proc_create_data("APList", proc_perm, apriv->proc_entry, &proc_APList_ops, dev); if (!entry) goto fail_aplist; @@ -4563,8 +4556,7 @@ static int setup_proc_entry( struct net_device *dev, entry->gid = proc_gid; /* Setup the BSSList */ - entry = proc_create_data("BSSList", - S_IFREG | proc_perm, + entry = proc_create_data("BSSList", proc_perm, apriv->proc_entry, &proc_BSSList_ops, dev); if (!entry) goto fail_bsslist; @@ -4572,8 +4564,7 @@ static int setup_proc_entry( struct net_device *dev, entry->gid = proc_gid; /* Setup the WepKey */ - entry = proc_create_data("WepKey", - S_IFREG | proc_perm, + entry = proc_create_data("WepKey", proc_perm, apriv->proc_entry, &proc_wepkey_ops, dev); if (!entry) goto fail_wepkey; @@ -5705,9 +5696,7 @@ static int __init airo_init_module( void ) { int i; - airo_entry = create_proc_entry("driver/aironet", - S_IFDIR | airo_perm, - NULL); + airo_entry = proc_mkdir_mode("driver/aironet", airo_perm, NULL); if (airo_entry) { airo_entry->uid = proc_uid; --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -674,6 +674,7 @@ struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode, } return ent; } +EXPORT_SYMBOL(proc_mkdir_mode); struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, struct proc_dir_entry *parent)