X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fdio%2Fdio.c;h=07f274f853d95f5dc0cf8b671e989fca3a65742f;hb=7cd95f56cb61f5348d062527c9d3653196f6e629;hp=a620f7d9ac8e730c4258a1f8e2c5c0d334e488f6;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=linux-2.6 diff --git a/drivers/dio/dio.c b/drivers/dio/dio.c index a620f7d9ac..07f274f853 100644 --- a/drivers/dio/dio.c +++ b/drivers/dio/dio.c @@ -88,8 +88,6 @@ static struct dioname names[] = #undef DIONAME #undef DIOFBNAME -#define NUMNAMES (sizeof(names) / sizeof(struct dioname)) - static const char *unknowndioname = "unknown DIO board -- please email !"; @@ -97,7 +95,7 @@ static const char *dio_getname(int id) { /* return pointer to a constant string describing the board with given ID */ unsigned int i; - for (i = 0; i < NUMNAMES; i++) + for (i = 0; i < ARRAY_SIZE(names); i++) if (names[i].id == id) return names[i].name; @@ -224,11 +222,10 @@ static int __init dio_init(void) set_fs(fs); /* Found a board, allocate it an entry in the list */ - dev = kmalloc(sizeof(struct dio_dev), GFP_KERNEL); + dev = kzalloc(sizeof(struct dio_dev), GFP_KERNEL); if (!dev) return 0; - memset(dev, 0, sizeof(struct dio_dev)); dev->bus = &dio_bus; dev->dev.parent = &dio_bus.dev; dev->dev.bus = &dio_bus_type;