Messages in this thread | | | Date | Fri, 30 Aug 2019 12:46:04 +0200 | From | Peter Zijlstra <> | 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.
| |