public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] x86/cache_info: use ARRAY_SIZE() in amd_l3_attrs()
@ 2012-10-02  8:34 Dan Carpenter
  2012-10-02 10:39 ` Srivatsa S. Bhat
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-10-02  8:34 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Ingo Molnar, H. Peter Anvin, x86, Shai Fultheim,
	Greg Kroah-Hartman, Andreas Herrmann, Srivatsa S. Bhat,
	linux-kernel, kernel-janitors

Using ARRAY_SIZE() is more readable.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 9a7c90d..93c5451 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -991,7 +991,7 @@ static struct attribute ** __cpuinit amd_l3_attrs(void)
 	if (attrs)
 		return attrs;
 
-	n = sizeof (default_attrs) / sizeof (struct attribute *);
+	n = ARRAY_SIZE(default_attrs);
 
 	if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE))
 		n += 2;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] x86/cache_info: use ARRAY_SIZE() in amd_l3_attrs()
  2012-10-02  8:34 [patch] x86/cache_info: use ARRAY_SIZE() in amd_l3_attrs() Dan Carpenter
@ 2012-10-02 10:39 ` Srivatsa S. Bhat
  0 siblings, 0 replies; 2+ messages in thread
From: Srivatsa S. Bhat @ 2012-10-02 10:39 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Shai Fultheim,
	Greg Kroah-Hartman, Andreas Herrmann, linux-kernel,
	kernel-janitors

On 10/02/2012 02:04 PM, Dan Carpenter wrote:
> Using ARRAY_SIZE() is more readable.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>

Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>

Regards,
Srivatsa S. Bhat
 
> diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
> index 9a7c90d..93c5451 100644
> --- a/arch/x86/kernel/cpu/intel_cacheinfo.c
> +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
> @@ -991,7 +991,7 @@ static struct attribute ** __cpuinit amd_l3_attrs(void)
>  	if (attrs)
>  		return attrs;
> 
> -	n = sizeof (default_attrs) / sizeof (struct attribute *);
> +	n = ARRAY_SIZE(default_attrs);
> 
>  	if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE))
>  		n += 2;
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-02 10:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02  8:34 [patch] x86/cache_info: use ARRAY_SIZE() in amd_l3_attrs() Dan Carpenter
2012-10-02 10:39 ` Srivatsa S. Bhat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox