• Dan Carpenter's avatar
    iwl: cleanup: remove unneeded error handling · f7f7cc47
    Dan Carpenter authored
    This is just a cleanup and doesn't change how the code works.
    
    debugfs_create_dir() and debugfs_create_file() return an error pointer
    (-ENODEV) if CONFIG_DEBUG_FS is not enabled, otherwise if an error occurs
    they return NULL.  This is how they are implemented and what it says in
    the DebugFS documentation.  DebugFS can not be compiled as a module.
    
    As a result, we only need to check for error pointers and particularly
    -ENODEV one time to know that DebugFS is enabled.  This patch keeps the
    first check for error pointers and removes the rest.
    
    The other reason for this patch, is that it silences some Smatch warnings.
    Smatch sees the condition "(result != -ENODEV)" and assumes that it's
    possible for "result" to equal -ENODEV.  If it were possible it would lead
    to an error pointer dereference.  But since it's not, we can just remove
    the check.
    Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
    Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
    f7f7cc47
debugfs.c 13.5 KB