LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 2.6.20-rc5] isdn/capi: use ARRAY_SIZE when appropriate
@ 2007-01-16  9:53 Ahmed S. Darwish
  2007-01-16 13:05 ` Karsten Keil
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmed S. Darwish @ 2007-01-16  9:53 UTC (permalink / raw)
  To: kkeil, kai.germaschewski; +Cc: linux-kernel, trivial

Hi all,

A trivial patch to use ARRAY_SIZE macro defined in kernel.h instead
of reimplementing it.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
---

capi.c    |    4 ++--
capidrv.c |    4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index d22c022..3804591 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -1456,7 +1456,7 @@ static struct procfsentries {
 
 static void __init proc_init(void)
 {
-    int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
+    int nelem = ARRAY_SIZE(procfsentries);
     int i;
 
     for (i=0; i < nelem; i++) {
@@ -1468,7 +1468,7 @@ static void __init proc_init(void)
 
 static void __exit proc_exit(void)
 {
-    int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
+    int nelem = ARRAY_SIZE(procfsentries);
     int i;
 
     for (i=nelem-1; i >= 0; i--) {
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
index c4d438c..8cec9c3 100644
--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -2218,7 +2218,7 @@ static struct procfsentries {
 
 static void __init proc_init(void)
 {
-    int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
+    int nelem = ARRAY_SIZE(procfsentries);
     int i;
 
     for (i=0; i < nelem; i++) {
@@ -2230,7 +2230,7 @@ static void __init proc_init(void)
 
 static void __exit proc_exit(void)
 {
-    int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
+    int nelem = ARRAY_SIZE(procfsentries);
     int i;
 
     for (i=nelem-1; i >= 0; i--) {

-- 
Ahmed S. Darwish
http://darwish-07.blogspot.com

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

* Re: [PATCH 2.6.20-rc5] isdn/capi: use ARRAY_SIZE when appropriate
  2007-01-16  9:53 [PATCH 2.6.20-rc5] isdn/capi: use ARRAY_SIZE when appropriate Ahmed S. Darwish
@ 2007-01-16 13:05 ` Karsten Keil
  0 siblings, 0 replies; 2+ messages in thread
From: Karsten Keil @ 2007-01-16 13:05 UTC (permalink / raw)
  To: Ahmed S. Darwish; +Cc: kai.germaschewski, linux-kernel, trivial

On Tue, Jan 16, 2007 at 11:53:19AM +0200, Ahmed S. Darwish wrote:
> Hi all,
> 
> A trivial patch to use ARRAY_SIZE macro defined in kernel.h instead
> of reimplementing it.
> 
> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>

Acked-by: Karsten Keil <kkeil@suse.de>

> ---
> 
> capi.c    |    4 ++--
> capidrv.c |    4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
> index d22c022..3804591 100644
> --- a/drivers/isdn/capi/capi.c
> +++ b/drivers/isdn/capi/capi.c
> @@ -1456,7 +1456,7 @@ static struct procfsentries {
>  
>  static void __init proc_init(void)
>  {
> -    int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
> +    int nelem = ARRAY_SIZE(procfsentries);
>      int i;
>  
>      for (i=0; i < nelem; i++) {
> @@ -1468,7 +1468,7 @@ static void __init proc_init(void)
>  
>  static void __exit proc_exit(void)
>  {
> -    int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
> +    int nelem = ARRAY_SIZE(procfsentries);
>      int i;
>  
>      for (i=nelem-1; i >= 0; i--) {
> diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
> index c4d438c..8cec9c3 100644
> --- a/drivers/isdn/capi/capidrv.c
> +++ b/drivers/isdn/capi/capidrv.c
> @@ -2218,7 +2218,7 @@ static struct procfsentries {
>  
>  static void __init proc_init(void)
>  {
> -    int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
> +    int nelem = ARRAY_SIZE(procfsentries);
>      int i;
>  
>      for (i=0; i < nelem; i++) {
> @@ -2230,7 +2230,7 @@ static void __init proc_init(void)
>  
>  static void __exit proc_exit(void)
>  {
> -    int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
> +    int nelem = ARRAY_SIZE(procfsentries);
>      int i;
>  
>      for (i=nelem-1; i >= 0; i--) {
> 
> -- 
> Ahmed S. Darwish
> http://darwish-07.blogspot.com

-- 
Karsten Keil
SuSE Labs
ISDN development

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-16  9:53 [PATCH 2.6.20-rc5] isdn/capi: use ARRAY_SIZE when appropriate Ahmed S. Darwish
2007-01-16 13:05 ` Karsten Keil

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lkml.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lkml.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lkml.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lkml.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lkml.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lkml.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lkml.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lkml.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lkml.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lkml.kernel.org/lkml/9 lkml/git/9.git
	git clone --mirror https://lkml.kernel.org/lkml/10 lkml/git/10.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lkml.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git