Re: [RFC][PATCH 2.6.19 1/6] cleanup for netconsole

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 12, 2006 at 03:28:17PM +0900, Keiichi KII wrote:
> From: Keiichi KII <[email protected]>
> 
> This patch contains the following cleanups.
>  - add __init for initialization functions(option_setup() and init_netconsole()).
>  - define name of magic number.
> 
> Signed-off-by: Keiichi KII <[email protected]>
> ---
> --- linux-2.6.19/drivers/net/netconsole.c	2006-12-06 14:37:06.985584500 +0900
> +++ enhanced-netconsole/drivers/net/netconsole.c.cleanup	2006-12-06
> 14:34:52.561183500 +0900
> @@ -50,8 +50,14 @@ MODULE_AUTHOR("Maintainer: Matt Mackall
>  MODULE_DESCRIPTION("Console driver for network interfaces");
>  MODULE_LICENSE("GPL");
> 
> -static char config[256];
> -module_param_string(netconsole, config, 256, 0);
> +enum {
> +	MAX_PRINT_CHUNK = 1000,
> +	MAX_CONFIG_LENGTH = 256,
> +};

Converting defines to anonymous enums is generally not considered a net
improvement around here. It doesn't provide any improvement in type safety.

> 
>  static void write_msg(struct console *con, const char *msg, unsigned int len)
>  {
> @@ -75,14 +80,12 @@ static void write_msg(struct console *co
>  		return;
> 
>  	local_irq_save(flags);
> -
>  	for(left = len; left; ) {
>  		frag = min(left, MAX_PRINT_CHUNK);
>  		netpoll_send_udp(&np, msg, frag);
>  		msg += frag;
>  		left -= frag;
>  	}
> -
>  	local_irq_restore(flags);
>  }

It's not a good idea to mix unrelated changes in, especially if
they're gratuitous formatting changes.

> +static int __init init_netconsole(void)
>  {
>  	if(strlen(config))
>  		option_setup(config);

I seem to recall there was a reason for not marking that __init. It
may no longer apply.

-- 
Mathematics is the supreme nostalgia of our time.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux