From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753672AbbIGRD0 (ORCPT ); Mon, 7 Sep 2015 13:03:26 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:35027 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbbIGRDY (ORCPT ); Mon, 7 Sep 2015 13:03:24 -0400 From: ulfalizer.lkml@gmail.com To: corbet@lwn.net Cc: gregkh@linuxfoundation.org, shane.seymour@hp.com, ulfalizer@gmail.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] debugfs: document that debugfs_remove*() accepts NULL and error values Date: Mon, 7 Sep 2015 19:03:15 +0200 Message-Id: <1441645395-5953-1-git-send-email-ulfalizer.lkml@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ulf Magnusson According to commit a59d6293e537 ("debugfs: change parameter check in debugfs_remove() functions"), this is meant to make cleanup easier for callers. In that case it ought to be documented. Signed-off-by: Ulf Magnusson --- fs/debugfs/inode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index c711be8..5d8f35f 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -533,7 +533,8 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent) /** * debugfs_remove - removes a file or directory from the debugfs filesystem * @dentry: a pointer to a the dentry of the file or directory to be - * removed. + * removed. If this parameter is NULL or an error value, nothing + * will be done. * * This function removes a file or directory in debugfs that was previously * created with a call to another debugfs function (like @@ -565,7 +566,8 @@ EXPORT_SYMBOL_GPL(debugfs_remove); /** * debugfs_remove_recursive - recursively removes a directory - * @dentry: a pointer to a the dentry of the directory to be removed. + * @dentry: a pointer to a the dentry of the directory to be removed. If this + * parameter is NULL or an error value, nothing will be done. * * This function recursively removes a directory tree in debugfs that * was previously created with a call to another debugfs function -- 2.1.4