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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51C3F81F.5090005@hitachi.com>
Date:	Fri, 21 Jun 2013 15:52:15 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Tom Zanussi <tom.zanussi@...ux.intel.com>
Cc:	rostedt@...dmis.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/11] tracing: simplify event_enable_read()

(2013/06/21 3:31), Tom Zanussi wrote:
> Rather than enumerating each permutation, build the enable state
> string up from the combination of states.  This also allows for the
> simpler addition of more states.
> 
> Signed-off-by: Tom Zanussi <tom.zanussi@...ux.intel.com>

Looks nicer for me :)

Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>

Thanks,

> ---
>  kernel/trace/trace_events.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index 27963e2..ecb2609 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -624,17 +624,17 @@ event_enable_read(struct file *filp, char __user *ubuf, size_t cnt,
>  		  loff_t *ppos)
>  {
>  	struct ftrace_event_file *file = filp->private_data;
> -	char *buf;
> +	char buf[4] = "0";
>  
> -	if (file->flags & FTRACE_EVENT_FL_ENABLED) {
> -		if (file->flags & FTRACE_EVENT_FL_SOFT_DISABLED)
> -			buf = "0*\n";
> -		else if (file->flags & FTRACE_EVENT_FL_SOFT_MODE)
> -			buf = "1*\n";
> -		else
> -			buf = "1\n";
> -	} else
> -		buf = "0\n";
> +	if (file->flags & FTRACE_EVENT_FL_ENABLED &&
> +	    !(file->flags & FTRACE_EVENT_FL_SOFT_DISABLED))
> +		strcpy(buf, "1");
> +
> +	if (file->flags & FTRACE_EVENT_FL_SOFT_DISABLED ||
> +	    file->flags & FTRACE_EVENT_FL_SOFT_MODE)
> +		strcat(buf, "*");
> +
> +	strcat(buf, "\n");
>  
>  	return simple_read_from_buffer(ubuf, cnt, ppos, buf, strlen(buf));
>  }
> 


-- 
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@...achi.com


--
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