Re: [PATCH rdma-next v1 1/3] overflow.h: Add arithmetic shift helper

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

 



On Sun, 2018-07-08 at 12:42 -0600, Jason Gunthorpe wrote:
> On Sun, Jul 08, 2018 at 03:31:45PM +0000, Bart Van Assche wrote:
> > On Sun, 2018-07-08 at 13:38 +0300, Leon Romanovsky wrote:
> > > + * - 'a << s' sets the sign bit, if any, in '*d'
> > 
> > Setting the highest bit is fine if a is unsigned.
> 
> No, it isn't, it makes 'd' negative, which is to be considered an overflow.

How could an *unsigned* number ever be negative? Please clarify.

Thanks,

Bart.



��.n��������+%������w��{.n�����{���fk��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux