Re: [PATCH 3/3] status: Display an informational message when the VSTATUS character is pressed or TIOCSTAT ioctl is called.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 18, 2022 at 12:37:03PM +0100, Peter Zijlstra wrote:
> > > +static inline struct task_struct *compare(struct task_struct *new,
> > > +					  struct task_struct *old)
> > > +{
> > > +	unsigned int ostate, nstate;
> > > +
> > > +	if (old == NULL)
> > > +		return new;
> > > +
> > > +	ostate = task_state_index(old);
> > > +	nstate = task_state_index(new);
> > > +
> > > +	if (ostate == nstate) {
> 
> That's not an ordered set, please don't do that.

*sigh*.. sorry about that, I can't read, for some reason I thought you
did: ostate < nstate...

> > > +		if (old->start_time > new->start_time)
> > > +			return old;
> > > +		return new;
> > > +	}
> > > +
> > > +	if (ostate < nstate)
> > > +		return old;
> > > +
> > > +	return new;
> > > +}




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux