Re: [PATCH] XArray: Fix a math problem in xa_is_err()

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

 



On Tue, Jan 15, 2019 at 01:07:26PM -0800, Matthew Wilcox wrote:
> On Tue, Jan 15, 2019 at 10:52:41PM +0300, Dan Carpenter wrote:
> > @@ -177,7 +177,8 @@ static inline bool xa_is_internal(const void *entry)
> >  static inline bool xa_is_err(const void *entry)
> >  {
> >  	return unlikely(xa_is_internal(entry) &&
> > -			(unsigned long)entry >= -((MAX_ERRNO << 2) + 2));
> > +			(unsigned long)entry >=
> > +				(((unsigned long)(-MAX_ERRNO << 2) + 2)));
> >  }
> 
> Ugh all the brackets, I'm not surprised I got it wrong.  How about this
> instead; does it make your static checker happy?
> 

I wasn't a super fan of that expression either...  I think your code
will work, and if not then it's the checker which needs fixing.  Thanks!

regards,
dan carpenter




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

  Powered by Linux