linux-kernel.vger.kernel.org archive mirror
 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:27 ` Srivatsa S. Bhat
  2012-10-05  7:22 ` [tip:x86/urgent] x86/cache_info: Use ARRAY_SIZE() in amd_l3_attrs( ) tip-bot for Dan Carpenter
  0 siblings, 2 replies; 3+ 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] 3+ 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:27 ` Srivatsa S. Bhat
  2012-10-05  7:22 ` [tip:x86/urgent] x86/cache_info: Use ARRAY_SIZE() in amd_l3_attrs( ) tip-bot for Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Srivatsa S. Bhat @ 2012-10-02 10:27 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] 3+ messages in thread

* [tip:x86/urgent] 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:27 ` Srivatsa S. Bhat
@ 2012-10-05  7:22 ` tip-bot for Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Dan Carpenter @ 2012-10-05  7:22 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, andreas.herrmann3, srivatsa.bhat, shai,
	gregkh, tglx, dan.carpenter

Commit-ID:  961c79761dda351b5fb263a0654b98daac130b7a
Gitweb:     http://git.kernel.org/tip/961c79761dda351b5fb263a0654b98daac130b7a
Author:     Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Tue, 2 Oct 2012 11:34:09 +0300
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 4 Oct 2012 13:28:08 +0200

x86/cache_info: Use ARRAY_SIZE() in amd_l3_attrs()

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>
Cc: Shai Fultheim <shai@scalemp.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
Link: http://lkml.kernel.org/r/20121002083409.GM12398@elgon.mountain
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/cpu/intel_cacheinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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] 3+ messages in thread

end of thread, other threads:[~2012-10-05  7:22 UTC | newest]

Thread overview: 3+ 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:27 ` Srivatsa S. Bhat
2012-10-05  7:22 ` [tip:x86/urgent] x86/cache_info: Use ARRAY_SIZE() in amd_l3_attrs( ) tip-bot for Dan Carpenter

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).