Re: [PATCH v3 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

From: Hook, Gary
Date: Wed Apr 18 2018 - 16:53:49 EST


On 4/18/2018 4:16 PM, Mehta, Sohil wrote:
On Wed, 2018-04-18 at 08:31 +0000, Yang, Shunyong wrote:
Maybe the original design is to callÂdebugfs_initialized() before
callingÂdebugfs_create_xxx()?

I am unaware of the original design. Someone else would probably have
more context. However, looking at other places in the kernel where
debugfs_create_xx() is used, the common convention seems to be to avoid
callingÂdebugfs_initialized().

ÂSohil


debugfs_initialized() was introduced in commit c0f92ba99 back in 2.6.30-rc1. It was intended as a helper, not as a gatekeeper, which is why one doesn't see it used. Given that my use in this proposed patch is straightforward, I'm not seeing the need here. I had just seen some other code that used it, and copied the model.

Unless someone comes along to say, yes, use it, I'll not.

Gary