lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 18 Sep 2008 12:06:22 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Yinghai Lu <yhlu.kernel@...il.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] add sysctl from printk_tag


* Yinghai Lu <yhlu.kernel@...il.com> wrote:

> under /proc/sys/kernel/printk_tag/ will have acpi, apic, dev, pci

nice!

> Signed-off-by: Yinghai Lu <yhlu.kernel@...il.com>
> 
> ---
>  init/main.c |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 56 insertions(+)
> 
> Index: linux-2.6/init/main.c
> ===================================================================
> --- linux-2.6.orig/init/main.c
> +++ linux-2.6/init/main.c
> @@ -63,6 +63,8 @@
>  #include <linux/idr.h>
>  #include <linux/kmemcheck.h>
>  #include <linux/ftrace.h>
> +#include <linux/sysctl.h>
> +#include <linux/proc_fs.h>
>  
>  #include <asm/io.h>
>  #include <asm/bugs.h>
> @@ -395,6 +397,60 @@ static int __init quiet_kernel(char *str
>  early_param("debug", debug_kernel);
>  early_param("quiet", quiet_kernel);
>  
> +#ifdef CONFIG_SYSCTL
> +static struct ctl_table printk_tag_ctl_dir[] = {
> +        {
> +                .procname       = "printk_tag",
> +                .mode           = 0555,
> +        },
> +        {0, },
> +};
> +
> +static struct ctl_table printk_tag_ctl_root[] = {
> +        {
> +                .ctl_name       = CTL_KERN,
> +                .procname       = "kernel",
> +                .mode           = 0555,
> +                .child          = printk_tag_ctl_dir,
> +        },
> +        {0, },
> +};
> +
> +static int __init proc_printk_tag_init(void)
> +{
> +        int i;
> +        struct ctl_table *entry;
> +        char buf[32];

magic constant.

> +		strncpy(buf, tag_level[i].name, len - 1);
> +                entry->procname = kstrdup(buf, GFP_KERNEL);
> +		entry->data = &tag_level[i].level;
> +		entry->maxlen = sizeof(tag_level[i].level);
> +                entry->mode = 0644;
> +		entry->proc_handler = proc_dointvec;
> +                entry++;
> +        }

hm, whitespace damage in every second line.

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ