[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190304122711.GA28624@e107155-lin>
Date: Mon, 4 Mar 2019 12:27:11 +0000
From: Sudeep Holla <sudeep.holla@....com>
To: Segher Boessenkool <segher@...nel.crashing.org>
Cc: "Haibo Xu (Arm Technology China)" <Haibo.Xu@....com>,
Steve Capper <Steve.Capper@....com>,
Catalin Marinas <Catalin.Marinas@....com>,
"jdike@...toit.com" <jdike@...toit.com>,
"x86@...nel.org" <x86@...nel.org>,
Will Deacon <Will.Deacon@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Oleg Nesterov <oleg@...hat.com>,
Richard Weinberger <richard@....at>,
Ingo Molnar <mingo@...hat.com>,
Paul Mackerras <paulus@...ba.org>,
Thomas Gleixner <tglx@...utronix.de>,
"Bin Lu (Arm Technology China)" <Bin.Lu@....com>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 2/6] ptrace: introduce ptrace_syscall_enter to
consolidate PTRACE_SYSEMU handling
On Mon, Mar 04, 2019 at 06:23:32AM -0600, Segher Boessenkool wrote:
> On Mon, Mar 04, 2019 at 10:46:43AM +0000, Sudeep Holla wrote:
> > On Mon, Mar 04, 2019 at 08:03:47AM +0000, Haibo Xu (Arm Technology China) wrote:
> > > On 2019/3/1 2:32, Sudeep Holla wrote:
> > > > +long ptrace_syscall_enter(struct pt_regs *regs)
> > > > +{
> > > > +#ifdef TIF_SYSCALL_EMU
> > > > + if (test_thread_flag(TIF_SYSCALL_EMU)) {
> > > > + if (tracehook_report_syscall_entry(regs));
> > >
> > > Shall we remove the semi-colon at end of the above line?
> >
> > Added intentionally to keep GCC happy.
>
> GCC warns because the user explicitly asked for it, with __must_check.
> If you want to do things with an "if" like this, you should write e.g.
>
> if (tracehook_report_syscall_entry(regs))
> /*
> * We can ignore the return code here, because of
> * X and Y and Z.
> */
> ;
>
> Or it probably is nicer to use a block:
>
> if (tracehook_report_syscall_entry(regs)) {
> /*
> * We can ignore the return code here, because of
> * X and Y and Z.
> */
> }
>
> The point is, you *always* should have a nice fat comment if you are
> ignoring the return code of a __must_check function.
>
Agreed, will add the comment.
--
Regards,
Sudeep
Powered by blists - more mailing lists