All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] use ARRAY_SIZE macro
@ 2010-09-08 20:57 Nikitas Angelinas
  2010-09-08 21:04   ` Nikitas Angelinas
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-08 20:57 UTC (permalink / raw)
  To: linux-kernel

This patch series replaces occurrences of the type sizeof(buffer) / sizeof(buffer[0])
with ARRAY_SIZE(buffer) in different places throughout the source tree.

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

* [PATCH 1/8] arch/ia64/xen: use ARRAY_SIZE macro in xen_pv_ops.c
  2010-09-08 20:57 [PATCH 0/8] use ARRAY_SIZE macro Nikitas Angelinas
@ 2010-09-08 21:04   ` Nikitas Angelinas
  2010-09-08 21:11 ` [PATCH 2/8] arch/parisc/include/asm: use ARRAY_SIZE macro in mmzone.h Nikitas Angelinas
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-08 21:04 UTC (permalink / raw)
  To: tony.luck, fenghua.yu; +Cc: linux-ia64, linux-kernel, Nikitas Angelinas

Replace sizeof(xen_branch_target) / sizeof(xen_branch_target[0]) with
ARRAY_SIZE(xen_branch_target) in arch/ia64/xen/xen_pv_ops.c

Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
---
 arch/ia64/xen/xen_pv_ops.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/ia64/xen/xen_pv_ops.c b/arch/ia64/xen/xen_pv_ops.c
index 8adc6a1..3e8d350 100644
--- a/arch/ia64/xen/xen_pv_ops.c
+++ b/arch/ia64/xen/xen_pv_ops.c
@@ -1136,7 +1136,6 @@ __initconst = {
 static void __init
 xen_patch_branch(unsigned long tag, unsigned long type)
 {
-	const unsigned long nelem =
-		sizeof(xen_branch_target) / sizeof(xen_branch_target[0]);
-	__paravirt_patch_apply_branch(tag, type, xen_branch_target, nelem);
+	__paravirt_patch_apply_branch(tag, type, xen_branch_target,
+					ARRAY_SIZE(xen_branch_target));
 }
-- 
1.7.2.3


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

* [PATCH 1/8] arch/ia64/xen: use ARRAY_SIZE macro in xen_pv_ops.c
@ 2010-09-08 21:04   ` Nikitas Angelinas
  0 siblings, 0 replies; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-08 21:04 UTC (permalink / raw)
  To: tony.luck, fenghua.yu; +Cc: linux-ia64, linux-kernel, Nikitas Angelinas

Replace sizeof(xen_branch_target) / sizeof(xen_branch_target[0]) with
ARRAY_SIZE(xen_branch_target) in arch/ia64/xen/xen_pv_ops.c

Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
---
 arch/ia64/xen/xen_pv_ops.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/ia64/xen/xen_pv_ops.c b/arch/ia64/xen/xen_pv_ops.c
index 8adc6a1..3e8d350 100644
--- a/arch/ia64/xen/xen_pv_ops.c
+++ b/arch/ia64/xen/xen_pv_ops.c
@@ -1136,7 +1136,6 @@ __initconst = {
 static void __init
 xen_patch_branch(unsigned long tag, unsigned long type)
 {
-	const unsigned long nelem -		sizeof(xen_branch_target) / sizeof(xen_branch_target[0]);
-	__paravirt_patch_apply_branch(tag, type, xen_branch_target, nelem);
+	__paravirt_patch_apply_branch(tag, type, xen_branch_target,
+					ARRAY_SIZE(xen_branch_target));
 }
-- 
1.7.2.3


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

* [PATCH 2/8] arch/parisc/include/asm: use ARRAY_SIZE macro in mmzone.h
  2010-09-08 20:57 [PATCH 0/8] use ARRAY_SIZE macro Nikitas Angelinas
  2010-09-08 21:04   ` Nikitas Angelinas
@ 2010-09-08 21:11 ` Nikitas Angelinas
  2010-09-08 21:17   ` Kyle McMartin
  2010-09-08 21:14 ` [PATCH 3/8] drivers/gpu/drm: use ARRAY_SIZE macro in drm_edid_modes.h Nikitas Angelinas
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-08 21:11 UTC (permalink / raw)
  To: kyle, deller, jejb; +Cc: linux-parisc, linux-kernel, Nikitas Angelinas

Replace sizeof(pfnnid_map) / sizeof(pfnnid_map[0]) with
ARRAY_SIZE(pfnnid_map) in mmzone.h

Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
---
 arch/parisc/include/asm/mmzone.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/parisc/include/asm/mmzone.h b/arch/parisc/include/asm/mmzone.h
index 9608d2c..85b23b6 100644
--- a/arch/parisc/include/asm/mmzone.h
+++ b/arch/parisc/include/asm/mmzone.h
@@ -3,6 +3,8 @@
 
 #ifdef CONFIG_DISCONTIGMEM
 
+#include <linux/kernel.h>
+
 #define MAX_PHYSMEM_RANGES 8 /* Fix the size for now (current known max is 3) */
 extern int npmem_ranges;
 
@@ -51,7 +53,7 @@ static inline int pfn_to_nid(unsigned long pfn)
 		return 0;
 
 	i = pfn >> PFNNID_SHIFT;
-	BUG_ON(i >= sizeof(pfnnid_map) / sizeof(pfnnid_map[0]));
+	BUG_ON(i >= ARRAY_SIZE(pfnnid_map));
 	r = pfnnid_map[i];
 	BUG_ON(r == 0xff);
 
-- 
1.7.2.3

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

* [PATCH 3/8] drivers/gpu/drm: use ARRAY_SIZE macro in drm_edid_modes.h
  2010-09-08 20:57 [PATCH 0/8] use ARRAY_SIZE macro Nikitas Angelinas
  2010-09-08 21:04   ` Nikitas Angelinas
  2010-09-08 21:11 ` [PATCH 2/8] arch/parisc/include/asm: use ARRAY_SIZE macro in mmzone.h Nikitas Angelinas
@ 2010-09-08 21:14 ` Nikitas Angelinas
  2010-09-08 21:17 ` [PATCH 4/8] drivers/gpu/drm/i915: use ARRAY_SIZE macro in intel_tv.c Nikitas Angelinas
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-08 21:14 UTC (permalink / raw)
  To: airlied, ajax, airlied; +Cc: dri-devel, linux-kernel, Nikitas Angelinas

Replace sizeof(est3_modes) / sizeof(est3_modes[0]) with
ARRAY_SIZE(est3_modes) in drivers/gpu/drm/drm_edid_modes.h

Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
---
 drivers/gpu/drm/drm_edid_modes.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid_modes.h b/drivers/gpu/drm/drm_edid_modes.h
index 6eb7592..7601284 100644
--- a/drivers/gpu/drm/drm_edid_modes.h
+++ b/drivers/gpu/drm/drm_edid_modes.h
@@ -377,4 +377,4 @@ static const struct {
 	{ 1920, 1440, 60, 0 },
 	{ 1920, 1440, 75, 0 },
 };
-static const int num_est3_modes = sizeof(est3_modes) / sizeof(est3_modes[0]);
+static const int num_est3_modes = ARRAY_SIZE(est3_modes);
-- 
1.7.2.3


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

* Re: [PATCH 2/8] arch/parisc/include/asm: use ARRAY_SIZE macro in mmzone.h
  2010-09-08 21:11 ` [PATCH 2/8] arch/parisc/include/asm: use ARRAY_SIZE macro in mmzone.h Nikitas Angelinas
@ 2010-09-08 21:17   ` Kyle McMartin
  0 siblings, 0 replies; 20+ messages in thread
From: Kyle McMartin @ 2010-09-08 21:17 UTC (permalink / raw)
  To: Nikitas Angelinas; +Cc: kyle, deller, jejb, linux-parisc, linux-kernel

On Wed, Sep 08, 2010 at 10:11:13PM +0100, Nikitas Angelinas wrote:
> Replace sizeof(pfnnid_map) / sizeof(pfnnid_map[0]) with
> ARRAY_SIZE(pfnnid_map) in mmzone.h
> 

Thanks. Let me think about this, I don't really like the tangled web of
include dependencies this results in...

regards, Kyle

> Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
> ---
>  arch/parisc/include/asm/mmzone.h |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/parisc/include/asm/mmzone.h b/arch/parisc/include/asm/mmzone.h
> index 9608d2c..85b23b6 100644
> --- a/arch/parisc/include/asm/mmzone.h
> +++ b/arch/parisc/include/asm/mmzone.h
> @@ -3,6 +3,8 @@
>  
>  #ifdef CONFIG_DISCONTIGMEM
>  
> +#include <linux/kernel.h>
> +
>  #define MAX_PHYSMEM_RANGES 8 /* Fix the size for now (current known max is 3) */
>  extern int npmem_ranges;
>  
> @@ -51,7 +53,7 @@ static inline int pfn_to_nid(unsigned long pfn)
>  		return 0;
>  
>  	i = pfn >> PFNNID_SHIFT;
> -	BUG_ON(i >= sizeof(pfnnid_map) / sizeof(pfnnid_map[0]));
> +	BUG_ON(i >= ARRAY_SIZE(pfnnid_map));
>  	r = pfnnid_map[i];
>  	BUG_ON(r == 0xff);
>  
> -- 
> 1.7.2.3
> 
> 

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

* [PATCH 4/8] drivers/gpu/drm/i915: use ARRAY_SIZE macro in intel_tv.c
  2010-09-08 20:57 [PATCH 0/8] use ARRAY_SIZE macro Nikitas Angelinas
                   ` (2 preceding siblings ...)
  2010-09-08 21:14 ` [PATCH 3/8] drivers/gpu/drm: use ARRAY_SIZE macro in drm_edid_modes.h Nikitas Angelinas
@ 2010-09-08 21:17 ` Nikitas Angelinas
  2010-09-08 21:20 ` [PATCH 5/8] drivers/net/bnx2x: use ARRAY_SIZE macro in bnx2x_main.c Nikitas Angelinas
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-08 21:17 UTC (permalink / raw)
  To: airlied, eric, zhenyuw, yakui.zhao, chris, jbarnes
  Cc: dri-devel, linux-kernel, Nikitas Angelinas

Replace sizeof(tv_modes) / sizeof (tv_modes[0]) with
ARRAY_SIZE(tv_modes) in drivers/gpu/drm/i915/intel_tv.c

Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
---
 drivers/gpu/drm/i915/intel_tv.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index d2029ef..6dc19f6 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -30,6 +30,7 @@
  * Integrated TV-out support for the 915GM and 945GM.
  */
 
+#include <linux/kernel.h>
 #include "drmP.h"
 #include "drm.h"
 #include "drm_crtc.h"
@@ -926,7 +927,7 @@ intel_tv_mode_lookup (char *tv_format)
 {
 	int i;
 
-	for (i = 0; i < sizeof(tv_modes) / sizeof (tv_modes[0]); i++) {
+	for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
 		const struct tv_mode *tv_mode = &tv_modes[i];
 
 		if (!strcmp(tv_format, tv_mode->name))
-- 
1.7.2.3


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

* [PATCH 5/8] drivers/net/bnx2x: use ARRAY_SIZE macro in bnx2x_main.c
  2010-09-08 20:57 [PATCH 0/8] use ARRAY_SIZE macro Nikitas Angelinas
                   ` (3 preceding siblings ...)
  2010-09-08 21:17 ` [PATCH 4/8] drivers/gpu/drm/i915: use ARRAY_SIZE macro in intel_tv.c Nikitas Angelinas
@ 2010-09-08 21:20 ` Nikitas Angelinas
  2010-09-10  4:56   ` David Miller
  2010-09-08 21:25   ` Nikitas Angelinas
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-08 21:20 UTC (permalink / raw)
  To: eilong, davem, dmitry, yanivr; +Cc: netdev, linux-kernel, Nikitas Angelinas

Replace sizeof(bnx2x_parity_mask)/(sizeof(bnx2x_parity_mask[0]) with
ARRAY_SIZE(bnx2x_parity_mask) in drivers/net/bnx2x/bnx2x_main.c

Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
---
 drivers/net/bnx2x/bnx2x_main.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index f8c3f08..e534ae8 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -3803,10 +3803,9 @@ static const struct {
 
 static void enable_blocks_parity(struct bnx2x *bp)
 {
-	int i, mask_arr_len =
-		sizeof(bnx2x_parity_mask)/(sizeof(bnx2x_parity_mask[0]));
+	int i;
 
-	for (i = 0; i < mask_arr_len; i++)
+	for (i = 0; i < ARRAY_SIZE(bnx2x_parity_mask); i++)
 		REG_WR(bp, bnx2x_parity_mask[i].addr,
 			bnx2x_parity_mask[i].mask);
 }
-- 
1.7.2.3


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

* [PATCH 6/8] drivers/net/wireless/ath/ath9k: use ARRAY_SIZE macro in ani.c
  2010-09-08 20:57 [PATCH 0/8] use ARRAY_SIZE macro Nikitas Angelinas
  2010-09-08 21:04   ` Nikitas Angelinas
@ 2010-09-08 21:25   ` Nikitas Angelinas
  2010-09-08 21:14 ` [PATCH 3/8] drivers/gpu/drm: use ARRAY_SIZE macro in drm_edid_modes.h Nikitas Angelinas
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-08 21:25 UTC (permalink / raw)
  To: lrodriguez, jmalinen, vasanth, senthilkumar, linville,
	Sujith.Manoharan, nbd
  Cc: linux-wireless, ath9k-devel, netdev, linux-kernel, Nikitas Angelinas

Replace (sizeof(ofdm_level_table)/sizeof(ofdm_level_table[0]) with
ARRAY_SIZE(ofdm_level_table), and (sizeof(cck_level_table)/
sizeof(cck_level_table[0]) with ARRAY_SIZE(cck_level_table) in
drivers/net/wireless/ath/ath9k/ani.c

Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
---
 drivers/net/wireless/ath/ath9k/ani.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index cc648b6..0496f96 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -14,6 +14,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include <linux/kernel.h>
 #include "hw.h"
 #include "hw-ops.h"
 
@@ -48,7 +49,7 @@ static const struct ani_ofdm_level_entry ofdm_level_table[] = {
 	{  7,  8,  0  }  /* lvl 9 */
 };
 #define ATH9K_ANI_OFDM_NUM_LEVEL \
-	(sizeof(ofdm_level_table)/sizeof(ofdm_level_table[0]))
+	ARRAY_SIZE(ofdm_level_table)
 #define ATH9K_ANI_OFDM_MAX_LEVEL \
 	(ATH9K_ANI_OFDM_NUM_LEVEL-1)
 #define ATH9K_ANI_OFDM_DEF_LEVEL \
@@ -94,7 +95,7 @@ static const struct ani_cck_level_entry cck_level_table[] = {
 };
 
 #define ATH9K_ANI_CCK_NUM_LEVEL \
-	(sizeof(cck_level_table)/sizeof(cck_level_table[0]))
+	ARRAY_SIZE(cck_level_table)
 #define ATH9K_ANI_CCK_MAX_LEVEL \
 	(ATH9K_ANI_CCK_NUM_LEVEL-1)
 #define ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI \
-- 
1.7.2.3


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

* [PATCH 6/8] drivers/net/wireless/ath/ath9k: use ARRAY_SIZE macro in ani.c
@ 2010-09-08 21:25   ` Nikitas Angelinas
  0 siblings, 0 replies; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-08 21:25 UTC (permalink / raw)
  To: lrodriguez, jmalinen, vasanth, senthilkumar, linville,
	Sujith.Manoharan, nbd
  Cc: linux-wireless, ath9k-devel, netdev, linux-kernel, Nikitas Angelinas

Replace (sizeof(ofdm_level_table)/sizeof(ofdm_level_table[0]) with
ARRAY_SIZE(ofdm_level_table), and (sizeof(cck_level_table)/
sizeof(cck_level_table[0]) with ARRAY_SIZE(cck_level_table) in
drivers/net/wireless/ath/ath9k/ani.c

Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
---
 drivers/net/wireless/ath/ath9k/ani.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index cc648b6..0496f96 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -14,6 +14,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include <linux/kernel.h>
 #include "hw.h"
 #include "hw-ops.h"
 
@@ -48,7 +49,7 @@ static const struct ani_ofdm_level_entry ofdm_level_table[] = {
 	{  7,  8,  0  }  /* lvl 9 */
 };
 #define ATH9K_ANI_OFDM_NUM_LEVEL \
-	(sizeof(ofdm_level_table)/sizeof(ofdm_level_table[0]))
+	ARRAY_SIZE(ofdm_level_table)
 #define ATH9K_ANI_OFDM_MAX_LEVEL \
 	(ATH9K_ANI_OFDM_NUM_LEVEL-1)
 #define ATH9K_ANI_OFDM_DEF_LEVEL \
@@ -94,7 +95,7 @@ static const struct ani_cck_level_entry cck_level_table[] = {
 };
 
 #define ATH9K_ANI_CCK_NUM_LEVEL \
-	(sizeof(cck_level_table)/sizeof(cck_level_table[0]))
+	ARRAY_SIZE(cck_level_table)
 #define ATH9K_ANI_CCK_MAX_LEVEL \
 	(ATH9K_ANI_CCK_NUM_LEVEL-1)
 #define ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI \
-- 
1.7.2.3


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

* [ath9k-devel] [PATCH 6/8] drivers/net/wireless/ath/ath9k: use ARRAY_SIZE macro in ani.c
@ 2010-09-08 21:25   ` Nikitas Angelinas
  0 siblings, 0 replies; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-08 21:25 UTC (permalink / raw)
  To: ath9k-devel

Replace (sizeof(ofdm_level_table)/sizeof(ofdm_level_table[0]) with
ARRAY_SIZE(ofdm_level_table), and (sizeof(cck_level_table)/
sizeof(cck_level_table[0]) with ARRAY_SIZE(cck_level_table) in
drivers/net/wireless/ath/ath9k/ani.c

Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
---
 drivers/net/wireless/ath/ath9k/ani.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index cc648b6..0496f96 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -14,6 +14,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include <linux/kernel.h>
 #include "hw.h"
 #include "hw-ops.h"
 
@@ -48,7 +49,7 @@ static const struct ani_ofdm_level_entry ofdm_level_table[] = {
 	{  7,  8,  0  }  /* lvl 9 */
 };
 #define ATH9K_ANI_OFDM_NUM_LEVEL \
-	(sizeof(ofdm_level_table)/sizeof(ofdm_level_table[0]))
+	ARRAY_SIZE(ofdm_level_table)
 #define ATH9K_ANI_OFDM_MAX_LEVEL \
 	(ATH9K_ANI_OFDM_NUM_LEVEL-1)
 #define ATH9K_ANI_OFDM_DEF_LEVEL \
@@ -94,7 +95,7 @@ static const struct ani_cck_level_entry cck_level_table[] = {
 };
 
 #define ATH9K_ANI_CCK_NUM_LEVEL \
-	(sizeof(cck_level_table)/sizeof(cck_level_table[0]))
+	ARRAY_SIZE(cck_level_table)
 #define ATH9K_ANI_CCK_MAX_LEVEL \
 	(ATH9K_ANI_CCK_NUM_LEVEL-1)
 #define ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI \
-- 
1.7.2.3

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

* [PATCH 7/8] drivers/staging/vt6656: use ARRAY_SIZE macro in channel.c
  2010-09-08 20:57 [PATCH 0/8] use ARRAY_SIZE macro Nikitas Angelinas
                   ` (5 preceding siblings ...)
  2010-09-08 21:25   ` Nikitas Angelinas
@ 2010-09-08 21:27 ` Nikitas Angelinas
  2010-09-09  9:29   ` Charles Clément
  2010-09-08 21:29 ` [PATCH 8/8] net/wireless: use ARRAY_SIZE macro in radiotap.c Nikitas Angelinas
  7 siblings, 1 reply; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-08 21:27 UTC (permalink / raw)
  To: gregkh, more.andres, lieb, forest; +Cc: devel, linux-kernel, Nikitas Angelinas

Replace (sizeof(ChannelRuleTab) / sizeof(ChannelRuleTab[0])) with
ARRAY_SIZE(ChannelRuleTab) in drivers/staging/vt6656/channel.c

Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
---
 drivers/staging/vt6656/channel.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vt6656/channel.c b/drivers/staging/vt6656/channel.c
index 6ad03e4..a2460ae 100644
--- a/drivers/staging/vt6656/channel.c
+++ b/drivers/staging/vt6656/channel.c
@@ -34,6 +34,7 @@
  *
  */
 
+#include <linux/kernel.h>
 #include "country.h"
 #include "channel.h"
 #include "rf.h"
@@ -367,7 +368,7 @@ static  struct
 /*                                           1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  */
 };
 
-#define NUM_RULES	(sizeof(ChannelRuleTab) / sizeof(ChannelRuleTab[0]))
+#define NUM_RULES	ARRAY_SIZE(ChannelRuleTab)
 
 /*---------------------  Export function  -------------------------*/
 /************************************************************************
-- 
1.7.2.3


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

* [PATCH 8/8] net/wireless: use ARRAY_SIZE macro in radiotap.c
  2010-09-08 20:57 [PATCH 0/8] use ARRAY_SIZE macro Nikitas Angelinas
                   ` (6 preceding siblings ...)
  2010-09-08 21:27 ` [PATCH 7/8] drivers/staging/vt6656: use ARRAY_SIZE macro in channel.c Nikitas Angelinas
@ 2010-09-08 21:29 ` Nikitas Angelinas
  7 siblings, 0 replies; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-08 21:29 UTC (permalink / raw)
  To: johannes, linville, davem
  Cc: linux-wireless, linux-kernel, netdev, Nikitas Angelinas

Replace sizeof(rtap_namespace_sizes) / sizeof(rtap_namespace_sizes[0])
with ARRAY_SIZE(rtap_namespace_sizes) in net/wireless/radiotap.c

Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
---
 net/wireless/radiotap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/wireless/radiotap.c b/net/wireless/radiotap.c
index 1332c44..c774bc0 100644
--- a/net/wireless/radiotap.c
+++ b/net/wireless/radiotap.c
@@ -14,6 +14,7 @@
  * See COPYING for more details.
  */
 
+#include <linux/kernel.h>
 #include <net/cfg80211.h>
 #include <net/ieee80211_radiotap.h>
 #include <asm/unaligned.h>
@@ -45,7 +46,7 @@ static const struct radiotap_align_size rtap_namespace_sizes[] = {
 };
 
 static const struct ieee80211_radiotap_namespace radiotap_ns = {
-	.n_bits = sizeof(rtap_namespace_sizes) / sizeof(rtap_namespace_sizes[0]),
+	.n_bits = ARRAY_SIZE(rtap_namespace_sizes),
 	.align_size = rtap_namespace_sizes,
 };
 
-- 
1.7.2.3


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

* Re: [PATCH 6/8] drivers/net/wireless/ath/ath9k: use ARRAY_SIZE macro in ani.c
  2010-09-08 21:25   ` Nikitas Angelinas
  (?)
  (?)
@ 2010-09-08 21:31     ` Luis R. Rodriguez
  -1 siblings, 0 replies; 20+ messages in thread
From: Luis R. Rodriguez @ 2010-09-08 21:31 UTC (permalink / raw)
  To: Nikitas Angelinas
  Cc: Luis Rodriguez, Jouni Malinen, Vasanth Thiagarajan,
	Senthilkumar Balasubramanian, linville, Sujith Manoharan, nbd,
	linux-wireless, ath9k-devel, netdev, linux-kernel

On Wed, Sep 08, 2010 at 02:25:42PM -0700, Nikitas Angelinas wrote:
> Replace (sizeof(ofdm_level_table)/sizeof(ofdm_level_table[0]) with
> ARRAY_SIZE(ofdm_level_table), and (sizeof(cck_level_table)/
> sizeof(cck_level_table[0]) with ARRAY_SIZE(cck_level_table) in
> drivers/net/wireless/ath/ath9k/ani.c
> 
> Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>

Sure.

  Luis

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

* Re: [PATCH 6/8] drivers/net/wireless/ath/ath9k: use ARRAY_SIZE macro in ani.c
@ 2010-09-08 21:31     ` Luis R. Rodriguez
  0 siblings, 0 replies; 20+ messages in thread
From: Luis R. Rodriguez @ 2010-09-08 21:31 UTC (permalink / raw)
  To: Nikitas Angelinas
  Cc: Luis Rodriguez, Jouni Malinen, Vasanth Thiagarajan,
	Senthilkumar Balasubramanian, linville, Sujith Manoharan, nbd,
	linux-wireless, ath9k-devel@lists.ath9k.org, netdev,
	linux-kernel

On Wed, Sep 08, 2010 at 02:25:42PM -0700, Nikitas Angelinas wrote:
> Replace (sizeof(ofdm_level_table)/sizeof(ofdm_level_table[0]) with
> ARRAY_SIZE(ofdm_level_table), and (sizeof(cck_level_table)/
> sizeof(cck_level_table[0]) with ARRAY_SIZE(cck_level_table) in
> drivers/net/wireless/ath/ath9k/ani.c
> 
> Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>

Sure.

  Luis

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

* Re: [PATCH 6/8] drivers/net/wireless/ath/ath9k: use ARRAY_SIZE macro in ani.c
@ 2010-09-08 21:31     ` Luis R. Rodriguez
  0 siblings, 0 replies; 20+ messages in thread
From: Luis R. Rodriguez @ 2010-09-08 21:31 UTC (permalink / raw)
  To: Nikitas Angelinas
  Cc: Luis Rodriguez, Jouni Malinen, Vasanth Thiagarajan,
	Senthilkumar Balasubramanian, linville-2XuSBdqkA4R54TAoqtyWWQ,
	Sujith Manoharan, nbd-p3rKhJxN3npAfugRpC6u6w,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	ath9k-devel-xDcbHBWguxHbcTqmT+pZeQ,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Wed, Sep 08, 2010 at 02:25:42PM -0700, Nikitas Angelinas wrote:
> Replace (sizeof(ofdm_level_table)/sizeof(ofdm_level_table[0]) with
> ARRAY_SIZE(ofdm_level_table), and (sizeof(cck_level_table)/
> sizeof(cck_level_table[0]) with ARRAY_SIZE(cck_level_table) in
> drivers/net/wireless/ath/ath9k/ani.c
> 
> Signed-off-by: Nikitas Angelinas <nikitasangelinas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Sure.

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [ath9k-devel] [PATCH 6/8] drivers/net/wireless/ath/ath9k: use ARRAY_SIZE macro in ani.c
@ 2010-09-08 21:31     ` Luis R. Rodriguez
  0 siblings, 0 replies; 20+ messages in thread
From: Luis R. Rodriguez @ 2010-09-08 21:31 UTC (permalink / raw)
  To: ath9k-devel

On Wed, Sep 08, 2010 at 02:25:42PM -0700, Nikitas Angelinas wrote:
> Replace (sizeof(ofdm_level_table)/sizeof(ofdm_level_table[0]) with
> ARRAY_SIZE(ofdm_level_table), and (sizeof(cck_level_table)/
> sizeof(cck_level_table[0]) with ARRAY_SIZE(cck_level_table) in
> drivers/net/wireless/ath/ath9k/ani.c
> 
> Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>

Sure.

  Luis

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

* Re: [PATCH 7/8] drivers/staging/vt6656: use ARRAY_SIZE macro in channel.c
  2010-09-08 21:27 ` [PATCH 7/8] drivers/staging/vt6656: use ARRAY_SIZE macro in channel.c Nikitas Angelinas
@ 2010-09-09  9:29   ` Charles Clément
  2010-09-09 18:56     ` Nikitas Angelinas
  0 siblings, 1 reply; 20+ messages in thread
From: Charles Clément @ 2010-09-09  9:29 UTC (permalink / raw)
  To: Nikitas Angelinas; +Cc: gregkh, more.andres, lieb, forest, devel, linux-kernel

I think this definition is not used anywhere in the driver and thus can
be removed.

On Wed, Sep 08, 2010 at 10:27:55PM +0100, Nikitas Angelinas wrote:
> Replace (sizeof(ChannelRuleTab) / sizeof(ChannelRuleTab[0])) with
> ARRAY_SIZE(ChannelRuleTab) in drivers/staging/vt6656/channel.c
> 
> Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
> ---
>  drivers/staging/vt6656/channel.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/vt6656/channel.c b/drivers/staging/vt6656/channel.c
> index 6ad03e4..a2460ae 100644
> --- a/drivers/staging/vt6656/channel.c
> +++ b/drivers/staging/vt6656/channel.c
> @@ -34,6 +34,7 @@
>   *
>   */
>  
> +#include <linux/kernel.h>
>  #include "country.h"
>  #include "channel.h"
>  #include "rf.h"
> @@ -367,7 +368,7 @@ static  struct
>  /*                                           1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  */
>  };
>  
> -#define NUM_RULES	(sizeof(ChannelRuleTab) / sizeof(ChannelRuleTab[0]))
> +#define NUM_RULES	ARRAY_SIZE(ChannelRuleTab)
>  
>  /*---------------------  Export function  -------------------------*/
>  /************************************************************************
> -- 
> 1.7.2.3
> 
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

-- 
Charles Clément

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

* Re: [PATCH 7/8] drivers/staging/vt6656: use ARRAY_SIZE macro in channel.c
  2010-09-09  9:29   ` Charles Clément
@ 2010-09-09 18:56     ` Nikitas Angelinas
  0 siblings, 0 replies; 20+ messages in thread
From: Nikitas Angelinas @ 2010-09-09 18:56 UTC (permalink / raw)
  To: Charles Clément
  Cc: gregkh, more.andres, lieb, forest, devel, linux-kernel

On Thu, Sep 09, 2010 at 11:29:35AM +0200, Charles Clément wrote:
> I think this definition is not used anywhere in the driver and thus can
> be removed.
> 
> On Wed, Sep 08, 2010 at 10:27:55PM +0100, Nikitas Angelinas wrote:
> > Replace (sizeof(ChannelRuleTab) / sizeof(ChannelRuleTab[0])) with
> > ARRAY_SIZE(ChannelRuleTab) in drivers/staging/vt6656/channel.c
> > 
> > Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
> > ---
> >  drivers/staging/vt6656/channel.c |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/staging/vt6656/channel.c b/drivers/staging/vt6656/channel.c
> > index 6ad03e4..a2460ae 100644
> > --- a/drivers/staging/vt6656/channel.c
> > +++ b/drivers/staging/vt6656/channel.c
> > @@ -34,6 +34,7 @@
> >   *
> >   */
> >  
> > +#include <linux/kernel.h>
> >  #include "country.h"
> >  #include "channel.h"
> >  #include "rf.h"
> > @@ -367,7 +368,7 @@ static  struct
> >  /*                                           1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  */
> >  };
> >  
> > -#define NUM_RULES	(sizeof(ChannelRuleTab) / sizeof(ChannelRuleTab[0]))
> > +#define NUM_RULES	ARRAY_SIZE(ChannelRuleTab)
> >  
> >  /*---------------------  Export function  -------------------------*/
> >  /************************************************************************
> > -- 
> > 1.7.2.3
> > 
> > _______________________________________________
> > devel mailing list
> > devel@linuxdriverproject.org
> > http://driverdev.linuxdriverproject.org/mailman/listinfo/devel
> 
> -- 
> Charles Clément
Yup, doesn't seem to be used anywhere; the file also has some coding
style issues, so perhaps removing the macro can be part of a cleanup
patch for whoever may carry out that task.

In that case, I guess reverting the patch from staging-next might be an
option, but I think what's really needed is for someone to go through
the driver source and do what's necessary... At first glance, it seems
possible that the macro (NUM_RULES) may indeed have to be used as a 
replacement for the hard-coded CB_MAX_CHANNEL, but the author may not 
have gotten around to it or didn't make use of it for some other reason.

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

* Re: [PATCH 5/8] drivers/net/bnx2x: use ARRAY_SIZE macro in bnx2x_main.c
  2010-09-08 21:20 ` [PATCH 5/8] drivers/net/bnx2x: use ARRAY_SIZE macro in bnx2x_main.c Nikitas Angelinas
@ 2010-09-10  4:56   ` David Miller
  0 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2010-09-10  4:56 UTC (permalink / raw)
  To: nikitasangelinas; +Cc: eilong, dmitry, yanivr, netdev, linux-kernel

From: Nikitas Angelinas <nikitasangelinas@gmail.com>
Date: Wed,  8 Sep 2010 22:20:37 +0100

> Replace sizeof(bnx2x_parity_mask)/(sizeof(bnx2x_parity_mask[0]) with
> ARRAY_SIZE(bnx2x_parity_mask) in drivers/net/bnx2x/bnx2x_main.c
> 
> Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>

Applied, thank you.

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

end of thread, other threads:[~2010-09-10  4:56 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-08 20:57 [PATCH 0/8] use ARRAY_SIZE macro Nikitas Angelinas
2010-09-08 21:04 ` [PATCH 1/8] arch/ia64/xen: use ARRAY_SIZE macro in xen_pv_ops.c Nikitas Angelinas
2010-09-08 21:04   ` Nikitas Angelinas
2010-09-08 21:11 ` [PATCH 2/8] arch/parisc/include/asm: use ARRAY_SIZE macro in mmzone.h Nikitas Angelinas
2010-09-08 21:17   ` Kyle McMartin
2010-09-08 21:14 ` [PATCH 3/8] drivers/gpu/drm: use ARRAY_SIZE macro in drm_edid_modes.h Nikitas Angelinas
2010-09-08 21:17 ` [PATCH 4/8] drivers/gpu/drm/i915: use ARRAY_SIZE macro in intel_tv.c Nikitas Angelinas
2010-09-08 21:20 ` [PATCH 5/8] drivers/net/bnx2x: use ARRAY_SIZE macro in bnx2x_main.c Nikitas Angelinas
2010-09-10  4:56   ` David Miller
2010-09-08 21:25 ` [PATCH 6/8] drivers/net/wireless/ath/ath9k: use ARRAY_SIZE macro in ani.c Nikitas Angelinas
2010-09-08 21:25   ` [ath9k-devel] " Nikitas Angelinas
2010-09-08 21:25   ` Nikitas Angelinas
2010-09-08 21:31   ` Luis R. Rodriguez
2010-09-08 21:31     ` [ath9k-devel] " Luis R. Rodriguez
2010-09-08 21:31     ` Luis R. Rodriguez
2010-09-08 21:31     ` Luis R. Rodriguez
2010-09-08 21:27 ` [PATCH 7/8] drivers/staging/vt6656: use ARRAY_SIZE macro in channel.c Nikitas Angelinas
2010-09-09  9:29   ` Charles Clément
2010-09-09 18:56     ` Nikitas Angelinas
2010-09-08 21:29 ` [PATCH 8/8] net/wireless: use ARRAY_SIZE macro in radiotap.c Nikitas Angelinas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.