CONFIG_DEBUG_FS and -ENODEV

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?


Thanks,

-- 
Vasiliy

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux