[PATCH v2 hmm 2/9] mm/hmm: return the fault type from hmm_pte_need_fault()

2020-03-30 Thread Jason Gunthorpe
From: Jason Gunthorpe Using two bools instead of flags return is not necessary and leads to bugs. Returning a value is easier for the compiler to check and easier to pass around the code flow. Convert the two bools into flags and push the change to all callers. Signed-off-by: Jason Gunthorpe

Re: [PATCH v2 hmm 2/9] mm/hmm: return the fault type from hmm_pte_need_fault()

2020-03-25 Thread Jason Gunthorpe
On Tue, Mar 24, 2020 at 08:27:12AM +0100, Christoph Hellwig wrote: > On Mon, Mar 23, 2020 at 10:14:50PM -0300, Jason Gunthorpe wrote: > > +enum { > > + HMM_NEED_FAULT = 1 << 0, > > + HMM_NEED_WRITE_FAULT = HMM_NEED_FAULT | (1 << 1), > > + HMM_NEED_ALL_BITS = HMM_NEED_FAULT |

[PATCH v2 hmm 2/9] mm/hmm: return the fault type from hmm_pte_need_fault()

2020-03-24 Thread Jason Gunthorpe
From: Jason Gunthorpe Using two bools instead of flags return is not necessary and leads to bugs. Returning a value is easier for the compiler to check and easier to pass around the code flow. Convert the two bools into flags and push the change to all callers. Signed-off-by: Jason Gunthorpe