lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 29 Jul 2022 09:31:06 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Tong Zhang <ztong0001@...il.com>
Cc:     Dan Carpenter <dan.carpenter@...cle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Colin Ian King <colin.king@...el.com>,
        Saurav Girepunje <saurav.girepunje@...il.com>,
        Johan Hovold <johan@...nel.org>, linux-kernel@...r.kernel.org,
        linux-staging@...ts.linux.dev
Subject: Re: [PATCH v3 2/3] staging: rtl8192u: move debug files to debugfs

On Thu, Jul 28, 2022 at 08:52:19PM -0700, Tong Zhang wrote:
>  
> -static struct proc_dir_entry *rtl8192_proc;
> -static int __maybe_unused proc_get_stats_ap(struct seq_file *m, void *v)
> +#define R8192U_DEBUGFS_DIR_NAME "r8192u_usb"

KBUILD_MODNAME is a better thing to use here.

> +void rtl8192_debugfs_init_one(struct net_device *dev)
> +{
> +	struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);

No need to cast.

> +	struct dentry *parent_dir = debugfs_lookup(R8192U_DEBUGFS_DIR_NAME, NULL);
> +	struct dentry *dir = debugfs_create_dir(dev->name, parent_dir);
> +
> +	debugfs_create_file("stats-rx", 0444, dir, dev, &rtl8192_usb_stats_rx_fops);
> +	debugfs_create_file("stats-tx", 0444, dir, dev, &rtl8192_usb_stats_tx_fops);
> +	debugfs_create_file("stats-ap", 0444, dir, dev, &rtl8192_usb_stats_ap_fops);
> +	debugfs_create_file("registers", 0444, dir, dev, &rtl8192_usb_registers_fops);
> +
> +	priv->debugfs_dir = dir;
> +}
> +
> +void rtl8192_debugfs_exit_one(struct net_device *dev)
>  {
> -	RT_TRACE(COMP_INIT, "Initializing proc filesystem");
> -	rtl8192_proc = proc_mkdir(RTL819XU_MODULE_NAME, init_net.proc_net);
> +	struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);

No need for a cast.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ