On Sun, Nov 21, 2010 at 03:59:07PM +0300, Vasiliy Kulikov wrote:
> Hi all,
> 
> 
> In include/linux/debugfs.h there is a comment:
> 
> /* 
>  * We do not return NULL from these functions if CONFIG_DEBUG_FS is not 
> enabled
>  * so users have a chance to detect if there was a real error or not.  We 
> don't
>  * want to duplicate the design decision mistakes of procfs and devfs again.
>  */
> 
> If CONFIG_DEBUG_FS is not enabled then all debugfs functions return
> -ENODEV.  However, implementations doesn't check return codes with
> IS_ERR(), but with (ret == NULL).  Is this done exactly to "spoof"
> drivers and make them think that there is a debugfs?  Then the full
> cycle of debugfs will be dummy.
> 
> AFAIU, this is done to make drivers differ e.g. OOM situations (this is
> critical one) and no debugfs (not critical).  Is it correct?

Yes.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to