On Tue, 2010-04-20 at 08:09 +0200, Ingo Molnar wrote:
> * Ingo Molnar <[email protected]> wrote:
> 
> > 
> > * Zhang, Yanmin <[email protected]> wrote:
> > 
> > >  unsigned long perf_misc_flags(struct pt_regs *regs)
> > >  {
> > >   int misc = 0;
> > > +
> > >   if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
> > > +         if (perf_guest_cbs->is_user_mode())
> > > +                 misc |= PERF_RECORD_MISC_GUEST_USER;
> > > +         else
> > > +                 misc |= PERF_RECORD_MISC_GUEST_KERNEL;
> > > + } else if (user_mode(regs))
> > > +         misc |= PERF_RECORD_MISC_USER;
> > > + else
> > > +         misc |= PERF_RECORD_MISC_KERNEL;
> > > +
> > 
> > We try to use balanced curly braces. I.e.:
> > 
> >     if (x) {
> >             boo();
> >     } else {
> >             if (y)
> >                     foo();
> >             else    
> >                     bar();
> >     }       
> > 
> > And avoid unbalanced ones:
> > 
> >     if (x) {
> >             boo();
> >     } else
> >             if (y)
> >                     foo();
> >             else    
> >                     bar();
> 
> Note, i fixed this in the patch and applied it to perf/core. (the invalid-C 
> problem was causing build failures)
Thanks for your teaching. Originally, I used {} in the 2nd half, but deleted it.

Yanmin


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to