lkml.org 
[lkml]   [2009]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5] tracing/events: add startup tests for events


On Thu, 16 Apr 2009, Frederic Weisbecker wrote:
> > + sysname = kmalloc(4, GFP_KERNEL);
> > + if (WARN_ON(!sysname)) {
> > + pr_warning("Can't allocate memory, giving up!\n");
> > + return 0;
> > + }
> > + memcpy(sysname, "*:*", 4);
> > + ret = ftrace_set_clr_event(sysname, 1);
> > + if (WARN_ON_ONCE(ret)) {
> > + kfree(sysname);
> > + pr_warning("error enabling all events\n");
> > + return 0;
> > + }
> > +
> > + event_test_stuff();
> > +
> > + /* reset sysname */
> > + memcpy(sysname, "*:*", 4);
>
>
>
> Nano thing, because you are using it twice:
> Why not strcpy?
>

Because cut and paste was so much easier ;-)

-- Steve



\
 
 \ /
  Last update: 2009-04-16 17:53    [W:0.143 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site