[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190830104604.GC2369@hirez.programming.kicks-ass.net>
Date: Fri, 30 Aug 2019 12:46:04 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Satendra Singh Thakur <sst2005@...il.com>
Cc: satendrasingh.thakur@....com, tglx@...utronix.de,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] [semaphore] Removed redundant code from semaphore's
down family of function
On Fri, Aug 30, 2019 at 04:10:10PM +0530, Satendra Singh Thakur wrote:
> > +static inline long schedule_timeout(long timeout)
> > +{
> > + if (__builtin_constant_p(timeout) && timeout == MAX_SCHEDULE_TIMEOUT) {
> > + schedule();
> > + return timeout;
> > + }
> > +
> > + return __schedule_timeout(timeout);
> > +}
> > + if (timeout == MAX_SCHEDULE_TIMEOUT) {
> > schedule();
> > - goto out;
> Hi Mr Peter,
> I have a suggestion here:
> The condition timeout == MAX_SCHEDULE_TIMEOUT is already handled in
> schedule_timeout function
Only if it is a compile time constant; otherwise it will end up here.
> and same conditon is handled again in __schedule_timeout.
> Currently, no other function calls __schedule_timeout except schedule_timeout.
> Therefore, it seems this condition will never become true.
Please read more careful.
Powered by blists - more mailing lists