trivial: use ARRAY_SIZE
Subsystems (2)
PATCH 2/16 trivial: use ARRAY_SIZE
Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).
Signed-off-by Kulikov Vasiliy <[email protected]>
--- drivers/char/synclink_gt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/synclink_gt.c +1 -1
@@ -4845,7 +4845,7 @@ static int register_test(struct slgt_info *info) { static unsigned short patterns[] {0x0000, 0xffff, 0xaaaa, 0x5555, 0x6969, 0x9696}; -static unsigned int count =sizeof (patterns)/sizeof (patterns[0 ]); +static unsigned int count =ARRAY_SIZE (patterns);unsigned int i;int rc =0 ;
Signature · 1 line
1.7.0.4
Quoted 12 lines · Kulikov Vasiliy
Change sizeof(x) /
sizeof(*x)toARRAY_SIZE(x).Signed-off-by Kulikov Vasiliy <[email protected]>--- drivers/char/synclink_gt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/char/synclink_gt.c +0
-0
drivers/char/synclink_gt.c static int register_test(struct slgt_info *info) · line 4850
Quoted 7 lines
drivers/char/synclink_gt.c +1
-1@@ -4845,7 +4845,7 @@ static int register_test(struct slgt_info *info) { static unsigned short patterns[] > {0x0000, 0xffff, 0xaaaa, 0x5555, 0x6969, 0x9696}; -static unsigned int count =sizeof (patterns)/sizeof (patterns[0 ]); +static unsigned int count =ARRAY_SIZE (patterns);unsigned int i;int rc =0 ;
Acked-by Paul Fulghum <[email protected]>
with the exception of the trailing CR :-)
Signature · 2 lines
Paul Fulghum MicroGate Systems, Ltd.
Quoted 7 lines · Paul Fulghum
Quoted 7 lines
Change sizeof(x) /
sizeof(*x)toARRAY_SIZE(x).Signed-off-by Kulikov Vasiliy <[email protected]>--- drivers/char/synclink_gt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 14 lines
drivers/char/synclink_gt.c static int register_test(struct slgt_info *info) · line 4850
Quoted 12 lines
drivers/char/synclink_gt.c +1
-1@@ -4845,7 +4845,7 @@ static int register_test(struct slgt_info *info) { static unsigned short patterns[] > > {0x0000, 0xffff, 0xaaaa, 0x5555, 0x6969, 0x9696}; -static unsigned int count =sizeof (patterns)/sizeof (patterns[0 ]); +static unsigned int count =ARRAY_SIZE (patterns);unsigned int i;int rc =0 ;Acked-by Paul Fulghum <[email protected]>
The patch is not in linux-next as of today. Applied, thanks guys.
Signature · 2 lines
Jiri Kosina SUSE Labs, Novell Inc.
Quoted 1 line · On Mon, 28 Jun 2010 15:54:48 +0400 Kulikov Vasiliy <[email protected]> wrote:
static unsigned short patterns[] > {
0x0000,0xffff,0xaaaa,0x5555,0x6969,0x9696};
Unrelated, but these patterns should be const.