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]
Message-id: <1410363493.15593.26.camel@AMDC723>
Date:	Wed, 10 Sep 2014 17:38:13 +0200
From:	Maciej Matraszek <m.matraszek@...sung.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
	Krzysztof Kozlowski <k.kozlowski@...sung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Subject: Re: [PATCH] PM / Domains: add debugfs listing of struct
 generic_pm_domain-s

Hi Greg,
thanks for your reply!

> > +static int __init pm_genpd_debug_init(void)
> > +{
> > +	struct dentry *d;
> > +
> > +	pm_genpd_debugfs_dir = debugfs_create_dir("pm_genpd", NULL);
> > +
> > +	/* No debugfs */
> > +	if (IS_ERR(pm_genpd_debugfs_dir))
> > +		return PTR_ERR(pm_genpd_debugfs_dir);
> 
> You shouldn't care at all, just do this check:
> 
> > +	if (!pm_genpd_debugfs_dir)
> > +		return -ENOMEM;
> 
> And all will be fine, because:
> 
> > +	d = debugfs_create_file("pm_genpd_summary", S_IRUGO,
> > +			pm_genpd_debugfs_dir, NULL, &pm_genpd_summary_fops);
> 
> That call will resolve away to nothing if debugfs is not enabled, and it
> doesn't make much sense to do anything with an "error" of no debugfs.

Great! I'll fix this bizarre double check.

> 
> > +	if (!d)
> > +		return -ENOMEM;
> > +
> > +	return 0;
> > +}
> > +late_initcall(pm_genpd_debug_init);
> > +#endif /* CONFIG_PM_ADVANCED_DEBUG */
> 
> No tear-down of the debugfs files on shutdown?

In drivers/clk/clk.c, there is no tear-down of debugfs files paired
with clk_debug_init(), same with wakeup_sources_debugfs_init() from
drivers/base/power/wakeup.c. On the other hand, some subsystems
perform it. What would you prefer?


> 
> thanks,
> 
> greg k-h

Thanks,
--
Maciej Matraszek
Samsung R&D Institute Poland
Samsung Electronics

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ