Re: [PATCH v4 2/2] sched/rt, dl: Convert functions to return bool

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

 



On Mon, 3 Jun 2024 08:33:53 +0100
Metin Kaya <metin.kaya@xxxxxxx> wrote:

> On 01/06/2024 10:33 pm, Qais Yousef wrote:
> > {rt, realtime, dl}_{task, prio}() functions return value is actually
> > a bool.  Convert their return type to reflect that.
> > 
> > Suggested-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
> > Signed-off-by: Qais Yousef <qyousef@xxxxxxxxxxx>
> > ---
> >   include/linux/sched/deadline.h |  8 ++++----
> >   include/linux/sched/rt.h       | 16 ++++++++--------
> >   2 files changed, 12 insertions(+), 12 deletions(-)
> > 
> > diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h
> > index 5cb88b748ad6..f2053f46f1d5 100644
> > --- a/include/linux/sched/deadline.h
> > +++ b/include/linux/sched/deadline.h
> > @@ -10,18 +10,18 @@
> >   
> >   #include <linux/sched.h>
> >   
> > -static inline int dl_prio(int prio)
> > +static inline bool dl_prio(int prio)
> >   {
> >   	if (unlikely(prio < MAX_DL_PRIO))
> > -		return 1;
> > -	return 0;
> > +		return true;
> > +	return false;  
> 
> Nit: `return unlikely(prio < MAX_DL_PRIO)` would be simpler.
> The same can be applied to rt_prio() and realtime_prio(). This would 
> make {dl, rt, realtime}_task() single-liner. Maybe further 
> simplification can be done.

Agreed.

-- Steve




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux