Re: [PATCH v3] powerpc: Avoid signed to unsigned conversion in set_thread_tidr()

2017-11-27 Thread Vaibhav Jain
Sukadev Bhattiprolu writes: > We can eliminate the 'else' and be consistent with existing code, if > we check for error (i.e rc < 0) and return rc. assign_thread_tidr() will > not return 0, but even if it did, setting the register and thread.tidr > to 0 should not be a problem. Thanks for the su

Re: [PATCH v3] powerpc: Avoid signed to unsigned conversion in set_thread_tidr()

2017-11-27 Thread Sukadev Bhattiprolu
Vaibhav Jain [vaib...@linux.vnet.ibm.com] wrote: > There is an unsafe signed to unsigned conversion in set_thread_tidr() > that may cause an error value to be assigned to SPRN_TIDR register and > used as thread-id. Thanks for fixing this. I have a comment below > > The issue happens as assign_thr

[PATCH v3] powerpc: Avoid signed to unsigned conversion in set_thread_tidr()

2017-11-27 Thread Vaibhav Jain
There is an unsafe signed to unsigned conversion in set_thread_tidr() that may cause an error value to be assigned to SPRN_TIDR register and used as thread-id. The issue happens as assign_thread_tidr() returns an int and thread.tidr is an unsigned-long. So a negative error code returned from assig