Re: [RFC] [PATCH] watchdog_info separation and constify

From: H Hartley Sweeten
Date: Tue Jan 19 2010 - 16:53:34 EST


On Tue Jan 19, 2010, Wim Van Sebroeck wrote:
> Hi All,
>
> please comment on following patch.
>
> Kind regards,
> Wim.
>
> commit 88d0b1a9c071d26e7b4831320067c84b04ea04a8
> Author: Wim Van Sebroeck <wim@xxxxxxxxx>
> Date: Sat Dec 26 18:55:22 2009 +0000
>
> [WATCHDOG] watchdog_info separation and constify
>
> make sure that the watchdog_info struct is seperated from the ioctl code.
> Also make the struct const where possible.
>
> Signed-off-by: Wim Van Sebroeck <wim@xxxxxxxxx>

[snip]

> diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c
> index cdd55e0..88ed54e 100644
> --- a/drivers/watchdog/ep93xx_wdt.c
> +++ b/drivers/watchdog/ep93xx_wdt.c
> @@ -131,7 +131,7 @@ ep93xx_wdt_write(struct file *file, const char __user *data, size_t len,
> return len;
> }
>
> -static struct watchdog_info ident = {
> +static const struct watchdog_info ident = {
> .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE,
> .identity = "EP93xx Watchdog",
> };

Before:
$ size ep93xx_wdt.o
text data bss dec hex filename
1613 88 40 1741 6cd ep93xx_wdt.o

After:
$ size ep93xx_wdt.o
text data bss dec hex filename
1653 48 40 1741 6cd ep93xx_wdt.o

Tested-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
¢éì®&Þ~º&¶¬–+-±éÝ¥Šw®žË±Êâmébžìdz¹Þ)í…æèw*jg¬±¨¶‰šŽŠÝj/êäz¹ÞŠà2ŠÞ¨è­Ú&¢)ß«a¶Úþø®G«éh®æj:+v‰¨Šwè†Ù>Wš±êÞiÛaxPjØm¶Ÿÿà -»+ƒùdš_