lkml.org 
[lkml]   [2007]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2.6.20] s390-drivers: Use ARRAY_SIZE macro when appropriate
On Tue, 6 Feb 2007 18:07:44 +0200,
"Ahmed S. Darwish" <darwish.07@gmail.com> wrote:

> Hi all,
>
> A patch to use ARRAY_SIZE macro already defined in kernel.h
>
> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
> ---
> Not compile tested due to (ofcourse ;)) missing hardware.
>
> diff --git a/drivers/s390/cio/device_id.c b/drivers/s390/cio/device_id.c
> index f172759..997f468 100644
> --- a/drivers/s390/cio/device_id.c
> +++ b/drivers/s390/cio/device_id.c
> @@ -11,6 +11,7 @@
>
> #include <linux/module.h>
> #include <linux/init.h>
> +#include <linux/kernel.h>
>
> #include <asm/ccwdev.h>
> #include <asm/delay.h>
> @@ -138,7 +139,7 @@ VM_virtual_device_info (__u16 devno, struct senseid *ps)
> ps->cu_model = 0x60;
> return;
> }
> - for (i = 0; i < sizeof(vm_devices) / sizeof(vm_devices[0]); i++)
> + for (i = 0; i < ARRAY_SIZE(vm_devices); i++)
> if (diag_data.vrdcvcla == vm_devices[i].vrdcvcla &&
> diag_data.vrdcvtyp == vm_devices[i].vrdcvtyp) {
> ps->cu_type = vm_devices[i].cu_type;
>
>

Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-02-07 07:33    [W:0.142 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site