[dm-devel] Re: [KJ] [PATCH] dm: uninitialize static variables

Alexey Dobriyan adobriyan at gmail.com
Sat Dec 10 15:31:29 UTC 2005


On Mon, Dec 05, 2005 at 01:28:00PM +0100, Nicolas Kaiser wrote:
> uninitialize static variables initialized to 0, to make them go
> to .bss instead of .data.

>  dm.c     |    4 ++--
>  kcopyd.c |    2 +-

diffstat -p1 ;-)

> --- a/drivers/md/dm.c
> +++ b/drivers/md/dm.c
> @@ -20,8 +20,8 @@
>
>  static const char *_name = DM_NAME;
>
> -static unsigned int major = 0;
> -static unsigned int _major = 0;
> +static unsigned int major; /* = 0 */
> +static unsigned int _major; /* = 0 */

Drop the comments. major goes into .bss. .bss is initialized to 0.

> --- a/drivers/md/kcopyd.c
> +++ b/drivers/md/kcopyd.c

> -static int kcopyd_clients = 0;
> +static int kcopyd_clients; /* = 0 */




More information about the dm-devel mailing list