linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: Zhaolei <zhaolei@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
	rt2400-devel@lists.sourceforge.net,
	"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [PATCH] Fix debugfs_create_*'s error checking method for wireless/rt2x00/
Date: Wed, 22 Oct 2008 19:07:04 +0200	[thread overview]
Message-ID: <200810221907.04946.IvDoorn@gmail.com> (raw)
In-Reply-To: <48FEED4D.3000208@cn.fujitsu.com>

On Wednesday 22 October 2008, Zhaolei wrote:
> Hi,
> 
> debugfs_create_*() returns NULL if an error occurs, returns -ENODEV
> when debugfs is not enabled in the kernel.
> 
> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>

Looks good. Thanks.
John, could you pull this into wireless-testing? Thanks!

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

> ---
>  drivers/net/wireless/rt2x00/rt2x00debug.c |   21 ++++++++++++---------
>  1 files changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
> index 5cf4c85..b380cd3 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00debug.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
> @@ -587,29 +587,29 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
>  	intf->driver_folder =
>  	    debugfs_create_dir(intf->rt2x00dev->ops->name,
>  			       rt2x00dev->hw->wiphy->debugfsdir);
> -	if (IS_ERR(intf->driver_folder))
> +	if (IS_ERR(intf->driver_folder) || !intf->driver_folder)
>  		goto exit;
>  
>  	intf->driver_entry =
>  	    rt2x00debug_create_file_driver("driver", intf, &intf->driver_blob);
> -	if (IS_ERR(intf->driver_entry))
> +	if (IS_ERR(intf->driver_entry) || !intf->driver_entry)
>  		goto exit;
>  
>  	intf->chipset_entry =
>  	    rt2x00debug_create_file_chipset("chipset",
>  					    intf, &intf->chipset_blob);
> -	if (IS_ERR(intf->chipset_entry))
> +	if (IS_ERR(intf->chipset_entry) || !intf->chipset_entry)
>  		goto exit;
>  
>  	intf->dev_flags = debugfs_create_file("dev_flags", S_IRUSR,
>  					      intf->driver_folder, intf,
>  					      &rt2x00debug_fop_dev_flags);
> -	if (IS_ERR(intf->dev_flags))
> +	if (IS_ERR(intf->dev_flags) || !intf->dev_flags)
>  		goto exit;
>  
>  	intf->register_folder =
>  	    debugfs_create_dir("register", intf->driver_folder);
> -	if (IS_ERR(intf->register_folder))
> +	if (IS_ERR(intf->register_folder) || !intf->register_folder)
>  		goto exit;
>  
>  #define RT2X00DEBUGFS_CREATE_REGISTER_ENTRY(__intf, __name)	\
> @@ -619,7 +619,8 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
>  			       S_IRUSR | S_IWUSR,		\
>  			       (__intf)->register_folder,	\
>  			       &(__intf)->offset_##__name);	\
> -	if (IS_ERR((__intf)->__name##_off_entry))		\
> +	if (IS_ERR((__intf)->__name##_off_entry)		\
> +			|| !(__intf)->__name##_off_entry)	\
>  		goto exit;					\
>  								\
>  	(__intf)->__name##_val_entry =				\
> @@ -627,7 +628,8 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
>  				S_IRUSR | S_IWUSR,		\
>  				(__intf)->register_folder,	\
>  				(__intf), &rt2x00debug_fop_##__name);\
> -	if (IS_ERR((__intf)->__name##_val_entry))		\
> +	if (IS_ERR((__intf)->__name##_val_entry)		\
> +			|| !(__intf)->__name##_val_entry)	\
>  		goto exit;					\
>  })
>  
> @@ -640,13 +642,14 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
>  
>  	intf->queue_folder =
>  	    debugfs_create_dir("queue", intf->driver_folder);
> -	if (IS_ERR(intf->queue_folder))
> +	if (IS_ERR(intf->queue_folder) || !intf->queue_folder)
>  		goto exit;
>  
>  	intf->queue_frame_dump_entry =
>  	    debugfs_create_file("dump", S_IRUSR, intf->queue_folder,
>  				intf, &rt2x00debug_fop_queue_dump);
> -	if (IS_ERR(intf->queue_frame_dump_entry))
> +	if (IS_ERR(intf->queue_frame_dump_entry)
> +		|| !intf->queue_frame_dump_entry)
>  		goto exit;
>  
>  	skb_queue_head_init(&intf->frame_dump_skbqueue);
> -- 1.5.5.3 
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



      reply	other threads:[~2008-10-22 17:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-22  9:07 [PATCH] Fix debugfs_create_*'s error checking method for wireless/rt2x00/ Zhaolei
2008-10-22 17:07 ` Ivo van Doorn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200810221907.04946.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rt2400-devel@lists.sourceforge.net \
    --cc=zhaolei@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).