All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vr41xx: ARRAY_SIZE cleanup
@ 2006-01-07 21:58 Jean Delvare
  2006-01-07 22:14 ` Jean Delvare
  0 siblings, 1 reply; 2+ messages in thread
From: Jean Delvare @ 2006-01-07 21:58 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Yoichi Yuasa

Hi Andrew,

Can you please pick this patch for -mm? I sent it to Yoichi Yuasa one
month ago but didn't get any answer. Thanks.

Content-Disposition: inline; filename=vr41xx-array-size-cleanup.patch

Possible ARRAY_SIZE cleanup for the vr41xx_rtc driver.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
 drivers/char/vr41xx_rtc.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- linux-2.6.15-rc2.orig/drivers/char/vr41xx_rtc.c	2005-11-13 21:02:32.000000000 +0100
+++ linux-2.6.15-rc2/drivers/char/vr41xx_rtc.c	2005-12-05 22:25:48.000000000 +0100
@@ -127,8 +127,6 @@
 		.flags	= IORESOURCE_MEM,	},
 };
 
-#define RTC_NUM_RESOURCES	sizeof(rtc_resource) / sizeof(struct resource)
-
 static inline unsigned long read_elapsed_second(void)
 {
 	unsigned long first_low, first_mid, first_high;
@@ -686,7 +684,8 @@
 		break;
 	}
 
-	rtc_platform_device = platform_device_register_simple("RTC", -1, rtc_resource, RTC_NUM_RESOURCES);
+	rtc_platform_device = platform_device_register_simple("RTC", -1,
+			      rtc_resource, ARRAY_SIZE(rtc_resource));
 	if (IS_ERR(rtc_platform_device))
 		return PTR_ERR(rtc_platform_device);
 


-- 
Jean Delvare

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

* Re: [PATCH] vr41xx: ARRAY_SIZE cleanup
  2006-01-07 21:58 [PATCH] vr41xx: ARRAY_SIZE cleanup Jean Delvare
@ 2006-01-07 22:14 ` Jean Delvare
  0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2006-01-07 22:14 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Yoichi Yuasa

Quoting myself:
> Can you please pick this patch for -mm? I sent it to Yoichi Yuasa one
> month ago but didn't get any answer. Thanks.

Oops, I just realized (two minutes too late, of course) that you
already have a similar, but different, fix for this driver (as part of
drivers-char-use-array_size-macro.patch). So, please consider this new
patch instead, which should apply properly on top of your current
stack. Thanks, and sorry for the noise.

Content-Disposition: inline; filename=vr41xx-rtc-num-resources-cleanup.patch

No need to define RTC_NUM_RESOURCES, it doesn't add any value to the
code.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
 drivers/char/vr41xx_rtc.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- linux-2.6.15-mm2.orig/drivers/char/vr41xx_rtc.c	2006-01-07 23:00:54.000000000 +0100
+++ linux-2.6.15-mm2/drivers/char/vr41xx_rtc.c	2006-01-07 23:08:28.000000000 +0100
@@ -127,8 +127,6 @@
 		.flags	= IORESOURCE_MEM,	},
 };
 
-#define RTC_NUM_RESOURCES	ARRAY_SIZE(rtc_resource)
-
 static inline unsigned long read_elapsed_second(void)
 {
 	unsigned long first_low, first_mid, first_high;
@@ -686,7 +684,8 @@
 		break;
 	}
 
-	rtc_platform_device = platform_device_register_simple("RTC", -1, rtc_resource, RTC_NUM_RESOURCES);
+	rtc_platform_device = platform_device_register_simple("RTC", -1,
+			      rtc_resource, ARRAY_SIZE(rtc_resource));
 	if (IS_ERR(rtc_platform_device))
 		return PTR_ERR(rtc_platform_device);
 


-- 
Jean Delvare

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

end of thread, other threads:[~2006-01-07 22:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-07 21:58 [PATCH] vr41xx: ARRAY_SIZE cleanup Jean Delvare
2006-01-07 22:14 ` Jean Delvare

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.