[ofa-general] Re: [PATCH] mlx4/profile.c: fix warning res_namedefined but not used

Jack Morgenstein jackm at mellanox.co.il
Thu Nov 13 08:06:32 PST 2008


This looks fine to me.

- Jack

> -----Original Message-----
> From: general-bounces at lists.openfabrics.org 
> [mailto:general-bounces at lists.openfabrics.org] On Behalf Of 
> Roland Dreier
> Sent: Tuesday, November 04, 2008 9:17 PM
> To: Alexander Beregalov
> Cc: general at lists.openfabrics.org
> Subject: [ofa-general] Re: [PATCH] mlx4/profile.c: fix 
> warning res_namedefined but not used
> 
> 
> Thanks.  What if we fix this like the following instead -- 
> change mlx4_dbg so it always looks to the compiler like it 
> uses all its parameters?  This generates the same code for 
> me, and looks cleaner in that it actually reduces the amount 
> of #ifdef'ed stuff.
> ---
>  drivers/net/mlx4/mlx4.h |    9 +++------
>  1 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/mlx4/mlx4.h 
> b/drivers/net/mlx4/mlx4.h index fa431fa..56a2e21 100644
> --- a/drivers/net/mlx4/mlx4.h
> +++ b/drivers/net/mlx4/mlx4.h
> @@ -87,6 +87,9 @@ enum {
>  
>  #ifdef CONFIG_MLX4_DEBUG
>  extern int mlx4_debug_level;
> +#else /* CONFIG_MLX4_DEBUG */
> +#define mlx4_debug_level	(0)
> +#endif /* CONFIG_MLX4_DEBUG */
>  
>  #define mlx4_dbg(mdev, format, arg...)			
> 		\
>  	do {							
> 	\
> @@ -94,12 +97,6 @@ extern int mlx4_debug_level;
>  			dev_printk(KERN_DEBUG, 
> &mdev->pdev->dev, format, ## arg); \
>  	} while (0)
>  
> -#else /* CONFIG_MLX4_DEBUG */
> -
> -#define mlx4_dbg(mdev, format, arg...) do { (void) mdev; } while (0)
> -
> -#endif /* CONFIG_MLX4_DEBUG */
> -
>  #define mlx4_err(mdev, format, arg...) \
>  	dev_err(&mdev->pdev->dev, format, ## arg)
>  #define mlx4_info(mdev, format, arg...) \ 
> _______________________________________________
> general mailing list
> general at lists.openfabrics.org 
> http://lists.openfabrics.org/cgi-> bin/mailman/listinfo/general
> 
> 
> To unsubscribe, please visit 
> http://openib.org/mailman/listinfo/openib-general
> 
> 



More information about the general mailing list